Add issue6179, which prevents Tryton client to notify as changed, records which

have not.
This commit is contained in:
Albert Cervera i Areny 2017-08-08 03:21:59 +02:00
parent 48a69524b6
commit a1ad570da8
2 changed files with 56 additions and 0 deletions

54
issue6179.diff Normal file
View File

@ -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):

2
series
View File

@ -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)