mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] account_asset_management: Don't empty profile
Steps to reproduce the problem - Create an asset profile with any asset account - Don't set the asset profile in such account - Create a vendor bill - Add a line, and select the asset profile Current behavior: - The account is set, but the profile is emptied Expected behavior: - Both account and profile are set This is because there's a condition on the computed writeable field that empty the value if no asset of the account doesn't have a linked profile, but that's not correct and different from the previous behavior before #1336 If CacheMiss exceptions arise, the proper solution is to reassign the value. TT35354
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
"name": "Assets Management",
|
||||
"version": "13.0.3.7.2",
|
||||
"version": "13.0.3.7.3",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["account", "report_xlsx_helper"],
|
||||
"excludes": ["account_asset"],
|
||||
|
||||
@@ -181,8 +181,8 @@ class AccountMoveLine(models.Model):
|
||||
rec.asset_profile_id = rec.account_id.asset_profile_id
|
||||
elif rec.asset_id:
|
||||
rec.asset_profile_id = rec.asset_id.profile_id
|
||||
else:
|
||||
rec.asset_profile_id = False
|
||||
else: # don't touch it - Needed for avoiding CacheMiss exceptions
|
||||
rec.asset_profile_id = rec.asset_profile_id
|
||||
|
||||
@api.onchange("asset_profile_id")
|
||||
def _onchange_asset_profile_id(self):
|
||||
|
||||
Reference in New Issue
Block a user