[FIX] account uniq tax

This commit is contained in:
Fabien Pinckaers
2015-08-30 19:00:30 +02:00
parent 2ec5afde1c
commit 29c85d4e06
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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):
+1 -1
View File
@@ -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