From cdcfe1d52c3618dabc619d055faab9b243b7c576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Oct 2008 10:21:50 +0200 Subject: [PATCH] Add missing rpc.CONTEXT in m2o and o2m for issue446 --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 11 +++++++---- tryton/gui/window/view_form/view/form_gtk/one2many.py | 4 +++- 2 files changed, 10 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 f74d7c0457..19de40cab6 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -208,7 +208,7 @@ class Many2One(WidgetInterface): try: ids = rpc.execute('object', 'execute', self.attrs['relation'], 'name_search', '', [], - 'ilike', {}) + 'ilike', rpc.CONTEXT) except Exception, exception: common.process_exception(exception, self._window) ids = [] @@ -247,7 +247,8 @@ class Many2One(WidgetInterface): def on_completion_match(self, completion, model, iter): name = model[iter][1] domain = self._view.modelfield.domain_get(self._view.model) - context = self._view.modelfield.context_get(self._view.model) + context = rpc.CONTEXT.copy() + context.update(self._view.modelfield.context_get(self._view.model)) try: ids = rpc.execute('object', 'execute', self.attrs['relation'], 'name_search', name, domain, 'ilike', @@ -296,7 +297,8 @@ class Many2One(WidgetInterface): (self._view.modelfield.get_state_attrs( self._view.model)['required']) and key_press): domain = self._view.modelfield.domain_get(self._view.model) - context = self._view.modelfield.context_get(self._view.model) + context = rpc.CONTEXT.copy() + context.update(self._view.modelfield.context_get(self._view.model)) self.wid_text.grab_focus() try: @@ -376,7 +378,8 @@ class Many2One(WidgetInterface): else: if not self._readonly: domain = self._view.modelfield.domain_get(self._view.model) - context = self._view.modelfield.context_get(self._view.model) + context = rpc.CONTEXT.copy() + context.update(self._view.modelfield.context_get(self._view.model)) self.wid_text.grab_focus() try: diff --git a/tryton/gui/window/view_form/view/form_gtk/one2many.py b/tryton/gui/window/view_form/view/form_gtk/one2many.py index 4969c100da..d58814b80b 100644 --- a/tryton/gui/window/view_form/view/form_gtk/one2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py @@ -367,6 +367,7 @@ class Dialog(object): def _sig_add(self, *args): domain = [] + context = rpc.CONTEXT.copy() try: ids = rpc.execute('object', 'execute', self.attrs['relation'], @@ -585,7 +586,8 @@ class One2Many(WidgetInterface): def _sig_add(self, *args): self._view.view_form.set_value() domain = self._view.modelfield.domain_get(self._view.model) - context = self._view.modelfield.context_get(self._view.model) + context = rpc.CONTEXT.copy() + context.update(self._view.modelfield.context_get(self._view.model)) domain = domain[:] domain.extend(self._view.model.expr_eval(self.attrs.get('add_remove'), context))