Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4196 Переглядів

hello guys i want to ask, in sale.order we have sale.order.line with qty_delivered, after i deliver the product the rounding is right it's always going up, but when i return the stock picking later in my total qty_delivered sometimes the rounding is going up and sometimes is going down,

like example: 

in sale.order i have a quotation for 1 cardboard of a product, in that cardboard, i have 24 bottles, but the quantity picked only 16 bottles so it will 16/24 = 0.6666 -> it will be rounded 0.667 (this is the right rounding) but later if i do return for 2 bottles the rounding is wrong, 16-2/24 = 0.583333 -> it should rounded to 0.584 but it always 0.583.. 

but if the quantity picked is 17 (it means 17/24) then i do return 3 of them it will make 14/24 then the result is what i expected, it's 0.584, why rounding isnt consistent?

please help me why it happened and how to make it consistent to always round "UP", thanks for the answer

Аватар
Відмінити
Найкраща відповідь

I don't have access to code at this moment but I'd assume the rounding up is done per delivery line, not in total.

16/24 = 0.667

2/24 = 0.084

So (16-2)/24 = 0.667 - 0.084 = 0.583

Whereas 

17/24 = 0.709

3 / 24 = 0.125

So (17-3)/24 = 0.709 - 0.125 = 0.584

Аватар
Відмінити
Автор

well, i guess you're right.. but how can i make it rounding for the total? i see the flow but it confusing me, since on stock.picking the calculation of qty_delivered when we click button validate (call button_validate method) when i track it I can't get the total of delivered value, im kind new of odoo

Related Posts Відповіді Переглядів Дія
2
трав. 24
4551
1
бер. 15
4665
0
серп. 23
1896
1
груд. 19
3932
0
лют. 18
4898