Remove safe eval
This commit is contained in:
parent
faed5874b2
commit
bd602ee910
|
@ -3,7 +3,7 @@
|
|||
# the full copyright notices and license terms.
|
||||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.pyson import Eval, Not, Bool
|
||||
from trytond.modules.product_esale.tools import slugify
|
||||
|
||||
__all__ = ['ProductOneClickView', 'ProductOneClick']
|
||||
|
@ -86,6 +86,13 @@ class ProductOneClickView:
|
|||
name = slugify(name)
|
||||
return name
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(ProductOneClickView, cls).view_attributes() + [
|
||||
('//page[@id="esale"]', 'states', {
|
||||
'invisible': Not(Bool(Eval('esale_available'))),
|
||||
})]
|
||||
|
||||
|
||||
class ProductOneClick:
|
||||
__name__ = 'product.oneclick'
|
||||
|
|
|
@ -8,9 +8,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
|||
<field name="esale_available"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@id='sale']" position="after">
|
||||
<page string="eSale"
|
||||
states="{'invisible': Not(Bool(Eval('esale_available')))}"
|
||||
id="esale">
|
||||
<page string="eSale" id="esale">
|
||||
<notebook colspan="6">
|
||||
<page string="General" id="esale-general">
|
||||
<label name="esale_active"/>
|
||||
|
|
Loading…
Reference in New Issue