Issue 7187

Title
PYSON Equal on two date return false even if they are the same
Priority
bug
Status
resolved
Nosy list
ced, pkunk, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2018-03-02.15:56:23 by pkunk, last changed 31 months ago by roundup-bot.

Files

File name Uploaded Type Details
MomentCompare.png pkunk, 2018-03-02.15:56:22 image/png view

Messages

New changeset 211196bcf50a by Cédric Krier in branch '4.6':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/211196bcf50a

New changeset 89aff8483a3b by Cédric Krier in branch '4.4':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/89aff8483a3b

New changeset a6ca60d8f1c5 by Cédric Krier in branch '4.2':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/a6ca60d8f1c5

New changeset 000bfac28b9a by Cédric Krier in branch '4.0':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/000bfac28b9a

New changeset 1f2b0c3fc5a1 by Cédric Krier in branch '3.8':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/1f2b0c3fc5a1
New changeset e89436671633 by Cédric Krier in branch 'default':
Use valueOf to compare moment in PYSON Equal
http://hg.tryton.org/sao/rev/e89436671633

New changeset 50dfd84cc780 by Cédric Krier in branch 'default':
Add tests for PYSON Equal between moment
http://hg.tryton.org/sao/rev/50dfd84cc780
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-04-01.19:29:37
I fixed the Date vs DateTime comparison and completed the tests.
Now for me, it is ready for testing.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-04-01.19:27:52
Indeed there is no test in tryton for pyson, they are in trytond. But Python has much better equality behavior than javascript so I think it does not need to be tested.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2018-03-05.17:03:23
The same test should be added to tryton for consistency.
Author: [hidden] (pkunk)
Date: 2018-03-02.15:56:22
When you submit an eval on two date, Equal.eval_ compare two Moment object.
But if you do 
m = Moment('2017-01-01')
m2 = Moment('2017-01-01')
m == m2 // return false !!

So for example, if you ant to hide a date field if it's equal to another datefield it does not work in sao.

Patch incomming.
History
Date User Action Args
2018-04-20 19:15:52roundup-botsetmessages: + msg40299
2018-04-09 10:46:41roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg39903
2018-04-01 19:32:01reviewbotsetmessages: + msg39641
2018-04-01 19:29:37cedsetstatus: in-progress -> testing
assignedto: pkunk -> ced
messages: + msg39640
2018-04-01 19:27:53cedsetmessages: + msg39639
component: - tryton
2018-03-06 10:42:29reviewbotsetmessages: + msg38815
2018-03-05 17:03:23cedsetstatus: chatting -> in-progress
type: behavior
component: + tryton
messages: + msg38806
nosy: + ced
2018-03-05 16:55:20reviewbotsetmessages: + msg38805
2018-03-02 17:16:43reviewbotsetstatus: resolved -> chatting
nosy: + reviewbot
messages: + msg38764
2018-03-02 16:51:47pkunksetreviews: https://codereview.tryton.org/44081002 -> 44081002

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