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

How to set thousand separator in POS module?

By
Hengky Zhang
on 10/7/14, 11:07 PM 1,665 views

i did set the thousand separator in Language Setting and it is work,

but this thousand separator in POS module is not working

please help me regarding this issue,

thank you.

1
Hengky Zhang
On 10/8/14, 6:02 AM

i solved it, instead of using instance.web.insert_thousand_seps( amount ); we should use amount = instance.web.format_value(amount, {type : "float"}) put that function before the first if so it solved thank you anyway thank you very much to share with me

0
Victor Godoy
On 12/30/14, 11:55 AM

I just install odoo v8.0 but in settings I don't have Language settings....... So I have to add the following code in the widget_base.js :

amount = parseInt( amount ).toLocaleString();

probably, you need to activate Technical Features on user form.

Yogesh
on 12/30/14, 3:03 PM
thanks! I need to check that.

On Tue, Dec 30, 2014 at 5:03 PM, Yogesh <yogeshkushwaha4-gmail-com@mail.odoo.com> wrote:

probably, you need to activate Technical Features on user form.

--
Yogesh
Sent by Odoo S.A. using Odoo about Forum Post False

Victor Godoy
on 12/30/14, 4:28 PM
0

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 10/8/14, 5:39 AM

Unfortunately this is not implemented within the point of sale module.

The format_value method exists in the web\static\src\js\formats.js file, that's the one used to format values in the web client.

Searching through the POS source yields no results for usage of that method, or the usage of the other method insert_thousand_seps

You will have to extend or modify the POS module to achieve the desired result.

The solution: use instance.web.format_value

can you give me some example

Hengky Zhang
on 10/8/14, 6:02 AM

actually i did see the function in the format.js but i still confusing how to call this function to the point_of_sale module in base_widget.js

Hengky Zhang
on 10/8/14, 6:07 AM

Use this method instance.web.insert_thousand_seps it takes the number and returns the formatted number as a string.

IBS
on 10/8/14, 6:49 AM

i call that method but it is error i cannot open my POS session it is blank screen hard to solve because i cannot debug it

Hengky Zhang
on 10/8/14, 10:10 PM

Where did you call it, file/line.

IBS
on 10/9/14, 4:50 AM

i call it in the pos module in wiwdget_base file in format_currency method

Hengky Zhang
on 10/9/14, 7:38 AM

In the middle of that method, right after the first IF, put the following code: amount = instance.web.insert_thousand_seps( amount );

IBS
on 10/9/14, 10:01 AM

thank you it is working but the problem now is the value became 70.000..0 with double dot in decimal and it is dot instead of comma coz i put the decimal symbol is comma not dot any idea?

Hengky Zhang
on 10/9/14, 11:28 PM

i solved it, instead of using instance.web.insert_thousand_seps( amount ); we should use amount = instance.web.format_value(amount, {type : "float"}) put that function before the first if so it solved thank you anyway thank you very much to share with me

Hengky Zhang
on 10/10/14, 1:36 AM

sorry friend i want to but i dont have enough karma

Hengky Zhang
on 10/10/14, 5:19 AM

lol nee 1 more karma need 20 but mine 19

Hengky Zhang
on 10/10/14, 5:33 AM

done thank you

Hengky Zhang
on 10/10/14, 5:50 AM

You're welcome :-)

IBS
on 10/10/14, 5:52 AM

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

1 follower(s)

Stats

Asked: 10/7/14, 11:07 PM
Seen: 1665 times
Last updated: 3/16/15, 8:10 AM