Files
odoo_source/addons/website/models
Nasreddin Boulif (bon) cb789579d2 [FIX] website[_sale]: add company to domain of snippet filters
Steps to reproduce:

  - Install website_sale module
  - Create a new company X
  - Create a new product Y and set company to X
  - Create a website Z and ensure it's linked to a company but NOT X
  - Go to website Z homepage and edit it
  - Add a `Products` block then save
    (should be by default on filter `Newest`)
  - Select product Y in the block

Issue:

  The product should not be displayed and when clicking on it, we have
  an access right error.

Cause:

  Not taking into account the company of the website when preparing
  values to render in the snippet therefore the product is displayed
  while it should not.

Solution:

  Update `_prepare_values` to add the website company to the domain if
  the filter's model has a company_id field.
  Same issue occure with latest_sold filter (for ex.) so must
  apply same fix to `_get_products` for filters that use a server action.

opw-2956186

closes odoo/odoo#99181

X-original-commit: dab7fed0c396d3dd6e2e2ad8560c706d5c2e89fb
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-09-02 19:13:53 +02:00
..
…