Skip to content

[FIX] website_sale: fix ecommerce product rating acl check - #257553

Closed
fw-bot wants to merge 1 commit into
odoo:saas-19.2from
odoo-dev:saas-19.2-saas-18.3-opw-6065319-rating-avg-access-issue-krip-514472-fw
Closed

[FIX] website_sale: fix ecommerce product rating acl check#257553
fw-bot wants to merge 1 commit into
odoo:saas-19.2from
odoo-dev:saas-19.2-saas-18.3-opw-6065319-rating-avg-access-issue-krip-514472-fw

Conversation

@fw-bot

@fw-bot fw-bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Steps to produce:

  • Install the Ecommerce module.
  • Create a product.
  • In the Sales tab, set an alternative product and ensure both are published.
  • Open the product page on the website and enable reviews from the editor.
  • Open the same product page in incognito mode.

Issue:

AccessError: You do not have enough rights to access the field "rating_avg"
on Product Variant (product.product).

Root cause:

  • Currently, product records in dynamic snippets to be fetched without
    superuser privileges. Since the rating_avg field is restricted to
    internal users, public visitors encounter an AccessError when
    viewing snippets with ratings enabled.
  • Similar approach used here.

opw-6065319

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

Forward-Port-Of: #257400
Forward-Port-Of: #256570

@robodoo

robodoo commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Apr 3, 2026
@fw-bot

fw-bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor Author

@krip-odoo @ltinel cherrypicking of pull request #256570 failed.

stdout:

Auto-merging addons/website_sale/templates/snippets/product_snippet_template_data.xml
CONFLICT (content): Merge conflict in addons/website_sale/templates/snippets/product_snippet_template_data.xml

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

Steps to produce:
- Install the `Ecommerce` module.
- Create a product.
- In the Sales tab, set an alternative product and ensure both are published.
- Open the product page on the website and enable `reviews` from the editor.
- Open the same product page in incognito mode.

Issue:
```
AccessError: You do not have enough rights to access the field "rating_avg"
on Product Variant (product.product).
```

Root cause:
- Currently, product records in dynamic snippets to be fetched without
  superuser privileges. Since the `rating_avg` field is restricted to
  internal users, public visitors encounter an `AccessError` when
  viewing snippets with ratings enabled.
- Similar approach used [here].

[here]: odoo@12bb994

opw-6065319

X-original-commit: f32c5b2
@krip-odoo
krip-odoo force-pushed the saas-19.2-saas-18.3-opw-6065319-rating-avg-access-issue-krip-514472-fw branch from 5fe217e to 9f2f8cb Compare April 3, 2026 12:36
@krip-odoo

Copy link
Copy Markdown
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Apr 3, 2026
Steps to produce:
- Install the `Ecommerce` module.
- Create a product.
- In the Sales tab, set an alternative product and ensure both are published.
- Open the product page on the website and enable `reviews` from the editor.
- Open the same product page in incognito mode.

Issue:
```
AccessError: You do not have enough rights to access the field "rating_avg"
on Product Variant (product.product).
```

Root cause:
- Currently, product records in dynamic snippets to be fetched without
  superuser privileges. Since the `rating_avg` field is restricted to
  internal users, public visitors encounter an `AccessError` when
  viewing snippets with ratings enabled.
- Similar approach used [here].

[here]: 12bb994

opw-6065319

closes #257553

X-original-commit: f32c5b2
Signed-off-by: Louis Tinel (loti) <loti@odoo.com>
Signed-off-by: Krishna Arvindkumar Patel (krip) <krip@odoo.com>
@robodoo robodoo closed this Apr 3, 2026
@fw-bot
fw-bot deleted the saas-19.2-saas-18.3-opw-6065319-rating-avg-access-issue-krip-514472-fw branch April 10, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants