From 380990687dc0e35b2e199fa253678db4d5ae326e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 9 Mar 2015 19:41:54 +0100 Subject: [PATCH] Remove safe_eval We convert all the fields that were storing python code into PYSON. We add a pyson attribute on field tag to store PYSON value. issue4416 review6971002 --- product.py | 7 +++++++ view/template_form.xml | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/product.py b/product.py index 658574a172..535b3a57e9 100644 --- a/product.py +++ b/product.py @@ -109,3 +109,10 @@ class Template: @staticmethod def default_weight_digits(): return 2 + + @classmethod + def view_attributes(cls): + return super(Template, cls).view_attributes() + [ + ('//page[@id="measurements"]', 'states', { + 'invisible': Eval('type').in_(NON_MEASURABLE), + })] diff --git a/view/template_form.xml b/view/template_form.xml index 3eb333f650..ce01d7c8f2 100644 --- a/view/template_form.xml +++ b/view/template_form.xml @@ -3,8 +3,7 @@ this repository contains the full copyright notices and license terms. --> - +