mirror of
https://github.com/NaN-tic/trytond-product_oneclick_training.git
synced 2023-12-14 03:23:05 +01:00
Remove safe eval
This commit is contained in:
parent
5292bb7d77
commit
1d1cc4a9c7
|
@ -3,7 +3,7 @@
|
||||||
# the full copyright notices and license terms.
|
# the full copyright notices and license terms.
|
||||||
from trytond.model import fields
|
from trytond.model import fields
|
||||||
from trytond.pool import PoolMeta
|
from trytond.pool import PoolMeta
|
||||||
from trytond.pyson import Eval, Bool
|
from trytond.pyson import Eval, Not, Bool
|
||||||
from trytond.model.fields import depends
|
from trytond.model.fields import depends
|
||||||
|
|
||||||
__all__ = ['ProductOneClickView', 'ProductOneClick']
|
__all__ = ['ProductOneClickView', 'ProductOneClick']
|
||||||
|
@ -42,6 +42,13 @@ class ProductOneClickView:
|
||||||
res['training_registration'] = self.training_start_date
|
res['training_registration'] = self.training_start_date
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def view_attributes(cls):
|
||||||
|
return super(ProductOneClickView, cls).view_attributes() + [
|
||||||
|
('//page[@id="esale"]', 'states', {
|
||||||
|
'invisible': Not(Bool(Eval('training'))),
|
||||||
|
})]
|
||||||
|
|
||||||
|
|
||||||
class ProductOneClick:
|
class ProductOneClick:
|
||||||
__name__ = 'product.oneclick'
|
__name__ = 'product.oneclick'
|
||||||
|
|
|
@ -8,9 +8,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
||||||
<field name="training"/>
|
<field name="training"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="/form/notebook/page[@id='sale']" position="after">
|
<xpath expr="/form/notebook/page[@id='sale']" position="after">
|
||||||
<page string="Training"
|
<page string="Training" id="training">
|
||||||
states="{'invisible': Not(Bool(Eval('training')))}"
|
|
||||||
id="training">
|
|
||||||
<label name="training_start_date"/>
|
<label name="training_start_date"/>
|
||||||
<field name="training_start_date"/>
|
<field name="training_start_date"/>
|
||||||
<label name="training_end_date"/>
|
<label name="training_end_date"/>
|
||||||
|
|
Loading…
Reference in a new issue