Issue 10060

Title
Ceil milliseconds of datetime
Priority
bug
Status
resolved
Nosy list
ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2021-02-04.00:32:30 by ced, last changed 5 days ago by roundup-bot.

Messages

New changeset 17dd421deec8 by Cédric Krier in branch '5.8':
Ceil microsecond
https://hg.tryton.org/sao/rev/17dd421deec8

New changeset b074653fb030 by Cédric Krier in branch '5.6':
Ceil microsecond
https://hg.tryton.org/sao/rev/b074653fb030

New changeset 688876084b37 by Cédric Krier in branch '5.0':
Ceil microsecond
https://hg.tryton.org/sao/rev/688876084b37
New changeset 900e68f69e54 by Cédric Krier in branch 'default':
Ceil microsecond
https://hg.tryton.org/tryton-env/rev/900e68f69e54
New changeset cb82c70d7090 by Cédric Krier in branch 'default':
Ceil microsecond
https://hg.tryton.org/sao/rev/cb82c70d7090
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-02-04.00:32:30

Momentjs support only milliseconds so the datetime microseconds are trunked. The problem is that when such datetime is used for reading history records like in the account_invoice_history module, the read value does not match the exact value because the clause <= select the record before because of the trunking.
It will be better to ceil so the result will always be a datetime before the right value. This is important when the datetime is exactly the create datetime because then it raises an error as no record is found.
Another solution would be that Sao.DateTime remember the exact millisecond to restitute it later but this will be hard to maintain with operations.

History
Date User Action Args
2021-05-07 00:03:46roundup-botsetkeyword: - backport
messages: + msg67437
2021-04-18 17:53:11roundup-botsetmessages: + msg66707
2021-04-18 17:53:08roundup-botsetmessages: + msg66706
nosy: + roundup-bot
status: testing -> resolved
2021-04-11 01:41:58reviewbotsetmessages: + msg66387
nosy: + reviewbot
2021-04-11 01:34:29cedsetkeyword: + backport, review
reviews: 340591002
status: in-progress -> testing
2021-04-11 00:49:23cedsetassignedto: ced
status: unread -> in-progress
2021-02-13 10:59:37cedsetassignedto: ced -> (no value)
2021-02-04 00:32:30cedcreate

Showing 10 items. Show all history (warning: this could be VERY long)