diff --git a/product.py b/product.py index 89e8afc7ef..1e0da00f9e 100644 --- a/product.py +++ b/product.py @@ -1,12 +1,15 @@ #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 ModelView, ModelSQL, fields +from trytond.pyson import Eval class Product(ModelSQL, ModelView): _name = 'product.product' locations = fields.One2Many('stock.product.location', 'product', - 'Default Locations') + 'Default Locations', states={ + 'invisible': ~Eval('type').in_(['goods', 'assets']), + }) Product() diff --git a/product.xml b/product.xml index c5a5400ceb..61307c8a0e 100644 --- a/product.xml +++ b/product.xml @@ -11,9 +11,10 @@ this repository contains the full copyright notices and license terms. --> - - - + + + ]]>