İçereği Atla
Menü
Bu soru işaretlendi
6 Cevaplar
10779 Görünümler

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

Avatar
Vazgeç
En İyi Yanı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.

Avatar
Vazgeç
Üretici

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

En İyi Yanı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.

Avatar
Vazgeç
En İyi Yanıt

Hi thanhthuansteel

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



Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç