From 61398407963e482a738f08e290322a9f18c416d0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 15 Jan 2018 13:58:20 +0100 Subject: [PATCH] [FIX] product_expiry: date on lot - Create a product tracked by lot with some date values != 0 - Create a MO for this product, click on 'Produce' - Create a new lot. The various dates are not registered on the lot. The product ID is located in the context in this case, not in the values. opw-803790 --- addons/product_expiry/models/production_lot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_expiry/models/production_lot.py b/addons/product_expiry/models/production_lot.py index 6be9a2865dd..45e465ea146 100644 --- a/addons/product_expiry/models/production_lot.py +++ b/addons/product_expiry/models/production_lot.py @@ -44,7 +44,7 @@ class StockProductionLot(models.Model): # Assign dates according to products data @api.model def create(self, vals): - dates = self._get_dates(vals.get('product_id')) + dates = self._get_dates(vals.get('product_id') or self.env.context.get('default_product_id')) for d in dates: if not vals.get(d): vals[d] = dates[d]