[FIX] account: public user cannot access product with tag

Install module l10n_eu_oss_reports and website_sale
Edit a product (i.e. Acoustic Bloc Screens)
In Accounting tab add an account tag
Try to access the product webshop page as public user

User receive an error message

403: Forbidden
The page you were looking for could not be authorized.

Error message:
You are not allowed to access 'Account Tag' (account.account.tag) records.
[...]

This occurs because during tax computation the system try to access
account tags but they cannot be read by the public user

opw-3455325

closes odoo/odoo#149638

X-original-commit: 6428081e385ff08e6d4be47938e8b91abeb4246b
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2024-01-21 19:59:29 +00:00
parent ec0cd75328
commit 84ea3966ac
+1 -1
View File
@@ -834,7 +834,7 @@ class AccountTax(models.Model):
# Get product tags, account.account.tag objects that need to be injected in all
# the tax_tag_ids of all the move lines created by the compute all for this product.
product_tag_ids = product.account_tag_ids.ids if product else []
product_tag_ids = product.sudo().account_tag_ids.ids if product else []
taxes_vals = []
i = 0