Issue 10846

Record modify from domain inversion on date
Nosy list
ced, reviewbot, roundup-bot
Assigned to
backport, review

Created on 2021-10-11.13:25:52 by ced, last changed yesterday by roundup-bot.


New changeset 265ee72cc66f by Cédric Krier in branch 'default':
Run tests in UTC and use millisecond precision for moment comparison
New changeset a4689a7b33a2 by Cédric Krier in branch 'default':
Run tests in UTC and use millisecond precision for moment comparison
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-10-11.13:25:51

I have a domain (on a view so a PYSON domain) which force the value of a date field but the records are always changed when the domain inversion set the date value.
This is because of issue9577 which use UTC Date to evaluate PYSON statement. So the comparison of the value from PYSON is not the same as the value from the read call for JS.
Indeed issue9577 wrongly simulated the UTC timezone. Instead we must always run puppeteer in UTC to run the test so there are no difference between Date constructed by code and those relying on the browser Date.
Also the comparison strict tests fails for the DateTime because the JS precision is millisecond when PYSON uses microsecond.
And finally issue4879 uses unix to compare moment but this has a precision of seconds, it is better to use valueOf which according to moment documentation is the unix timestamp but in milliseconds.

Date User Action Args
2021-10-19 00:21:08roundup-botsetmessages: + msg71103
2021-10-19 00:21:04roundup-botsetmessages: + msg71102
nosy: + roundup-bot
status: testing -> resolved
2021-10-19 00:20:04cedsetkeyword: + backport
2021-10-11 13:29:47reviewbotsetmessages: + msg70861
nosy: + reviewbot
2021-10-11 13:27:13cedsetkeyword: + review
reviews: 389071002
status: in-progress -> testing
2021-10-11 13:25:52cedcreate

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