Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

When using "." as thousands separator, and without decimals purchase order line understands it as decimal

By
Daniel Blanco
on 1/7/15, 8:50 AM 1,336 views

I have configured an instance to use no decimals, and use "." as thousand separator. This is used this way un CLP (chilean pesos).

In this situation, when creating a purchase order, the price of the item in the purchase order line, (for example 134.990) removes 990 and try to use 135 as the price. So purchase order line price is being misinterpreted as decimal.

To avoid this, I had to remove the thousands separator and use simply 134990.

Is there a shortcut to solve this?

Thanks

 

I have configured an instance......... more info about this, how and where?

zbik
on 1/7/15, 9:06 AM

Where: Entering a new purchase order, then add a product to that purchase order with value like the one I specified. How: selarator defined as [3,0]. Thousands sep: "." Decimal sep "," (comma). also, the decimal precision is defined as "0". Because in CLP, decimals are not used.

Daniel Blanco
on 1/7/15, 9:12 AM

I cannot comment in your later post, but that was what I 've done to put thousands separator to run. for "Bole", The problem is, that the price is already defined in the product, so when you pass the focus over it, the price is rounded the bad way. If you put the price by hand without punctuation as you says, everything goes ok, but that approach is not a solution for the day to day user.

Daniel Blanco
on 1/7/15, 10:27 AM

As I can see there is no workaround in the use. Could you guys please refer a hint or guideline, so I could think to develop a module in order to fix this? Thanks!

Daniel Blanco
on 1/7/15, 10:33 AM

well.. if the price is already defined on product.. there lies the rpoblem... obviously, someone imported a lot of products with prices entered with point ( in your case it should be thousand separator, but during import it was importd as decimal point).. only solution i see now is to reimport products, or write a smart sql to update all prices directly... (my guess will be that no product had a price of 1.000.000 - or two separators - otherwise it would thorw error during import)

Bole
on 1/7/15, 11:17 AM

Bole, this is not the case. The products had been created by hand, with the cost price correctly entered. If you query the table you can see the price is OK. Then, later, the format in the language was set to [3,0], so there is some onchange process that is misinterpreting the "." presented in the purchase line form, as decimal.

Daniel Blanco
on 1/7/15, 12:00 PM
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 1/7/15, 9:30 AM

You check "Technical Features" on user Administrator view, in "Access Rights". Next you edit Languages from menu Translations. In the definition of the language set sparators as you need.

0

Is a Bug.

Change this file:

addons/web/static/js/formats.js

Find this line in function instance.web.parse_value:

  case 'float':          
tmp = Number(value);
if (!isNaN(tmp))
return tmp;

and change for this (Coment whit //)

 case 'float':          
//tmp = Number(value);
//if (!isNaN(tmp))
//return tmp;

is working for us

0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 1/7/15, 9:26 AM

Thousand separator is for display pourposes only.. when you enter number, just enter it as is without any thousand separators and it should be ok...

leave the formatting to odoo, and make sure you enter full number 

hope it helps,
may the source be with you ;)(

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 1/7/15, 8:50 AM
Seen: 1336 times
Last updated: 3/29/15, 12:25 PM