changeset c8395b802540 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=c8395b802540
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 d800ffb2493a -r c8395b802540 trytond/ir/note.py
--- a/trytond/ir/note.py Sun Apr 19 09:59:48 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'])