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]