Browse Source

[FIX] partner_vat_unique: constrain on company change

12.0
david 4 years ago
committed by Pedro M. Baeza
parent
commit
8e7fe29273
  1. 2
      partner_vat_unique/__manifest__.py
  2. 2
      partner_vat_unique/models/res_partner.py

2
partner_vat_unique/__manifest__.py

@ -4,7 +4,7 @@
"name": "Partner VAT Unique",
"summary":
"Module to make the VAT number unique for customers and suppliers.",
"version": "12.0.1.0.2",
"version": "12.0.1.0.3",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/partner-contact",
"author": "Grant Thornton S.L.P, Odoo Community Association (OCA)",

2
partner_vat_unique/models/res_partner.py

@ -12,7 +12,7 @@ class ResPartner(models.Model):
vat = fields.Char(copy=False)
@api.constrains('vat')
@api.constrains('vat', 'company_id')
def _check_vat_unique(self):
for record in self:
if record.parent_id or not record.vat:

Loading…
Cancel
Save