odoo/odoo#159764

Created by fw-bot
label
odoo-dev:saas-16.3-16.0-wsale-tax-broll-vfe-u9UY-fw
head
cc9c01492ca7fc880b11000767c72bca08106e4c
target
saas-16.3
merged
1 month ago by Sales, Victor Feyens (vfe)
forward-port of
odoo/odoo#159122 DETACHED (conflicts: ('f53495c9bc5250f815d92bd222b2d0131fb37ba9', 'Auto-merging addons/account/models/product.py\nAuto-merging addons/sale/models/sale_order_line.py\nCONFLICT (content): Merge conflict in addons/sale/models/sale_order_line.py\n', '19:02:11.316330 git.c:463 trace: built-in: git cherry-pick f53495c9bc5250f815d92bd222b2d0131fb37ba9\nerror: could not apply f53495c9bc52... [IMP] account: split _get_tax_included_unit_price_from_price util\nhint: After resolving the conflicts, mark them with\nhint: "git add/rm <pathspec>", then run\nhint: "git cherry-pick --continue".\nhint: You can instead skip this commit with "git cherry-pick --skip".\nhint: To abort and get back to the state before "git cherry-pick",\nhint: run "git cherry-pick --abort".\n----------\nstatus:\n', ['f53495c9bc5250f815d92bd222b2d0131fb37ba9', 'b6dfb7f7f85c9e3531cd78650f8fa7cb2fe91b86']) ('f53495c9bc5250f815d92bd222b2d0131fb37ba9', 'Auto-merging addons/account/models/product.py\nAuto-merging addons/sale/models/sale_order_line.py\nCONFLICT (content): Merge conflict in addons/sale/models/sale_order_line.py\n', '19:02:11.316330 git.c:463 trace: built-in: git cherry-pick f53495c9bc5250f815d92bd222b2d0131fb37ba9\nerror: could not apply f53495c9bc52... [IMP] account: split _get_tax_included_unit_price_from_price util\nhint: After resolving the conflicts, mark them with\nhint: "git add/rm <pathspec>", then run\nhint: "git cherry-pick --continue".\nhint: You can instead skip this commit with "git cherry-pick --skip".\nhint: To abort and get back to the state before "git cherry-pick",\nhint: run "git cherry-pick --abort".\n----------\nstatus:\n', ['f53495c9bc5250f815d92bd222b2d0131fb37ba9', 'b6dfb7f7f85c9e3531cd78650f8fa7cb2fe91b86']))

[FW][FIX] website_sale: harmonize tax computation

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

Fixes #155162

---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: odoo/odoo#159122