Skip to content
Snippets Groups Projects
Commit d6bd78e5 authored by Nicolás Mac Rouillon's avatar Nicolás Mac Rouillon
Browse files

[FIX] stock: Add missing field in cxt depends on stock calculation.


This "depends context" was missing fields and the compute of the stock qty's were not correct in several cases.
We add the same as the fields "force_company".

closes odoo/odoo#68046

Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
parent e66448d5
Branches
Tags
No related merge requests found
......@@ -95,7 +95,7 @@ class Product(models.Model):
@api.depends('stock_move_ids.product_qty', 'stock_move_ids.state')
@api.depends_context(
'lot_id', 'owner_id', 'package_id', 'from_date', 'to_date',
'company_owned', 'force_company', 'location', 'warehouse'
'company_owned', 'force_company', 'location', 'warehouse',
)
def _compute_quantities(self):
products = self.filtered(lambda p: p.type != 'service')
......@@ -622,7 +622,7 @@ class ProductTemplate(models.Model):
'product_variant_ids.stock_move_ids.product_qty',
'product_variant_ids.stock_move_ids.state',
)
@api.depends_context('company_owned', 'force_company')
@api.depends_context('company_owned', 'force_company', 'location', 'warehouse')
def _compute_quantities(self):
res = self._compute_quantities_dict()
for template in self:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment