Files
odoo_source/addons/loyalty/models
Thomas Lefebvre (thle) 0728b447a6 [FIX] loyalty: default product for reward in multi company
Steps to reproduce:
-------------------
- being in a multi-company environment;
- have one product made that is first in alphabetical
    order of "Internal Reference" throughout the database (e.g. [AAA]);
- make this product specific to one of the companies
    (set the "Company" field on the product template)
- go into a different company within the database
    (not the one set on this product);
- create a new discount & loyalty record, and set
    the "Program Type" to "Discount Code".

Issue:
------
An access rights error occurs.

Cause:
------
When creating a `promo_code` program, we use the first product
that can be sold in the default reward values.

Solution:
---------
Take into account the company in the domain that retrieves
the default product.

opw-3538516

closes odoo/odoo#139008

X-original-commit: d80c28c78bf3237e2526a6370f9c6c0b0f8dc232
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-18 13:39:15 +00:00
..