[IMP] account: multi company domain on product account fields
As we have to set account on product and product category to know in which account generate some accounting entries in some business flow (e.i.: expense), we need to keep some consistence with those accounts. Since those fields are company dependent, meaning their value depends on the current company, we want to ease the selection for the end user by only displaying the relation available in the current company. To do so, specific domain are needed. This guidelines should be applyied on each property fields. Task-1999686
This commit is contained in:
@@ -9,11 +9,11 @@ class ProductCategory(models.Model):
|
||||
|
||||
property_account_income_categ_id = fields.Many2one('account.account', company_dependent=True,
|
||||
string="Income Account",
|
||||
domain=[('deprecated', '=', False)],
|
||||
domain="['&', ('deprecated', '=', False), ('company_id', '=', current_company_id)]",
|
||||
help="This account will be used when validating a customer invoice.")
|
||||
property_account_expense_categ_id = fields.Many2one('account.account', company_dependent=True,
|
||||
string="Expense Account",
|
||||
domain=[('deprecated', '=', False)],
|
||||
domain="['&', ('deprecated', '=', False), ('company_id', '=', current_company_id)]",
|
||||
help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation.")
|
||||
|
||||
#----------------------------------------------------------
|
||||
@@ -28,11 +28,11 @@ class ProductTemplate(models.Model):
|
||||
domain=[('type_tax_use', '=', 'purchase')], default=lambda self: self.env.company.account_purchase_tax_id)
|
||||
property_account_income_id = fields.Many2one('account.account', company_dependent=True,
|
||||
string="Income Account",
|
||||
domain=[('deprecated', '=', False)],
|
||||
domain="['&', ('deprecated', '=', False), ('company_id', '=', current_company_id)]",
|
||||
help="Keep this field empty to use the default value from the product category.")
|
||||
property_account_expense_id = fields.Many2one('account.account', company_dependent=True,
|
||||
string="Expense Account",
|
||||
domain=[('deprecated', '=', False)],
|
||||
domain="['&', ('deprecated', '=', False), ('company_id', '=', current_company_id)]",
|
||||
help="Keep this field empty to use the default value from the product category. If anglo-saxon accounting with automated valuation method is configured, the expense account on the product category will be used.")
|
||||
|
||||
def _get_product_accounts(self):
|
||||
|
||||
Reference in New Issue
Block a user