From 6b111ddb98e28f2b1a3c5be991e6970737ef3544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 18 Nov 2009 09:31:39 +0100 Subject: [PATCH] Fix action and data passed to _exec_action for issue1306 The domain and context must be string like when reading ir.action The data must contain 'model', 'id' and 'ids' --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 4 ++-- tryton/gui/window/view_form/view/list.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index 5abd389d04..90abf39dc3 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -477,8 +477,8 @@ class Many2One(WidgetInterface): return False screen = Screen(self.attrs['relation'], self._window) screen.load([obj_id]) - act['domain'] = screen.current_model.expr_eval(act.get('domain', []), - check_load=False) + act['domain'] = str(screen.current_model.expr_eval(act.get('domain', []), + check_load=False)) act['context'] = str(screen.current_model.expr_eval( act.get('context', {}), check_load=False)) data['model'] = self.model_type diff --git a/tryton/gui/window/view_form/view/list.py b/tryton/gui/window/view_form/view/list.py index b25241361c..2a2fdb4e2b 100644 --- a/tryton/gui/window/view_form/view/list.py +++ b/tryton/gui/window/view_form/view/list.py @@ -446,10 +446,13 @@ class ViewList(ParserView): screen = Screen(self.screen.fields[path[1].name]['relation'], self.window) screen.load([value]) - act['domain'] = screen.current_model.expr_eval(act['domain'], - check_load=False) - act['context'] = str(screen.current_model.expr_eval(act['context'], + act['domain'] = str(screen.current_model.expr_eval(act.get('domain', []), + check_load=False)) + act['context'] = str(screen.current_model.expr_eval(act.get('context', {}), check_load=False)) + data['model'] = self.screen.name + data['id'] = value + data['ids'] = [value] return Action._exec_action(act, self.window, data, context) def click_and_action(self, atype, value, path):