Tryton - Issues

 

Issue8668

Title Sao View.Form.Float fails on values with rounding errors
Priority bug Status resolved
Superseder Nosy List ced, reviewbot, roundup-bot, rvong
Type behavior Components sao
Assigned To ced Keywords Firefox, review
Reviews 282251003
View: 282251003

Created on 2019-09-19.17:29:12 by rvong, last changed by roundup-bot.

Messages
New changeset 980aee98c8ac by Cédric Krier in branch '5.2':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/980aee98c8ac

New changeset 74c22c348ec4 by Cédric Krier in branch '5.0':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/74c22c348ec4

New changeset 4438055c8e17 by Cédric Krier in branch '4.8':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/4438055c8e17

New changeset 2a5fe0443521 by Cédric Krier in branch '4.6':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/2a5fe0443521

New changeset 04004848926e by Cédric Krier in branch '4.4':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/04004848926e
New changeset bc86e4c86a06 by Cédric Krier in branch 'default':
Always round numbers after factor operation
https://hg.tryton.org/tryton-env/rev/bc86e4c86a06
New changeset 55f0e73c3b8d by Cédric Krier in branch 'default':
Always round numbers after factor operation
https://hg.tryton.org/sao/rev/55f0e73c3b8d
review282251003 updated at https://codereview.tryton.org/282251003/#ps276161002
msg52448 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-10-12.19:06:50
It should be fixed with review282251003
msg51936 (view) Author: [hidden] (rvong) Date: 2019-09-19.17:29:12
In Sao branch 5.2, rev 90190d3ab0c3+ when you try to create a tax with a rate value that has potential round off error such as "12.87%", and save the record, then every time you load that tax record (by browsing through the records) the rate field is cleared blank and a the dialog message will popup asking if "you would like to save the record" as if the rate value was modified. This happens only in Sao, and no in Tryton client app. 

I am using Mozilla Firefox browser version 69.0 (64 bits) ubuntu linux. 

I looked into the Sao code and found that the problem comes from Sao.View.Form.Integer class at the function "get_value:" where there is a call to checkValidity() for the input. It appears that for the float value of 12.87 due to the round off error becomes 12.870000000000001 which fails the checkValidity() call, hence returns NaN.

If I bypass this check, the problem is fixed, but I believe this is not the ideal solution.
History
Date User Action Args
2019-10-31 00:00:47roundup-botsetmessages: + msg52818
keyword: - backport
2019-10-24 19:15:40cedsetstatus: testing -> resolved
2019-10-24 19:15:30cedsetstatus: resolved -> testing
keyword: + backport
2019-10-24 19:14:47roundup-botsetmessages: + msg52686
2019-10-24 19:14:42roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg52685
2019-10-12 19:08:08reviewbotsetnosy: + reviewbot
messages: + msg52449
2019-10-12 19:06:50cedsetstatus: unread -> testing
keyword: + review
nosy: + ced
messages: + msg52448
reviews: 282251003
assignedto: ced
2019-09-19 17:29:12rvongcreate

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