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

I have add one field category in my test module. Now I want to print report(quatation/order) and i have display product category wise print. Suppose 1.Services,2.Delivery Report will print in 10 products in services and 5 products in Delivery just like summurrywise

 
                     ITEM        |    Total
                     Services    |      10
                     Delivery    |       5
                     Total       |      15
Is this possible ?

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

You have to create your own report which will print reports Category wise.

I mean in report 1st table will be for Category A with its Products and 2nd table for Category B with its Products.

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

I have edit quatation/order default in sale. I have add field category in my new addons.

You mean you want to create one more table that contains Category Name and Total Number of Products in that category? Am I right?

Tác giả

I have add one field categ_type in sale.order.line Now we print only this categ_type its contain no of product suppose Delivery 10 products. how I print this group_by. I hope you got it.

Tác giả Câu trả lời hay nhất

Solve my issue for in create one method retrive data from postgrey and set in to rml that return dict.

def get_val(self, obj):
        query = """
           SELECT  categ_type as name, sum(product_uom_qty * price_unit) as total
           FROM sale_order_line 
           WHERE order_id = %s GROUP BY categ_type
        """%(obj.id)
        self.cr.execute(query)
        data = self.cr.dictfetchall()
        for t in data:
           dict={'name' : t['name'], 'total' : t['total']}
           res.append(dict)
        return res 

repeatIn[o.get_val(o), 'p']

[[ p['name'] ]] [[ p['total'] ]]

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

Which script have you changed especially the place where you created this function.

Tác giả

In my custom module.Thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 25
8974
0
thg 2 20
1
4
thg 7 18
17463
2
thg 1 16
8405
0
thg 10 24
3400