[FIX] stock: add mising depends on computed field
The field had no triggers on the compute method. As the field is not stored, it works fine in most cases where the value is computed in a different transaction that the modification but when it is the case (e.g. OCA/connector-prestashop#101), the values were incorrect Add the correct triggers to recompute the value when needed closes odoo/odoo#30024 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
committed by
Martin Trigaux
parent
c89da3a683
commit
48e93a10a1
@@ -444,6 +444,10 @@ class ProductTemplate(models.Model):
|
||||
relation="stock.location.route", string="Category Routes",
|
||||
related='categ_id.total_route_ids')
|
||||
|
||||
@api.depends(
|
||||
'product_variant_ids',
|
||||
'product_variant_ids.stock_quant_ids',
|
||||
)
|
||||
def _compute_quantities(self):
|
||||
res = self._compute_quantities_dict()
|
||||
for template in self:
|
||||
|
||||
Reference in New Issue
Block a user