コンテンツへスキップ
メニュー
この質問にフラグが付けられました
6 返信
10774 ビュー

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

アバター
破棄
最善の回答

- 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.

アバター
破棄
著作者

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

最善の回答

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.

アバター
破棄
最善の回答

Hi thanhthuansteel

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



アバター
破棄
著作者 最善の回答

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

アバター
破棄