Handle gracefully inventory completion
if a exsiting product has been set inactive or not stockable
This commit is contained in:
1 parent
47881f5613
commit
7a2f21f2b8
1 file changed
+4
@@ -170,6 +170,10 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView):
|
||||
|
||||
# Update existing lines
|
||||
for line in inventory.lines:
|
||||
if not (line.product.active and
|
||||
line.product.type == 'stockable'):
|
||||
line_obj.delete(cursor, user, line.id, context=context)
|
||||
continue
|
||||
quantity, uom_id = 0.0, product2uom[line.product.id]
|
||||
if line.product.id in product_qty:
|
||||
quantity, uom_id = product_qty.pop(line.product.id)
|
||||
|
||||
Reference in new issue
Block a user