changeset 46452f07c02c in tryton:5.0
details: https://hg.tryton.org/tryton?cmd=changeset;node=46452f07c02c
description:
Skip destroyed records when fetching data from the server
issue9669
review294631002
(grafted from 07a24f922b0c916392a6f7d28c579e74e5a94e0b)
diffstat:
tryton/gui/window/view_form/model/group.py | 1 +
tryton/gui/window/view_form/model/record.py | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diffs (34 lines):
diff -r f7a28aca4840 -r 46452f07c02c tryton/gui/window/view_form/model/group.py
--- a/tryton/gui/window/view_form/model/group.py Wed Oct 28 23:56:28
2020 +0100
+++ b/tryton/gui/window/view_form/model/group.py Fri Oct 30 19:01:11
2020 +0100
@@ -183,6 +183,7 @@
ctx['_timestamp'] = {}
for rec in records:
ctx['_timestamp'].update(rec.get_timestamp())
+ rec.destroy()
record_ids = set(r.id for r in records)
reload_ids = set(root_group.on_write_ids(list(record_ids)))
reload_ids -= record_ids
diff -r f7a28aca4840 -r 46452f07c02c tryton/gui/window/view_form/model/record.py
--- a/tryton/gui/window/view_form/model/record.py Wed Oct 28 23:56:28
2020 +0100
+++ b/tryton/gui/window/view_form/model/record.py Fri Oct 30 19:01:11
2020 +0100
@@ -38,7 +38,7 @@
self.destroyed = False
def __getitem__(self, name):
- if name not in self._loaded and self.id >= 0:
+ if not self.destroyed and self.id >= 0 and name not in self._loaded:
id2record = {
self.id: self,
}
@@ -80,7 +80,9 @@
limit = int(CONFIG['client.limit'] / len(fnames))
def filter_group(record):
- return name not in record._loaded and record.id >= 0
+ return (not record.destroyed
+ and record.id >= 0
+ and name not in record._loaded)
def filter_parent_group(record):
return (filter_group(record)