From 2cd0da0d578a7b0a504db7786373ad8157041fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 26 Jan 2014 14:30:12 +0100 Subject: [PATCH] Don't set default value for on_change and set id issue3487 review2501002 --- tryton/common/selection.py | 4 +++- tryton/gui/window/view_form/model/record.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tryton/common/selection.py b/tryton/common/selection.py index e7b79472bf..63811380e8 100644 --- a/tryton/common/selection.py +++ b/tryton/common/selection.py @@ -45,7 +45,9 @@ class SelectionMixin(object): if 'relation' not in self.attrs: change_with = self.attrs.get('selection_change_with') or [] - key = record._get_on_change_args(change_with).items() + args = record._get_on_change_args(change_with) + del args['id'] + key = args.items() key.sort() self.init_selection(tuple(key)) else: diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 312d0219d8..4c5012b7b0 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -516,10 +516,11 @@ class Record(SignalEvent): scope = values for i in arg.split('.'): if i not in scope: - scope = None break scope = scope[i] - res[arg] = scope + else: + res[arg] = scope + res['id'] = self.id return res def on_change(self, fieldname, attr):