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.

0

Strange behaviour when entering quantity. If i put 1000, it becomes 1. What could this be?

By
Luis Leiva
on 10/30/13, 11:59 AM 820 views

I am in Deliver Products; I want to send a product to a customer but it is not a sell, so I want to make the delivery order directly. (OpenERP v7)

When I enter the product quantity I find this strange behaviour: If I enter from 1 to 999 everything works well. If I enter 1000 to 900,000 it will, as soon as I press enter or tab, convert it and leave the amount divided by 1000. I.e. if I enter 1000 it will put 1, if I enter 3400 it will leave 3... etc. But if I enter 1000000, it will leave 1000000.

Any ideas on what is happening?? Is this a bug?

Thanks.


Update: Seems to be relate to this: on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos) But don't know how this works.


Update #2: Whent to stock.py and put a message in def onchange_quantity() printing the result of result['product_uos_qty'] = product_qty and when I enter 1000 in the user box I can see that result is correct, but then the quantity changes to 1. I also see that the Unit of Sale quantity does give the correct amount: 1000.

Anyone?


I found that onchange_quantity and onchange_pos_quantity are called both twice when quantities are 1000 to 900thousands, and then the shown quantity is incorrect. If not, both functions are called just once and the shown quanity is correct. That's it, I don't know what else to do.

Hey I think your problem is the decimal point. Try out to switch points and commas!

Florian Möller
on 10/30/13, 12:20 PM

I have tried without any decimal punctuation... just 1000000 and have the same result.

Luis Leiva
on 10/30/13, 12:30 PM

I have a may version, I am going to update to latest to see if it is a solved bug.

Luis Leiva
on 10/30/13, 12:46 PM

Well, I updated a test database to latest but still have the same behaviour, this tells me it is probably a misconfiguration or something I don't how it works. Any ideas??

Luis Leiva
on 10/30/13, 1:25 PM
0
Luis Leiva
On 10/30/13, 9:27 PM

Ok, I solved it. I don't know why it happens, I think it must be a bug. It, in fact, was decimal point related, as Florian suggested.

If you use unit of meausure with 0 decimal points you get this problem. I did it because I don't want any decimals in my quantities. So I just used 2 decimals again and worked it around.

Seems a bug to me. If someone can test it and knows how to use Launchpad it would be good.

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

0 follower(s)

Stats

Asked: 10/30/13, 11:59 AM
Seen: 820 times
Last updated: 3/16/15, 8:10 AM