Add invisible states on locations

issue2629
This commit is contained in:
Cédric Krier committed 2012-05-29 18:12:23 +02:00
1 parent fc061d942a
commit 787e09a8de
2 files changed
+8 -4

No files matched your search

+4 -1
View File
@@ -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()
+4 -3
View File
@@ -11,9 +11,10 @@ this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/notebook/page[@id=&quot;general&quot;]"
position="after">
<page string="Default Locations" id="default_locations">
<field name="locations" colspan="4"/>
</page>
<page string="Default Locations" id="default_locations"
states="{'invisible': ~Eval('type').in_(['goods', 'assets'])}">
<field name="locations" colspan="4"/>
</page>
</xpath>
</data>
]]>