changeset c21565dd7c70 in trytond:5.4
details: https://hg.tryton.org/trytond?cmd=changeset;node=c21565dd7c70
description:
Do not write metadata on ir.note when writing on only the unread field
issue9245
review305371002
(grafted from b95af4a8509edc75b731dffb97e36c8ed62dd382)
diffstat:
trytond/ir/note.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (19 lines):
diff -r a7b3f8754c82 -r c21565dd7c70 trytond/ir/note.py
--- a/trytond/ir/note.py Sun Apr 19 16:37:51 2020 +0200
+++ b/trytond/ir/note.py Tue Apr 21 14:06:10 2020 +0200
@@ -100,11 +100,13 @@
@classmethod
def write(cls, notes, values, *args):
# Avoid changing write meta data if only unread is set
- if args or values.keys() != ['unread']:
+ if args or set(values.keys()) != {'unread'}:
super(Note, cls).write(notes, values, *args)
else:
# Check access write and clean cache
- ModelStorage.write(notes, values)
+ # Use __func__ to directly access ModelStorage's write method and
+ # pass it the right class
+ ModelStorage.write.__func__(cls, notes, values)
cls.set_unread(notes, 'unread', values['unread'])