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

My company is providing the steel roof, that type of product not only has the quantity but also come with the size include length and amount of piece. normally, the sales order has many order lines for the same product. I would like to connect all the product that come with same product_id in to a row as picture below. Could you guy please help me redesign the quoation sale order qweb report and invoice qweb report. Thank for your attention.

http://i.imgur.com/87nHfRc.png

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

- You need to sort the sale order lines by product id, then count the line of each product id (by python code)

google "python sort list of tuples"

a = [(1, "ahbe"), (2,"sss"), (1, "ddjj")]
a.sort(key=lambda tup: tup[0])
a
>>>  [(1, 'ahbe'), (1, 'ddjj'), (2, 'sss')]

google "python count element in list of tuples"

from collections import Counter
Counter(tup[0] for tup in a)
>>> Counter({1: 2, 2: 1})

- then edit/create the xml file, the first time of each product id, add 1 cell with rowspan.

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

Thank Giang, i get your idea, but because the lack of IT knowleadge, could you give me a favor, show me each specific steps to do, thank for your time.

please skype me @fanha99

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

Hi you can use rowspan like:
<td  t-att-rowspan="3"><span t-esc="-----"></span></td>
OR for some field value use like:
<td  t-att-rowspan="field_value"><span t-esc="-----"></span></td>

Hope it will help.

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

Hi thanhthuansteel

For that you could use bootstrap layout css clasess for tables or divs



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

Thank you, so i do need to rebuild the report again totally?

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