Skip to content
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

Merged

Conversation

victor-champonnois
Copy link
Member

@victor-champonnois victor-champonnois commented Mar 1, 2024

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

@victor-champonnois victor-champonnois force-pushed the 12.0-fix-vat-check-on-vat-client-list branch from 58f7d28 to 6ee6d81 Compare March 1, 2024 15:55
@victor-champonnois victor-champonnois changed the title [12.0][FIX] control on vat format [12.0][FIX] control vat format on vat client listing Mar 1, 2024
company_vat = company_vat.replace(" ", "").upper()
company_vat = company_vat.replace(" ", "").replace(".", "").upper()
Copy link
Member

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?

Copy link
Member Author

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}$")
Copy link
Member

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?

Copy link
Member Author

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

@victor-champonnois victor-champonnois force-pushed the 12.0-fix-vat-check-on-vat-client-list branch from 2139d9c to 1224070 Compare March 6, 2024 11:21
Copy link
Member

@huguesdk huguesdk left a 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
Copy link
Member

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.

@victor-champonnois victor-champonnois force-pushed the 12.0-fix-vat-check-on-vat-client-list branch from 1224070 to 0a56ed1 Compare March 6, 2024 13:29
@victor-champonnois
Copy link
Member Author

@huguesdk done !

Copy link
Contributor

@robinkeunen robinkeunen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@robinkeunen
Copy link
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 12.0-ocabot-merge-pr-216-by-robinkeunen-bump-minor, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Apr 19, 2024
Signed-off-by robinkeunen
@OCA-git-bot
Copy link
Contributor

@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.

Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 18, 2024
@huguesdk
Copy link
Member

@OCA/local-belgium-maintainers could you please merge this?

@sbidoul
Copy link
Member

sbidoul commented Aug 19, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 12.0-ocabot-merge-pr-216-by-sbidoul-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Aug 19, 2024
Signed-off-by sbidoul
@OCA-git-bot
Copy link
Contributor

@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.

@sbidoul
Copy link
Member

sbidoul commented Aug 19, 2024

Hm weird error. I'll need to look into this.

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Aug 25, 2024
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 29, 2024
@huguesdk
Copy link
Member

huguesdk commented Jan 6, 2025

@sbidoul i guess the ci on 12.0 is deprecated? can this be merged manually, then (if yes, should we increment de version before)? anyway, could you remove the stale label and add no stale?

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

@huguesdk I had lost track of this. v12 is still supported in OCA. Could you rebase?

@huguesdk
Copy link
Member

huguesdk commented Jan 6, 2025

@sbidoul the branch is already based on the latest commit of 12.0.

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 12.0-ocabot-merge-pr-216-by-sbidoul-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 6, 2025
Signed-off-by sbidoul
@OCA-git-bot
Copy link
Contributor

@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.

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

Ah, I see. Same as OCA/l10n-spain#3733 (comment). Could you try the procedure explained there?

@huguesdk
Copy link
Member

huguesdk commented Jan 6, 2025

@sbidoul i get exactly the same error:

(...)
xlwt==1.3.0
yarl==1.7.2
zeep==4.1.0
zope.event==4.6
zope.interface==5.5.2
+ echo addons_path=/opt/odoo/addons,.
+ cat /etc/odoo.cfg
[options]
addons_path=/opt/odoo/addons,.
++ oca_list_external_dependencies deb
could not obtain odoo.addons.__path__ using python
not found in addons path: base,base_vat_sanitized,mis_builder,partner_identification,report_xml,web_notify
Aborted.
+ deps=

before running oca_install_addons, /etc/odoo.cfg contains only:

[options]

after running it, it contains:

[options]
addons_path=/opt/odoo/addons,.

it doesn’t find the base module because it is in /opt/odoo/odoo/addons, which is not in the addons_path. the other modules that are not found are oca modules (which i guess should be automatically installed from pypi). report_xml and web_notify are from repositories that are not in oca_dependencies.txt, but adding them doesn’t have any effect.

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

Sorry, I meant adding lxml<5.2 in test-requirements.txt, like they did in l10n-spain in OCA/l10n-spain#3762

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

You can see the error by running docker run -it --rm -v .:/_build --workdir /_build ghcr.io/oca/oca-ci/py3.6-odoo12.0 bash, then oca_install_addons, then odoo.

@huguesdk
Copy link
Member

huguesdk commented Jan 6, 2025

@sbidoul indeed, that did it, thanks! i created a separate branch for this (where i also addedd the missing repositories in oca_dependencies.txt: #233.

@sbidoul
Copy link
Member

sbidoul commented Jan 6, 2025

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 12.0-ocabot-merge-pr-216-by-sbidoul-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 42bab7c into OCA:12.0 Jan 6, 2025
4 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at dd7d851. Thanks a lot for contributing to OCA. ❤️

@huguesdk
Copy link
Member

huguesdk commented Jan 6, 2025

yes, finally! many thanks, @sbidoul!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved merged 🎉 stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants