Commit Graph

34 Commits

Author SHA1 Message Date
Luc De Meyer
e3dee68101 [IMP] account_asset_management: Add reporting 2021-02-09 17:11:27 +01:00
Pedro M. Baeza
97195359a7 [FIX] account_asset_management: Proper asset unlink + move unlink
2 related fixes:

- When removing an asset line depreciation move, we have to pass it
  first to draft, or we won't be able to remove it even with the
  context.
- When removing a move, the check for removing the linked asset should
  be only for purchase documents, not for "not sale" documents.
2020-12-22 09:08:51 +01:00
Florent de Labarre
8a9a646614 [FIX] account_asset_management : empty message is posted if there are no asset 2020-09-24 14:18:04 +02:00
Pedro M. Baeza
088c64a6cd [IMP] account_asset_management: Refinements 2020-08-12 17:47:23 +02:00
Carlos Dauden
362fecd752 [IMP] account_asset_management: Improve code and translation 2020-08-12 17:33:20 +02:00
Saran440
8e3419a791 [FIX] account_asset_management - Allow editing salvage value 2020-08-06 17:33:27 +07:00
OCA-git-bot
74692c83fb Merge PR #1017 into 13.0
Signed-off-by pedrobaeza
2020-07-20 07:06:50 +00:00
Valentin Vinagre Urteaga
d7f7a415c2 [FIX] account_asset_management: FIX empty asset reference
If the assets are created before posting the invoice, they wouldn't have a name and the "code" field of the assets will be empty, but they would have the invoice name.
2020-07-17 16:29:16 +02:00
Ernesto Tejeda
2febf57981 [FIX] account_asset_management: fix remaining_value cache miss error. 2020-07-08 20:11:10 -04:00
Valentin Vinagre Urteaga
b9365abbaa [IMP] account_asset_management: Add chatter entry in invoice for generated asset 2020-07-03 18:39:28 +02:00
Andrea
4960cdc00d Fix of pre-commit: E741 ambiguous variable name 'l' 2020-05-12 13:43:05 +02:00
Quentin Groulard
1880da690b [IMP] account_asset_management: Depreciation board compute upon asset confirmation 2020-04-29 19:32:20 +02:00
Pedro M. Baeza
7db1160d13 [IMP] account_asset_management: Simplify code for opening related entries
We don't need the search having the one2many field and no need also for list
comprehension having mapped operator.
2020-03-18 19:51:55 +01:00
Pedro M. Baeza
f695ee7ffc [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.
2020-03-18 19:50:47 +01:00
ernestotejeda
b7637cbe45 [MIG] account_asset_management: Migration to 13.0 2020-02-10 19:35:00 +01:00
ernestotejeda
ebe0b9f152 [IMP] account_asset_management: black, isort 2020-02-10 19:35:00 +01:00
Luc De Meyer
3f8b033bd3 [12.0][FIX]traceback when deviating FY 2020-02-10 19:35:00 +01:00
Iván Todorovich
6a7e93fb1f [12.0][FIX][account_asset_management] local variable 'asset' referenced before assignment
tools/account_asset_management/models/account_asset.py", line 970, in _compute_entries
    % (asset.name, asset.code) or asset.name
UnboundLocalError: local variable 'asset' referenced before assignment
2020-02-10 19:33:32 +01:00
Joan Sisquella
d9cb201281 [ADD] allows setting a depreciation ending date 2020-02-10 19:33:32 +01:00
Saran
2c18c391d7 [ADD] options 'use_leap_years' 2020-02-10 19:33:32 +01:00
Saran
0e34c8bd8c [12.0][IMP] account_asset_management 2020-02-10 19:33:32 +01:00
Pedro M. Baeza
500ae8b4c9 [MIG+FIX+IMP] account_asset_management: Rework migration scripts + make asset group m2m 2020-02-10 19:33:32 +01:00
Henrik Norlin
4ecf1c62e3 [IMP] removed type, parent_id, parent_path, child_ids from account.asset & account.asset.profile 2020-02-10 19:33:32 +01:00
Pedro M. Baeza
a115f2562a [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.
2020-02-10 19:33:32 +01:00
Luc De Meyer
911161a87e [FIX][12.0]asset_management - fix date string compare 2020-02-10 19:33:32 +01:00
Pedro M. Baeza
acbb8b8315 [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.
2020-02-10 19:33:32 +01:00
Henrik
a344f434ca [12.0][FIX] account_asset_management: date_range -> account_fiscal_year, account_analytic_id without domain 2020-02-10 19:33:32 +01:00
Bejaoui Souheil
fb622444df 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
2020-02-10 19:33:32 +01:00
Maxence Groine
25d25f7686 Included PR #828 Fix computation of depreciation lines when having multiple assets in invoice 2020-02-10 19:31:38 +01:00
Henrik Norlin
a13c99e8e7 [MIG] account_asset_management: Migration to 12.0 2020-02-10 19:31:38 +01:00
Akim Juillerat
a6e3e44efd [MIG] account_asset_management: Migration to 11.0 2020-02-10 19:31:38 +01:00
Luc De Meyer
c53773f900 [FIX] account_asset_management: Test data + onchange 2020-02-10 19:30:08 +01:00
Akim Juillerat
be73d8449a [FIX+IMP] account_asset_management: 2 things:
* Fix compute methods dependencies and small optimizations
* Rename demo file to test and move it into the right folder
2020-02-10 19:29:40 +01:00
Luc De Meyer
e950266e60 [10.0][MIG]account_asset_management suite refactoring + 10.0 port 2020-02-10 19:29:24 +01:00