Add invisible states on locations
issue2629
This commit is contained in:
1 parent
fc061d942a
commit
787e09a8de
2 files changed
+8
-4
No files matched your search
+4
-1
@@ -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
@@ -11,9 +11,10 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id="general"]"
|
||||
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>
|
||||
]]>
|
||||
|
||||
Reference in new issue
Block a user