odoo/odoo#189378

Created by fw-bot
Merged at 1e4ab4e7b20a91acf409eba24b72cfb04ab9a5fd

Statuses:

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+)

  1. Have the account_tax_python module installed;
  2. define a sales tax using "Custom Formula";
  3. define a formula based on product.standard_price;
  4. have the tax enabled for products in eCommerce;
  5. 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.

opw-4354321

Forward-Port-Of: #189186