From 490d4df18d62fac482b987e37ac1e9b831d3dc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Feb 2014 22:57:15 +0100 Subject: [PATCH] Use same modified value as on_change for pre_validate The value sent for pre_validation will be used to instanciate a record in the same way as on_change. It is also better to get the id also for pre_validate. review3211002 --- tryton/gui/window/view_form/model/record.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 9aa583ed9f..75278eac9d 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -281,7 +281,9 @@ class Record(SignalEvent): return result def pre_validate(self): - values = self.get() + if not self.modified_fields: + return True + values = self._get_on_change_args(self.modified_fields) try: RPCExecute('model', self.model_name, 'pre_validate', values, main_iteration=False, context=self.context_get())