-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[12.0][FIX] control vat format on vat client listing #216
base: 12.0
Are you sure you want to change the base?
[12.0][FIX] control vat format on vat client listing #216
Conversation
58f7d28
to
6ee6d81
Compare
company_vat = company_vat.replace(" ", "").upper() | ||
company_vat = company_vat.replace(" ", "").replace(".", "").upper() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is done in 2 places, it should go into a function.
also, to avoid multiple replace operations, re.sub()
can be used:
company_vat = re.sub("[ .]", "", company_vat).upper()
or maybe use fix_eu_vat_number() from the base_vat
module directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, using fix_eu_vat_number works, and it's a better solution, thanks :)
I port this change to the 14 branch
be_vat_pattern = re.compile(r"^BE0[1-9]{1}[0-9]{8}$") | ||
be_vat_pattern = re.compile(r"^BE[0-1][0-9]{9}$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous pattern forbid numbers starting with "00", while this does not. is this ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, according to this source, the format is 0xxx.xxx.xxx or 1xxx.xxx.xxx
2139d9c
to
1224070
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one slight change to do, squash all commits and we’ll be good to go. approving already to save time.
edit: and pre-commit should be run.
@@ -140,7 +141,8 @@ def get_partners(self): | |||
self.env.cr.execute(query, args) | |||
seq = 0 | |||
for record in self.env.cr.dictfetchall(): | |||
record["vat"] = record["vat"].replace(" ", "").upper() | |||
be_id = self.env.ref("base.be").id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be moved out of the loop.
Belgian VAT number now can start with a 1 rather than a 0 (see https://www.easytax.co/fr/tax-mag/info/belgique-changement-de-format-pour-les-numeros-de-tva-belges/)
1224070
to
0a56ed1
Compare
@huguesdk done ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks !
/ocabot merge minor |
What a great day to merge this nice PR. Let's do it! |
@robinkeunen your merge command was aborted due to failed check(s), which you can inspect on this commit of 12.0-ocabot-merge-pr-216-by-robinkeunen-bump-minor. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
@OCA/local-belgium-maintainers could you please merge this? |
/ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
@sbidoul your merge command was aborted due to failed check(s), which you can inspect on this commit of 12.0-ocabot-merge-pr-216-by-sbidoul-bump-patch. After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red. |
Hm weird error. I'll need to look into this. |
Belgian VAT number now can start with a 1 rather than a 0 (see https://www.easytax.co/fr/tax-mag/info/belgique-changement-de-format-pour-les-numeros-de-tva-belges/)
Also autoremove the dots in the VAT numbers (they are not checked by the VIES control, but produce errors in the VAT client listing report)
forward ported in v14 : #217