-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
[16.0][ADD] sale_margin_tax #213
Open
len-foss
wants to merge
6
commits into
OCA:16.0
Choose a base branch
from
lambdao-dev:16.0-addmargin-len
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Jun 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 201e2f2 - Browse repository at this point
Copy the full SHA 201e2f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1d61fb - Browse repository at this point
Copy the full SHA d1d61fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b3c631 - Browse repository at this point
Copy the full SHA 8b3c631View commit details -
Configuration menu - View commit details
-
Copy full SHA for a05e555 - Browse repository at this point
Copy the full SHA a05e555View commit details -
[REF] sale_margin_tax: refactor for correct accounting
When accounting for margin tax sales, the purchase price and margin (that form the base for the tax lines) need to be split. This is because a different tax grid should be applied on both line. However, Odoo does not provide a way to split the base as it does to split the tax. Furthermore, adding a 'margin' line type does not work because the functions that apply the repartition lines etc are basically impossible to override (they do not provide any hook, and the arbitrary compute order would make any tentative very brittle). To avoid these difficulty, another line is created on a "margin" product (a service), so that both the purchase and the margin can be accounted as base lines. This provide the advantage that no further override of basic accounting functions are needed, and that the tax rate of the margin tax is always either the initial rate (say 21) or 0. The downside is that it makes so statistics harder. Since the margin line and the product lines are linked by a many2one, it is still possible to extract the relevant info, just a bit harder. This refactoring also merges the margin behaviour from invoice and sale into a mixin to avoid desync of the essentially duplicated code (if only both line/tax fields had the same name...). This solved a bug where an invoice would think to be margin-based but without finding a witness margin tax. Last, this now handles the case where the margin is negative, in which case no tax is due.
Configuration menu - View commit details
-
Copy full SHA for a39f40c - Browse repository at this point
Copy the full SHA a39f40cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 76768c6 - Browse repository at this point
Copy the full SHA 76768c6View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.