Skip to content

[16.0][IMP] product_margin_classification: improve taxes computation#245

Merged
OCA-git-bot merged 1 commit into
OCA:16.0from
coopiteasy:16.0-imp-product_margin_classification-handle_fixed_taxes
Oct 19, 2025
Merged

[16.0][IMP] product_margin_classification: improve taxes computation#245
OCA-git-bot merged 1 commit into
OCA:16.0from
coopiteasy:16.0-imp-product_margin_classification-handle_fixed_taxes

Conversation

@huguesdk

@huguesdk huguesdk commented Jun 13, 2025

Copy link
Copy Markdown
Member
  • add support for taxes of amount_type "fixed".
  • take the include_base_amount field into account.

@huguesdk huguesdk force-pushed the 16.0-imp-product_margin_classification-handle_fixed_taxes branch from 3e68581 to 536d5ab Compare June 13, 2025 15:16
# this code assumes that taxes having price_include set to
# True and of amount_type "percent" have also
# include_base_amount set to True, while those of amount_type
# "fixed" have include_base_amount set to False.

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.

Better to write a test and raise a not implemented error, if conditions are not checked.

Also, i'm not sur it will work if there are fixed and percent taxes, in various order.

Dont you think ?

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.

yes, i agree with you. i was hesitating to add a check and raise an error, but since the current code doesn't do it (while already assuming the condition on "percent" taxes), i didn’t do it. i will add it. note that it might break current configurations.

about multiple tax combinations, i added some tests to test the most common cases.

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.

instead of adding exceptions, i improved the code to handle cases with include_base_amount True or False. what do you think?

* add support for taxes of amount_type "fixed".
* take the include_base_amount field into account.
@huguesdk huguesdk force-pushed the 16.0-imp-product_margin_classification-handle_fixed_taxes branch from 536d5ab to a2b6bc8 Compare June 16, 2025 13:24
@huguesdk huguesdk changed the title [16.0][IMP] product_margin_classification: add support for taxes of amount_type "fixed" [16.0][IMP] product_margin_classification: improve taxes computation Jun 16, 2025

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

Thanks !

@github-actions

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 Oct 19, 2025

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

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-245-by-legalsylvain-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8a4e3f6 into OCA:16.0 Oct 19, 2025
6 of 7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

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

Labels

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.

3 participants