8000 [FIX] base_vat: correct the method check_vat_il to not call self.company · odoo-dev/odoo@87feb0d · GitHub
[go: up one dir, main page]

Skip to content

Commit 87feb0d

Browse files
committed
[FIX] base_vat: correct the method check_vat_il to not call self.company
In this PR: odoo#172760 the check_vat_il function is calling self.company. It appears it was not a good idea and several things were not done well: - It could lead to errors as run_vat_test can be called on multiple partners: https://github.com/odoo/odoo/blob/16.0/addons/base_vat/models/res_partner.py#L170. - The previous PR is also checking the VAT number depending on the field is_company but did not put it as a constraint. This can be fixed, but with more changes than needed. It has been decided to use the `` check for all Israeli VAT numbers, regardless of the partner type. With this change the VAT check for companies is not complete: it is not tested that they begin by a 5. But it is good enough. opw-3954674 X-original-commit: dacabd6
1 parent c3f7e50 commit 87feb0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/base_vat/models/res_partner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def check_vat_de(self, vat):
782782
return is_valid_vat(vat) or is_valid_stnr(vat)
783783

784784
def check_vat_il(self, vat):
785-
check_func = stdnum.util.get_cc_module('il', 'hp').is_valid if self.is_company else stdnum.util.get_cc_module('il', 'idnr').is_valid
785+
check_func = stdnum.util.get_cc_module('il', 'idnr').is_valid
786786
return check_func(vat)
787787

788788
def format_vat_sm(self, vat):

0 commit comments

Comments
 (0)
0