From 75f5e45705c975b4ceb32f3fc3530cd9c1c2815b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jan 2010 11:01:52 +0100 Subject: [PATCH] Use PySON --- product.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/product.py b/product.py index 240f6e7851..3e2afb1d93 100644 --- a/product.py +++ b/product.py @@ -2,6 +2,7 @@ #this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard +from trytond.pyson import PYSONEncoder class ProductCostHistory(ModelSQL, ModelView): @@ -66,10 +67,14 @@ class OpenProductCostHistory(Wizard): res = act_window_obj.read(cursor, user, model_data.db_id, context=context) if not data['id'] or data['id'] < 0: - res['domain'] = str([('template', '=', False)]) + res['pyson_domain'] = PYSONEncoder().encode([ + ('template', '=', False), + ]) else: product = product_obj.browse(cursor, user, data['id'], context=context) - res['domain'] = str([('template', '=', product.template.id)]) + res['pyson_domain'] = PYSONEncoder().encode([ + ('template', '=', product.template.id), + ]) return res OpenProductCostHistory()