[FIX] account uniq tax
This commit is contained in:
@@ -499,6 +499,10 @@ class AccountTax(models.Model):
|
||||
tag_ids = fields.Many2many('account.account.tag', 'account_tax_account_tag', string='Tags', help="Optional tags you may want to assign for custom reporting")
|
||||
tax_group_id = fields.Many2one('account.tax.group', string="Tax Group", default=_default_tax_group, required=True)
|
||||
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id, type_tax_use)', 'Tax names must be unique !'),
|
||||
]
|
||||
|
||||
@api.one
|
||||
@api.constrains('children_tax_ids', 'type_tax_use')
|
||||
def _check_children_scope(self):
|
||||
|
||||
@@ -404,7 +404,7 @@ class AccountTaxTemplate(models.Model):
|
||||
tag_ids = fields.Many2many('account.account.tag', string='Account tag', help="Optional tags you may want to assign for custom reporting")
|
||||
|
||||
_sql_constraints = [
|
||||
('name_company_uniq', 'unique(name, company_id)', 'Tax names must be unique !'),
|
||||
('name_company_uniq', 'unique(name, company_id, type_tax_use)', 'Tax names must be unique !'),
|
||||
]
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user