Use producible field

issue4590
review29091002
This commit is contained in:
Cédric Krier committed 2017-01-13 20:20:48 +01:00
1 parent e7216edf75
commit dc29f0f618
2 files changed
+11 -2

No files matched your search

+1 -1
View File
@@ -80,7 +80,7 @@ class Production:
products = Product.search([
('type', '=', 'goods'),
('consumable', '=', False),
('purchasable', '=', False),
('producible', '=', True),
])
# compute requests
today = Date.today()
+10 -1
View File
@@ -1,6 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pyson import Eval
from trytond.pyson import Eval, If
from trytond.pool import PoolMeta
__all__ = ['OrderPoint']
@@ -14,6 +14,15 @@ class OrderPoint:
def __setup__(cls):
super(OrderPoint, cls).__setup__()
cls.product.domain = [
cls.product.domain,
If(Eval('type') == 'production',
('producible', '=', True),
()),
]
if 'type' not in cls.product.depends:
cls.product.depends.append('type')
cls.warehouse_location.states['invisible'] &= (
Eval('type') != 'production')
cls.warehouse_location.states['required'] |= (