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

I am creating report i need to calculate sum of all quantity in sale order line how to do that

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
[[ reduce(lambda x, obj: x+obj.qty , list , 0 ) ]] : Total qty of list (try "objects" as list)

source: https://doc.openerp.com/v6.1/developer/05_reports/

o.order_line would be for the list of sale order lines

product_uom_qty is the qty field in sale order lines so it would be

[[ reduce(lambda x, obj: x+obj.product_uom_qty, o.order_line, 0 ) ]]
Ảnh đại diện
Huỷ bỏ

Ohh !! Thanks its work perfectly..

plz be sure to mark it as correct answer ^^

Câu trả lời hay nhất

Hi,

In this case you have create function field in report py file and in that just calculate # of qty. And for field use that function in rml file.

Ảnh đại diện
Huỷ bỏ