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

Skip to content

Commit dacabd6

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 close 8000 s odoo#174817 Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
1 parent c5bbbb4 commit dacabd6

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
@@ -822,7 +822,7 @@ def check_vat_de(self, vat):
822822
return is_valid_vat(vat) or is_valid_stnr(vat)
823823

824824
def check_vat_il(self, vat):
825-
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
825+
check_func = stdnum.util.get_cc_module('il', 'idnr').is_valid
826826
return check_func(vat)
827827

828828
def format_vat_sm(self, vat):

0 commit comments

Comments
 (0)
0