Skip to content

[18.0][MIG] account_ecotax_tax - #562

Open
rvalyi wants to merge 14 commits into
OCA:18.0from
akretion:18.0-mig-account_ecotax_tax
Open

[18.0][MIG] account_ecotax_tax#562
rvalyi wants to merge 14 commits into
OCA:18.0from
akretion:18.0-mig-account_ecotax_tax

Conversation

@rvalyi

@rvalyi rvalyi commented Nov 30, 2025

Copy link
Copy Markdown
Member

standard migration from the 17.0 migration #561

@rvalyi
rvalyi marked this pull request as draft November 30, 2025 05:15
@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch from a228729 to d9ad959 Compare December 1, 2025 02:18
@rvalyi

rvalyi commented Dec 1, 2025

Copy link
Copy Markdown
Member Author

/ocabot migration account_ecotax_tax

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Dec 1, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Dec 1, 2025
12 tasks
@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch 2 times, most recently from cb2b74f to 9d42c54 Compare December 1, 2025 12:33
@rvalyi
rvalyi marked this pull request as ready for review December 1, 2025 12:37
@rvalyi rvalyi changed the title [18.0] mig account_ecotax_tax [18.0][MIG] account_ecotax_tax Dec 2, 2025
@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown

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 Apr 5, 2026
florian-dacosta and others added 11 commits April 17, 2026 03:21
…_tax

The goal is to be able to choose between the implementation with and without using the odoo tax mechanism.
The advantages of the implementation based on Odoo tax mechanims are :
- Possibility to choose if product price include or exclude the ecotax amounts
- Isolate the ecotax amounts into a specifc accounting account
The disadvantage is that it adds a small layer of complexity and you have to manage the tax configuration and see all those ecotax taxes on your invoices
And a major difference which can be good or not depending on your use cases, the ecotax amounts are not in the turnover when using Odoo tax mechanism
…n from tests

The dependency does not really ease the present test but forces us to put the test as post-installed which cant work as account_ecotax_tax changes the account_ecotax behavior
Instead of isolating the tests of account_ecotax, it seems better to get rid of the AccountTestInvoicingCommon dependency. It also speed up the tests.
Currently translated at 100.0% (9 of 9 strings)

Translation: account-fiscal-rule-16.0/account-fiscal-rule-16.0-account_ecotax_tax
Translate-URL: https://translation.odoo-community.org/projects/account-fiscal-rule-16-0/account-fiscal-rule-16-0-account_ecotax_tax/it/
… excluded tax

This is the main real use case and the price include case does not work at the moment
@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch from 9d42c54 to 0b78f90 Compare April 17, 2026 03:22
@OCA-git-bot OCA-git-bot added series:18.0 mod:account_ecotax_tax Module account_ecotax_tax labels Apr 17, 2026
@github-actions github-actions Bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 19, 2026
# result = quantity and product.weight_based_ecotax * quantity or 0.0
result = quantity and product.fixed_ecotax * quantity or 0.0
# for weight based ecotax:
# quantity and product.weight_based_ecotax * quantity or 0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comments are not allowed anymore, I run into the erreor :

Malformed formula '# price_unit
# product: product.product object or None
# partner: res.partner object or None
# for weight based ecotax:
# quantity and  product['weight_based_ecotax'] * quantity or 0.0
quantity and product['fixed_ecotax'] * quantity or 0.0' at position 0

I guess we have to remove the whole comment.
I am not sure if there is a reason to create 2 ecotax taxes, one for fixed amount an the other one for weight amount, like suggested by the comment.
Is there any reason not to used the product.ecotax_amount instead, to have the whole amount ?

Also, if we only have one excotax, tax, I guess it would make sense to create it by default ? Well this could be a latter improvement of course, not really related to the migration.

Otherwise, it seems to work as expected.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

comments are not allowed anymore, I run into the erreor :

Malformed formula '# price_unit
# product: product.product object or None
# partner: res.partner object or None
# for weight based ecotax:
# quantity and  product['weight_based_ecotax'] * quantity or 0.0
quantity and product['fixed_ecotax'] * quantity or 0.0' at position 0

You are right, we also removed it for our other customer who tested it all with their accountant:
2026-05-07_12-16

I guess we have to remove the whole comment. I am not sure if there is a reason to create 2 ecotax taxes, one for fixed amount an the other one for weight amount, like suggested by the comment. Is there any reason not to used the product.ecotax_amount instead, to have the whole amount ?

Look I didn't design the module and I'm not sure either about that... (may be it came from C2C?) All I can tell you is that we got an accountant validated everything for France when configured as above.

Also, if we only have one excotax, tax, I guess it would make sense to create it by default ? Well this could be a latter improvement of course, not really related to the migration.

Done. Notice I had to hard-code it for country_id France to get tests pass. But it is also noupdate=True so I think this is de good default.

Otherwise, it seems to work as expected.

That's what we found as well...

@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch from 0b78f90 to 6571cc1 Compare May 7, 2026 10:53
@OCA-git-bot OCA-git-bot added the mod:account_ecotax Module account_ecotax label May 7, 2026
@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch 2 times, most recently from b913f39 to 09a6d72 Compare May 7, 2026 12:31
@rvalyi
rvalyi force-pushed the 18.0-mig-account_ecotax_tax branch from 09a6d72 to 187a68e Compare May 7, 2026 12:46
@rvalyi
rvalyi requested a review from florian-dacosta May 7, 2026 12:49

@florian-dacosta florian-dacosta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor remark I think it would be good to change but not blocking.

Done. Notice I had to hard-code it for country_id France to get tests pass. But it is also noupdate=True so I think this is de good default.

No sure about this one, not sure it is a good thing to make a change so the test pass, can't we adapt the test if needed.
Anyway, we may go this way and see how we adapt, I think that the ecotax management for foreign countries is not well managed in the module yet, we'll probably have to improve stuff around this.

# result = quantity and product.weight_based_ecotax * quantity or 0.0
result = quantity and product.fixed_ecotax * quantity or 0.0
self.formula = """
quantity and product.fixed_ecotax * quantity or 0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, since there is no obvious reason to have one dedicated tax to fixed ecotax and one for weight ecotax, I'd prefer to switch on one taxe for both case by default, seems simpler.
If it becomes an issue, we'll just change back and add a comment somewhere to explain why it would not be advised.
In the meantime, one can still duplicated the tax manually to have both if he likes.
The only reason I see to add multiple ecotax tax is to manage multiple account.account. But, we could also want multiple fixed amount tax, it depends on the accountant I guess.

<field name="is_ecotax" eval="True" />
<field
name="formula"
>quantity and product.fixed_ecotax * quantity or 0.0</field>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, since there is no obvious reason to have one dedicated tax to fixed ecotax and one for weight ecotax, I'd prefer to switch on one taxe for both case by default, seems simpler.
If it becomes an issue, we'll just change back and add a comment somewhere to explain why it would not be advised.
In the meantime, one can still duplicated the tax manually to have both if he likes.
The only reason I see to add multiple ecotax tax is to manage multiple account.account. But, we could also want multiple fixed amount tax, it depends on the accountant I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:account_ecotax_tax Module account_ecotax_tax mod:account_ecotax Module account_ecotax series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants