40 lines
1.7 KiB
Diff
40 lines
1.7 KiB
Diff
diff -r 875ff56c92cb inventory.py
|
|
--- a/trytond/trytond/modules/stock/inventory.py Mon Oct 03 12:19:14 2016 +0200
|
|
+++ b/trytond/trytond/modules/stock/inventory.py Mon Oct 03 13:06:18 2016 +0200
|
|
@@ -208,16 +208,13 @@
|
|
|
|
# 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.active and
|
|
- line.product.type == 'goods'
|
|
- and not line.product.consumable):
|
|
+ line.product.type == 'goods'):
|
|
Line.delete([line])
|
|
continue
|
|
key = (inventory.location.id,) + line.unique_key
|
|
@@ -232,8 +229,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
|
|
@@ -253,7 +249,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'),
|