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

[FIX] l10n_id: adapt the check to the new VAT regulation #157885

Closed

Conversation

amay-odoo
Copy link

@amay-odoo amay-odoo commented Mar 15, 2024

The issue:
Currently, in Indonesia, the regulation for tax ID is 15 digits.
But a new regulation is coming where Tax ID is now 16 digits by adding 0 in front

The fix:
Remove the first zero and leave the rest for the _run_vat_test function

Related PR: #146111

opw-3782636

@robodoo
Copy link
Contributor

robodoo commented Mar 15, 2024

@C3POdoo C3POdoo requested review from a team and lordkrandel and removed request for a team March 15, 2024 15:44
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 15, 2024
@lordkrandel
Copy link
Contributor

lordkrandel commented Mar 18, 2024

Hello, sorry, but fix has an error:
I get a ValidationError when submitting an Italian partner with a VAT that starts with 0.

image

I don't also see the PO @tsb-odoo being asked whether removing the leading 0 is the correct way to go.

Probably _run_vat_check is not the correct function to use.
Please have a look inside the base_vat code:

The issue:
Currently, in Indonesia, the regulation for tax ID is 15 digits.
But a new regulation is coming where Tax ID is now 16 digits by adding 0 in front

The fix:
Remove the first zero and leave the rest for the _run_vat_test function

Related PR: odoo#146111

opw-3782636
@amay-odoo amay-odoo force-pushed the 17.0-l10n_id-new-vat-regulation-amay branch from 79643ac to da8e392 Compare March 21, 2024 16:55
@amay-odoo
Copy link
Author

Hello @lordkrandel , thank you for your review and help on this PR, I've made new changes and it should work now, could you please have a look?
thanks

@lordkrandel
Copy link
Contributor

Well, this PR really shortened, didn't it 😅
LGTM.

There's an ugly line just before your change:
image

It should be:

    if len(vat) not in (15, 16) or not vat.is_decimal():

but maybe it's not worth the diff at the moment.

@qdp-odoo for final review.

@amay-odoo
Copy link
Author

Hello @qdp-odoo , would you mind please looking at this PR when you are available? Thanks :)

@qdp-odoo
Copy link
Contributor

@robodoo r+
@lordkrandel good job, nice review 👍

@lordkrandel
Copy link
Contributor

@lordkrandel good job, nice review 👍

Thank you @qdp-odoo ! 🤝

willylohws pushed a commit to willylohws/odoo that referenced this pull request May 1, 2024
The issue:
Currently, in Indonesia, the regulation for tax ID is 15 digits.
But a new regulation is coming where Tax ID is now 16 digits by adding 0 in front

The fix:
Remove the first zero and leave the rest for the _run_vat_test function

Related PR: odoo#146111

opw-3782636

closes odoo#157885

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
@fw-bot
Copy link
Contributor

fw-bot commented May 1, 2024

2 similar comments
@fw-bot
Copy link
Contributor

fw-bot commented May 2, 2024

@fw-bot
Copy link
Contributor

fw-bot commented May 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants