From a1ad570da840ce20dc62fc912b2cb940c7c442c2 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny Date: Tue, 8 Aug 2017 03:21:59 +0200 Subject: [PATCH] Add issue6179, which prevents Tryton client to notify as changed, records which have not. --- issue6179.diff | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ series | 2 ++ 2 files changed, 56 insertions(+) create mode 100644 issue6179.diff diff --git a/issue6179.diff b/issue6179.diff new file mode 100644 index 0000000..7f795a9 --- /dev/null +++ b/issue6179.diff @@ -0,0 +1,54 @@ +diff -r f9060749bd74 -r ff79de98d2b1 tryton/gui/window/view_form/view/form_gtk/calendar.py +--- a/tryton/tryton/gui/window/view_form/view/form_gtk/calendar.py Sun Jan 15 19:04:16 2017 +0100 ++++ b/tryton/tryton/gui/window/view_form/view/form_gtk/calendar.py Fri Jan 27 19:47:20 2017 +0100 +@@ -1,5 +1,7 @@ + # This file is part of Tryton. The COPYRIGHT file at the top level of + # this repository contains the full copyright notices and license terms. ++import datetime ++ + import gtk + import gettext + +@@ -45,10 +47,17 @@ + else: + self.widget.unset_focus_chain() + ++ @classmethod ++ def cast(cls, value): ++ if isinstance(value, datetime.datetime): ++ value = value.date() ++ return value ++ + @property + def modified(self): + if self.record and self.field: +- return self.field.get_client(self.record) != self.entry.props.value ++ field_value = self.cast(self.field.get_client(self.record)) ++ return field_value != self.entry.props.value + return False + + def sig_key_press(self, widget, event): +@@ -86,6 +95,12 @@ + def _set_editable(self, value): + self.entry.set_sensitive(value) + ++ @classmethod ++ def cast(cls, value): ++ if isinstance(value, datetime.datetime): ++ value = value.time() ++ return value ++ + @property + def real_entry(self): + return self.entry.get_child() +@@ -128,6 +143,10 @@ + child.connect('focus-out-event', lambda x, y: self._focus_out()) + self.widget.pack_start(self.entry, expand=False, fill=False) + ++ @classmethod ++ def cast(cls, value): ++ return value ++ + def _set_editable(self, value): + for child in self.entry.get_children(): + if isinstance(child, gtk.Entry): diff --git a/series b/series index d25651c..113daad 100644 --- a/series +++ b/series @@ -50,6 +50,8 @@ sepa_sequence_type.diff add_account_in_move_line_payable_receivable.diff locale.diff +issue6179.diff + issue6294.diff # [tryton] - Creating a board view with a form inside issue5917.diff # [tryton] - Reduce the number of request for tree_state (changeset 33c1a31d27bc) issue5877.diff # [trytond] - Improve ModelStorage.search_count by using no order and COUNT(*) (changeset a2009809c10f)