From ef696764e91e281601b2247f10d16d8d264e7bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Mar 2008 21:10:20 +0100 Subject: [PATCH] Add context of the parent in Many2One dialog --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 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 32439aeaf6..96b313c98e 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -19,10 +19,6 @@ class Dialog(object): context=None, window=None): if attrs is None: attrs = {} - if domain is None: - domain = [] - if context is None: - context = {} self.dia = gtk.Dialog(_('Tryton - Link'), window, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT) @@ -271,8 +267,9 @@ class Many2One(WidgetInterface): def sig_new(self, *args): self.focus_out = False domain = self._view.modelfield.domain_get(self._view.model) + context = self._view.modelfield.context_get(self._view.model) dia = Dialog(self.attrs['relation'], attrs=self.attrs, - window=self._window, domain=domain) + window=self._window, domain=domain, context=context) res, value = dia.run() if res: self._view.modelfield.set_client(self._view.model, value) @@ -286,9 +283,11 @@ class Many2One(WidgetInterface): self.focus_out = False if value: domain = self._view.modelfield.domain_get(self._view.model) + context = self._view.modelfield.context_get(self._view.model) dia = Dialog(self.attrs['relation'], self._view.modelfield.get(self._view.model), - attrs=self.attrs, window=self._window, domain=domain) + attrs=self.attrs, window=self._window, domain=domain, + context=context) res, value = dia.run() if res: self._view.modelfield.set_client(self._view.model, value,