From fee59e2b2bd955f390953b280c0ed1a0780ab17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 18 Mar 2015 11:13:29 +0100 Subject: [PATCH] Clear record timestamp after save Since changeset 28a09c279d67, the timestamp is sent also on button calls but if the record is saved just before this generate an concurrency exception. Indeed the _timestamp must be cleared just after the save (because the record is not reloaded before the button call). issue4644 review8021002 --- tryton/gui/window/view_form/model/record.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/model/record.py b/tryton/gui/window/view_form/model/record.py index 024f177546..3beed43c58 100644 --- a/tryton/gui/window/view_form/model/record.py +++ b/tryton/gui/window/view_form/model/record.py @@ -270,6 +270,7 @@ class Record(SignalEvent): def cancel(self): self._loaded.clear() self.modified_fields.clear() + self._timestamp = None def get_timestamp(self): result = {self.model_name + ',' + str(self.id): self._timestamp} @@ -311,8 +312,7 @@ class Record(SignalEvent): [self.id], value, context=context) except RPCException: return False - self._loaded.clear() - self.modified_fields = {} + self.cancel() if force_reload: self.reload() if self.group: