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
[FW][FIX] website_sale: harmonize tax computation #159764
[FW][FIX] website_sale: harmonize tax computation #159764
Conversation
@Feyensv @smetl cherrypicking of pull request #159122 failed. stdout:
stderr:
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
3a9737d
to
f4bdbf2
Compare
separate the true computation of the tax value from the computation of the base unit price (uom & curr conversion, ...). That way, the risks of unwanted side-effects is reduced when the base unit price is already computed (sale, website_sale). Also allows preprocessing the taxes mapping, which doesn't have to be done multiple times when we compute different amounts for the same product/template. original commit: 9ba0bf8
4bbce71
to
8400616
Compare
Standard `sale` tax flows rely on `_get_tax_included_price_unit`, whereas part of `website_sale` flows do, while another part relies on `_fix_tax_included_price_company`, which doesn't handle some advanced cases (fiscal position mapping of price_included taxes). This commit drops the use of `_fix_tax_included_price_company` in website_sale, to only use the newest API of `_get_tax_included_price_unit`, supposed to handle more cases. Also makes all taxes computation go through a single entry point, `_apply_taxes_to_price`, already used for `combination_info` logic (/shop/product), but not in `_get_sales_prices` (/shop page). opw-3700803 original commit : 5e522d4
8400616
to
cc9c014
Compare
@robodoo r+ rebase-ff |
Merge method set to rebase and fast-forward. |
separate the true computation of the tax value from the computation of the base unit price (uom & curr conversion, ...). That way, the risks of unwanted side-effects is reduced when the base unit price is already computed (sale, website_sale). Also allows preprocessing the taxes mapping, which doesn't have to be done multiple times when we compute different amounts for the same product/template. original commit: 9ba0bf8 Part-of: #159764
Standard `sale` tax flows rely on `_get_tax_included_price_unit`, whereas part of `website_sale` flows do, while another part relies on `_fix_tax_included_price_company`, which doesn't handle some advanced cases (fiscal position mapping of price_included taxes). This commit drops the use of `_fix_tax_included_price_company` in website_sale, to only use the newest API of `_get_tax_included_price_unit`, supposed to handle more cases. Also makes all taxes computation go through a single entry point, `_apply_taxes_to_price`, already used for `combination_info` logic (/shop/product), but not in `_get_sales_prices` (/shop page). opw-3700803 original commit : 5e522d4 closes #159764 Signed-off-by: Laurent Smet (las) <las@odoo.com> Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Standard
sale
tax flows rely on_get_tax_included_price_unit
,whereas part of
website_sale
flows do, while another part relieson
_fix_tax_included_price_company
, which doesn't handle someadvanced cases (fiscal position mapping of price_included taxes).
This commit drops the use of
_fix_tax_included_price_company
inwebsite_sale, to only use the newest API of
_get_tax_included_price_unit
,supposed to handle more cases.
Also makes all taxes computation go through a single entry point,
_apply_taxes_to_price
, already used forcombination_info
logic (/shop/product),but not in
_get_sales_prices
(/shop page).opw-3700803
Fixes #155162
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #159122