39 lines
1.6 KiB
Diff
39 lines
1.6 KiB
Diff
diff -r 1f0bea0fc5ee trytond/trytond/modules/stock/inventory.py
|
|
--- a/trytond/trytond/modules/stock/inventory.py Tue Mar 06 17:12:54 2018 +0100
|
|
+++ b/trytond/trytond/modules/stock/inventory.py Tue Mar 06 17:26:18 2018 +0100
|
|
@@ -218,15 +218,12 @@
|
|
|
|
# Index some data
|
|
product2type = {}
|
|
- product2consumable = {}
|
|
for product in Product.browse([line[1] for line in pbl]):
|
|
product2type[product.id] = product.type
|
|
- product2consumable[product.id] = product.consumable
|
|
|
|
# Update existing lines
|
|
for line in inventory.lines:
|
|
- if not (line.product.type == 'goods'
|
|
- and not line.product.consumable):
|
|
+ if not line.product.type == 'goods':
|
|
Line.delete([line])
|
|
continue
|
|
|
|
@@ -244,8 +241,7 @@
|
|
# Create lines if needed
|
|
for key, quantity in pbl.iteritems():
|
|
product_id = key[grouping.index('product') + 1]
|
|
- if (product2type[product_id] != 'goods'
|
|
- or product2consumable[product_id]):
|
|
+ if product2type[product_id] != 'goods':
|
|
continue
|
|
if not quantity:
|
|
continue
|
|
@@ -265,7 +261,6 @@
|
|
product = fields.Many2One('product.product', 'Product', required=True,
|
|
domain=[
|
|
('type', '=', 'goods'),
|
|
- ('consumable', '=', False),
|
|
])
|
|
uom = fields.Function(fields.Many2One('product.uom', 'UOM'), 'get_uom')
|
|
unit_digits = fields.Function(fields.Integer('Unit Digits'),
|