diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-11-27 09:36:55 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-11-30 11:47:22 +0000 |
| commit | a6444faa7bf45b14c4ad63a033814ab0d20ba1da (patch) | |
| tree | ae765444e535f81c4802b62c6eafc0f919b4d608 /addons | |
| parent | 1ca34276e7684927d8628df9aa592fad7c1a5871 (diff) | |
[FIX] stock: multi-company and multi-routes on product
- Multi-warehouse + Multi-company setup
- Create Company A with warehouse and 1-step delivery
- Create Company B with warehouse and 1-step delivery
- Switch to Company A: Set Logistics route on product category
All/Saleable : 1-step delivery
- Switch to Company B: Set Logistics route on product category
All/Saleable : 1-step delivery
- Switch to Company A, make sure Company B is turned-off
- Create new product and set category to All/Saleable
- Save product
Multi-company error is coming.
This is due to the field `route_from_categ_ids` which is a related, and
therefore fetched as `sudo` by default:
https://github.com/odoo/odoo/blob/f0330d92b31bdae4637ae0c26f40ee07282ab449/odoo/fields.py#L368
Actually, the field doesn't seem to be useful since it is only used in a
view.
Fixes #58357
opw-2390983
closes odoo/odoo#62605
X-original-commit: b68b45d5105a4d797da12ee6a5df6162b52b2d61
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/stock/models/product.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 5d68eba4557..106ee95c577 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -602,7 +602,7 @@ class ProductTemplate(models.Model): # TDE FIXME: seems only visible in a view - remove me ? route_from_categ_ids = fields.Many2many( relation="stock.location.route", string="Category Routes", - related='categ_id.total_route_ids', readonly=False) + related='categ_id.total_route_ids', readonly=False, related_sudo=False) @api.depends('type') def _compute_has_available_route_ids(self): |
