changeset 4b90e7d2441d in trytond:5.8
details: https://hg.tryton.org/trytond?cmd=changeset&node=4b90e7d2441d
description:
        Do not set _timestamp on fake singleton instance

        It is not really useful because the id of the future record can not be 
guessed
        for sure by the client.
        Also when write is called with such fake _timestamp as singleton create 
the
        record before actually write, the timestamp check always fails (if the 
id was
        correctly guessed).

        issue10282
        (grafted from cea2a39c6e31f3aa2405cf40d39951c52e1f9be5)
diffstat:

 trytond/model/modelsingleton.py |  1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diffs (11 lines):

diff -r df6f32706bee -r 4b90e7d2441d trytond/model/modelsingleton.py
--- a/trytond/model/modelsingleton.py   Mon Apr 12 20:15:13 2021 +0200
+++ b/trytond/model/modelsingleton.py   Wed Apr 14 00:39:56 2021 +0200
@@ -48,7 +48,6 @@
             res['id'] = ids[0]
             res['_write'] = True
             res['_delete'] = True
-            res['_timestamp'] = '0'
             return [res]
         res = super(ModelSingleton, cls).read([singleton.id], fields_names)
         res[0]['id'] = ids[0]

Reply via email to