diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index 59809cf7226..e7ba523e50a 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -751,7 +751,7 @@ class ProductTemplate(models.Model): if (self.env.user.user_has_groups(','.join(advanced_option_groups))): return self.action_open_quants() else: - default_product_id = len(self.product_variant_ids) == 1 and self.product_variant_id.id + default_product_id = self.env.context.get('default_product_id', len(self.product_variant_ids) == 1 and self.product_variant_id.id) action = self.env["ir.actions.actions"]._for_xml_id("stock.action_change_product_quantity") action['context'] = dict( self.env.context,