mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 13:22:05 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
|
|
@ -12,9 +12,9 @@ class ResPartner(models.Model):
|
|||
@api.depends('vat', 'country_id')
|
||||
def _compute_company_registry(self):
|
||||
# OVERRIDE
|
||||
# If a belgian company has a VAT number then it's company registry is it's VAT Number (without country code).
|
||||
# If a belgian company has a VAT number then its company registry is its VAT Number (without country code).
|
||||
super()._compute_company_registry()
|
||||
for partner in self.filtered(lambda p: p.country_id.code == 'BE' and p.vat):
|
||||
for partner in self.filtered(lambda p: p._deduce_country_code() == 'BE' and p.vat):
|
||||
vat_country, vat_number = self._split_vat(partner.vat)
|
||||
if vat_country == 'be' and self.simple_vat_check(vat_country, vat_number):
|
||||
if vat_country in ('BE', '') and self._check_vat_number('BE', vat_number):
|
||||
partner.company_registry = vat_number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue