Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
6 Відповіді
10781 Переглядів

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?

Аватар
Відмінити