Remove states attribute of views and put it in py file
This commit is contained in:
parent
be24c4fdf8
commit
7ed42b47ba
10
analytic.py
10
analytic.py
|
@ -92,6 +92,16 @@ class Account:
|
|||
breeding_accounts[fname] = new_account
|
||||
return breeding_accounts
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
res = super(Account, cls).view_attributes()
|
||||
res += [
|
||||
('/form/notebook/page[@id="breeding_accounts"]', 'states', {
|
||||
'invisible': Not(Eval('is_breeding', False)),
|
||||
}),
|
||||
]
|
||||
return res
|
||||
|
||||
|
||||
class StockMove:
|
||||
__name__ = 'stock.move'
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
<field name="is_breeding"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@id='general']" position="after">
|
||||
<page id="breeding_accounts" string="Breeding"
|
||||
states="{'invisible': Not(Eval('is_breeding', False))}">
|
||||
<page id="breeding_accounts" string="Breeding">
|
||||
<label name="animals_account"/>
|
||||
<field name="animals_account"/>
|
||||
<label name="feed_account"/>
|
||||
|
|
Loading…
Reference in New Issue