Commit Graph

71 Commits

Author SHA1 Message Date
Andrea
07c4a4edb1 Fix of pre-commit: E741 ambiguous variable name 'l' 2021-01-13 07:53:35 +00:00
Quentin Groulard
1c8874c8dd [IMP] account_asset_management: Depreciation board compute upon asset confirmation 2021-01-13 07:53:35 +00:00
Ernesto Tejeda
62af7667b5 [FIX] account_asset_management: Fix tests 2021-01-13 07:53:35 +00:00
Pedro M. Baeza
b9d13cdc51 [FIX] account_asset_management: Avoid error
Steps to reproduce the problem:

* Go to assets view
* Group by profile
* Unfold a group and click on an asset
* Click on "Journal Entries" smart-button
* Go back to the asset list
* Click again on the same asset (or another).
* Click on "Journal Entries" smart-button

Current behavior:

Error saying "KeyError: 'profile_id'"

Expected behavior:

No error

The cause for this is that Odoo stores in the context the key `group_by` with the
value `profile_id` in the specified chain of steps. That context entry is used for
grouping records in the list, and system tries to group the journal entries also
by that field, which doesn't exists in the other model, and thus the error.

We avoided it copying the context to be passes and leaving out that entry.
2021-01-13 07:53:35 +00:00
ernestotejeda
49e6643094 [MIG] account_asset_management: Migration to 13.0 2021-01-13 07:53:35 +00:00
ernestotejeda
22b491e1c0 [IMP] account_asset_management: black, isort 2021-01-13 07:53:35 +00:00
Stéphane Valaeys
3e1e63b085 Fixed dynamic build of the name of the view to be called when errors are found 2021-01-13 07:53:35 +00:00
Luc De Meyer
55aa4cad58 [12.0][FIX]traceback when deviating FY 2021-01-13 07:53:35 +00:00
Pedro M. Baeza
f5991f33f9 [MIG] account_asset_management: Handle account_asset_analytic migration
Only field renaming is needed.
2021-01-13 07:53:35 +00:00
Saran
66f345e2f3 [12.0][IMP] account_asset_management 2021-01-13 07:53:35 +00:00
Pedro M. Baeza
2dffd4070d [MIG+FIX+IMP] account_asset_management: Rework migration scripts + make asset group m2m 2021-01-13 07:53:35 +00:00
Henrik Norlin
187846d3ee [IMP] removed type, parent_id, parent_path, child_ids from account.asset & account.asset.profile 2021-01-13 07:53:35 +00:00
Pedro M. Baeza
a483203c37 [FIX] account_asset_management: Don't depend on account.fiscal.year created records
* There's no need of forcing to create such records if your fiscal years are regular ones.
* FY date range computation duplicates code that is already on core.
* DummyFY is a good idea, but was not used at all. Now it is.
2021-01-13 07:53:35 +00:00
Luc De Meyer
cbc0669189 [FIX][12.0]asset_management - fix date string compare 2021-01-13 07:53:35 +00:00
Pedro M. Baeza
d413d1b904 [FIX] account_asset_management: Invisible conditions must be independent from extra method_time values
If not, added methods won't hide these fields.
2021-01-13 07:53:35 +00:00
Pedro M. Baeza
ca270fe67e [FIX] account_asset_management: Provide hook _compute_depreciation_amount_per_fiscal_year
This way, other method_time mechanism like localization ones is able to overwrite it.

You also got an error of variable `number` not set due to previous code. Although no
alternate implementation for a new method_time, now you don't have any error,
fallbacking to standard proportional repartition.
2021-01-13 07:53:35 +00:00
Bejaoui Souheil
a92e32cf89 Finish 12.0 migration of account_asset_management
* account_asset: Do not loop on all the lines to search for one linked asset

Before this change, the use of `mapped` on self did loop on all the move
lines that are included in self to get the assets, what could be very
costly for a simple write on a lot of move lines. As the goal is to raise
an error only if at least one move is linked to an asset, we break the
loop if the condition is fulfilled.

* performance improvement

* [RMV] - Remove useless dependency

In 12.0 account_fiscal_year is a standard feature no need to depend on oca
module account_fiscal_year
2021-01-13 07:53:34 +00:00
Henrik Norlin
637b1fa013 [MIG] account_asset_management: Migration to 12.0 2021-01-13 07:53:34 +00:00
Stéphane Bidoul (ACSONE)
e121469c82 [IMP] asset mgt: use exclude manifest key
This is now supported natively by Odoo 11.
2021-01-13 07:53:34 +00:00
Akim Juillerat
b08d477d8f [MIG] account_asset_management: Migration to 11.0 2021-01-13 07:53:34 +00:00
Luc De Meyer
a1650a3028 [10.0][MIG]account_asset_management suite refactoring + 10.0 port 2021-01-13 07:53:34 +00:00