Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0 ]BAD BUG!!! wrong decimal separator in automatic return entry (german numbers) #9395

Closed
thomasklosinsky opened this issue Nov 3, 2015 · 11 comments
Assignees

Comments

@thomasklosinsky
Copy link

in german numbers we have it like this:
9.9999,99

in english it would be like this
99999.99

In Odoo POS usually we use german decimal separators which is a "," (comma) and not a "." (dot).

In any recent update the dot is automatically added to our EC-Card Journal as decimal separator and not the comma as usual.

Means:

POS Cart has 58,99 - we hit EC-Card payment, automatically there is 58.99 in the payment form which means 5899,00 and Odoo takes the difference (5840,01) as cash return...

Manually changing the dot to a comma is working but not the solution...

If somebody is not really taking care this means a lot of trouble...
BAD BUG!

@thomasklosinsky thomasklosinsky changed the title BAD BUG!!! wrong decimal separator in automatic return entry (german numbers) [8.0 ]BAD BUG!!! wrong decimal separator in automatic return entry (german numbers) Nov 4, 2015
@beledouxdenis beledouxdenis removed their assignment Nov 19, 2015
@thomasklosinsky
Copy link
Author

?? @beledouxdenis did you have the chance to look at this problem?

@msmarino
Copy link

This is also affecting SPANISH (odoo_9.0.201511232). Looks like the on-screen keyboard is not using the locale settings?

@thomasklosinsky
Copy link
Author

@msmarino have you been able to fix it in your installation?

@msmarino
Copy link

Truly, I haven't tried. I don't program in python...

El mié., 16 dic. 2015 17:13, Thomas [email protected] escribió:

@msmarino https://github.com/msmarino have you been able to fix it in
your installation?


Reply to this email directly or view it on GitHub
#9395 (comment).

@COLABORATI
Copy link

does this potentially business-destroying bug still exist or did you just abandon?
I am interested in learning about how quick such kind of mission critical bugs are fixed by odoo devs.

@msmarino
Copy link

I have done no further testing on this bug.

El mar., 12 ene. 2016 15:24, COLABORATI [email protected] escribió:

does this potentially business-destroying bug still exist or did you just
abandon?
I am interested in learning about how quick such kind of mission critical
bugs are fixed by odoo devs.


Reply to this email directly or view it on GitHub
#9395 (comment).

@liebana
Copy link

liebana commented Jan 28, 2016

Have a look here odoomrp/odoomrp-utils#57

@thomasklosinsky
Copy link
Author

doesn't work for this bug...

@liebana
Copy link

liebana commented Jan 28, 2016

No it's not... 😞

@thomasklosinsky
Copy link
Author

@liebana @msmarino @COLABORATI
The Fix works for german language!

jorenvo added a commit to odoo-dev/odoo that referenced this issue Mar 1, 2016
When we render the payment screen the current value of the current
paymentline is rendered to a string using
Paymentline.get_amount_str(). This conversion always rendered numbers
with a decimal separator of '.' because it just used
Number.toFixed(). This used to be fine but
5a10903 made the POS adhere to the set
decimal and thousands separator. Because of this, the POS now has to
parse the input with web.parse_value() which takes into account these
separators. When parse_value() parses a float it first deletes the
thousands separators and then replaces the decimal separator with '.'
before it gets cast to a Number.

In German (and other languages), the '.' is used as a thousands
separator which means that it will get deleted by parse_value() so
you'll end up with '12.34' being interpreted as '1234'. Because of this
it is important that we ensure that the default value that appears in
the input uses the correct separators.

The aforementioned issue only occurs when the user changes the default
value in the paymentline. Only then does a conversion take place from
String to Number. So just clicking on a payment method of type 'Bank'
and validating it would work fine, only when the payment amount was
updated would the issue occur.

Fixes odoo#9395
Closes odoo#10952

note: this should not be forward-ported to >8.0 because later versions
use the rewritten payment screen which is completely different from the
one in 8.0.
jorenvo added a commit that referenced this issue Mar 1, 2016
When we render the payment screen the current value of the current
paymentline is rendered to a string using
Paymentline.get_amount_str(). This conversion always rendered numbers
with a decimal separator of '.' because it just used
Number.toFixed(). This used to be fine but
5a10903 made the POS adhere to the set
decimal and thousands separator. Because of this, the POS now has to
parse the input with web.parse_value() which takes into account these
separators. When parse_value() parses a float it first deletes the
thousands separators and then replaces the decimal separator with '.'
before it gets cast to a Number.

In German (and other languages), the '.' is used as a thousands
separator which means that it will get deleted by parse_value() so
you'll end up with '12.34' being interpreted as '1234'. Because of this
it is important that we ensure that the default value that appears in
the input uses the correct separators.

The aforementioned issue only occurs when the user changes the default
value in the paymentline. Only then does a conversion take place from
String to Number. So just clicking on a payment method of type 'Bank'
and validating it would work fine, only when the payment amount was
updated would the issue occur.

Fixes #9395
Closes #10952

note: this should not be forward-ported to >8.0 because later versions
use the rewritten payment screen which is completely different from the
one in 8.0.
@jorenvo
Copy link
Contributor

jorenvo commented Mar 1, 2016

Thanks for your report, fixed in dda904c.

@jorenvo jorenvo closed this as completed Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants