odoo/odoo#189378
Created by fw-bot
Merged
at 1e4ab4e7b20a91acf409eba24b72cfb04ab9a5fd
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:17.0-18.0-opw-4354321-standard_price_access_rights-sile-3_rJ-fw
- head
- d2d1f887c7c987dd98ec9fa859afe9088e32e665
- merged
- 1 year ago by Accounting, Laurent Smet (las)
| odoo/odoo | |
|---|---|
| 16.0 | #189186 |
| 17.0 | #189378 |
| saas-17.2 | #189490 |
| saas-17.4 | #189902 |
| 18.0 | #189920 |
| saas-18.2 | |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master | #189948 |
[FW][FIX] account_tax_python: prevent access error on tax computation
Versions
- 16.0+
Steps (18.0+)
- Have the
account_tax_pythonmodule installed; - define a sales tax using "Custom Formula";
- define a formula based on
product.standard_price; - have the tax enabled for products in eCommerce;
- as a Public User, go to the eCommerce page.
Issue
> 403: Forbidden
Cause
Commit de302c2 changed the way company dependent fields are handled. Instead of computing them via _compute_company_dependent, they are now stored in the database.
Before this this change, any groups restriction added to a field wasn't actually checked. After this change, it does get checked, leading to the 403 error.
Solution
When computing taxes, pass product with sudo to ensure access to all necessary fields.
Forward-Port-Of: #189186