Files
tryton/product.py
T
resteve 7caaa3a66a Default locations depends on type
review975002
issue3289
(transplanted from 77b6eb28abfb3cabd168ae2cb3e6257ce7f50216)
2013-07-08 12:54:15 +02:00

18 lines
551 B
Python

#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.model import fields
from trytond.pyson import Eval
from trytond.pool import PoolMeta
__all__ = ['Product']
__metaclass__ = PoolMeta
class Product:
__name__ = 'product.product'
locations = fields.One2Many('stock.product.location', 'product',
'Default Locations', states={
'invisible': ~Eval('type').in_(['goods', 'assets']),
},
depends=['type'])