Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4182 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
4531
1
thg 3 15
4644
0
thg 8 23
1867
1
thg 12 19
3928
0
thg 2 18
4892