From a0b8974ea45c4e65d8e67771103fdfef20774d15 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Tue, 13 Feb 2018 19:26:25 +0100 Subject: [PATCH] Do not delete inventory line of inactive product On the first run, inactive products with stock quantity are created, so we must not delete them on the second call. issue6931 review38931002 --- inventory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index 68c9455276..cee467fdbf 100644 --- a/inventory.py +++ b/inventory.py @@ -231,8 +231,7 @@ class Inventory(Workflow, ModelSQL, ModelView): # Update existing lines for line in inventory.lines: - if not (line.product.active and - line.product.type == 'goods' + if not (line.product.type == 'goods' and not line.product.consumable): Line.delete([line]) continue