[FIX] account_asset: Setting accounts on an account.asset.category
For the purchase case, see explanation on this commit 301559f7d8bf8480fd39962a2104661e4fe4bf38 For the sale case,a revenue recognition, (1)Deferred Revenue Account (2)Recognition Income Account (3)Recognition Account When making a revenue recognition in 5 years for 100k (1) is credited of 100k (2) is credited each year of 20k (3) is debited each year of 20k So in this case, (3) can be equal to (1).
This commit is contained in:
@@ -42,7 +42,10 @@ class AccountAssetCategory(models.Model):
|
||||
|
||||
@api.onchange('account_asset_id')
|
||||
def onchange_account_asset(self):
|
||||
self.account_depreciation_id = self.account_asset_id
|
||||
if self.type == "purchase":
|
||||
self.account_depreciation_id = self.account_asset_id
|
||||
elif self.type == "sale":
|
||||
self.account_depreciation_expense_id = self.account_asset_id
|
||||
|
||||
@api.onchange('type')
|
||||
def onchange_type(self):
|
||||
|
||||
@@ -85,7 +85,7 @@ class AccountInvoiceLine(models.Model):
|
||||
if self.invoice_id.type == 'out_invoice' and self.asset_category_id:
|
||||
self.account_id = self.asset_category_id.account_asset_id.id
|
||||
elif self.invoice_id.type == 'in_invoice' and self.asset_category_id:
|
||||
self.account_id = self.asset_category_id.account_depreciation_id.id
|
||||
self.account_id = self.asset_category_id.account_asset_id.id
|
||||
|
||||
@api.onchange('uom_id')
|
||||
def _onchange_uom_id(self):
|
||||
|
||||
Reference in New Issue
Block a user