From cab8bf29a2b6e57308f036f59c7bcdac9519b980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 19 Mar 2022 15:02:35 +0100 Subject: [PATCH] Do not use negative product id when there are none for quantities by warehouse Otherwise this creates rows with negative id which are not valid for stored record. issue11289 review390181002 (grafted from d084cfdc49ff0ec37c3e99bc57e6d706586defb1) --HG-- branch : 6.0 --- product.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product.py b/product.py index 37af5acddb..fc64bd592a 100644 --- a/product.py +++ b/product.py @@ -554,9 +554,9 @@ class ProductQuantitiesByWarehouse(ModelSQL, ModelView): product_column = Concat('product.template,', product.template) products = [('product.template', i) for i in product_template] else: - product = context.get('product', -1) + product = context.get('product') if product is None: - product = -1 + product = [] if isinstance(product, int): product = [product] product_clause = move.product.in_(product or [-1])