Ir al contenido
Menú
Se marcó esta pregunta

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

Avatar
Descartar
Mejor respuesta

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

Avatar
Descartar
Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
2
may 24
4274
1
mar 15
4506
0
ago 23
1669
1
dic 19
3717
0
feb 18
4595