Tryton - Issues

 

Issue7187

Title PYSON Equal on two date return false even if they are the same
Priority bug Status resolved
Superseder Nosy List ced, pkunk, reviewbot, roundup-bot
Type behavior Components sao
Assigned To ced Keywords review
Reviews 44081002
View: 44081002

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

Files
File name Uploaded Type Edit Remove
MomentCompare.png pkunk, 2018-03-02.15:56:22 image/png
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
review44081002 updated at https://codereview.tryton.org/44081002/#ps80001
msg39640 (view) 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.
msg39639 (view) 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.
review44081002 updated at https://codereview.tryton.org/44081002/#ps40001
msg38806 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-03-05.17:03:23
The same test should be added to tryton for consistency.
review44081002 updated at https://codereview.tryton.org/44081002/#ps20001
review44081002 updated at https://codereview.tryton.org/44081002/#ps1
msg38762 (view) 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:53cedsetcomponent: - tryton
messages: + msg39639
2018-03-06 10:42:29reviewbotsetmessages: + msg38815
2018-03-05 17:03:23cedsetstatus: chatting -> in-progress
component: + tryton
type: behavior
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)