Skip to Content
Menu
This question has been flagged
2 Replies
5835 Views


Hello Community ,I'm facing a probleme ,i want to create an picking wich show the list of product sales grouped by gamme and product

i do this :

<tbody>
<t t-set="product" t-value="[]" />
<t t-foreach="o.move_lines" t-as="move">
<t t-set="product" t-value="product+[move.product_id.id]" />
</t>
<t t-set="product_gamme" t-value="[]" />
<t t-foreach="o.move_lines" t-as="move">
<t t-set="product_gamme" t-value="product_gamme+[move.product_id.product_gamme_id.id]"/>
</t>

<tr t-foreach="set(product)" t-as="prod" style="font-size: 11px;">
<t t-set="product_code" t-value="0" />
<t t-set="product_name" t-value="0" />
<t t-set="qty_gr" t-value="0" />
<t t-set="qty" t-value="0" />
<t t-set="total" t-value="0"/>


<t t-foreach="o.move_lines" t-as="move">
<t t-if="prod==move.product_id.id">
t t-set="product_code" t-value="move.product_id.code" />
<t t-set="product_name" t-value="move.product_id.name" />
<t t-if="move.gratuite">
<t t-set="qty_gr" t-value="qty_gr+round(move.product_uom_qty,2)" />
</t>
<t t-if="move.gratuite == False">
<t t-set="qty" t-value="qty+round(move.product_uom_qty,2)" />
</t>
<t t-set="total" t-value="qty_gr+qty" />


</t>
</t>

Avatar
Discard

1- How to create Qweb reports in OpenErp: https://goo.gl/tg2Zyp

2- How to create custom reports in Odoo (Qweb): https://goo.gl/KZEo8X

Hope this will helps..

Author Best Answer

i want to group by two fields how can i do it ? 

Avatar
Discard

you can use this code as model...

<t t-set="product_category" t-value="[]"/>

<t t-foreach="o.order_line" t-as="l">

<t t-set="product_category" t-value="product_category+[l.product_id.categ_id]"/>

</t>

<t t-foreach="set(product_category)" t-as="category">

<div><strong t-esc="category.name"/></div>

<t t-foreach="o.order_line" t-as="l">

<t t-if="category.id==l.product_id.categ_id.id">

<div><span t-field="l.product_id"/></div>

</t>

</t>

</t>

Best Answer

Hu, you can do as this answer

\https://www.odoo.com/it_IT/forum/help-1/question/how-to-group-by-product-category-in-qweb-report-102920

Avatar
Discard
Related Posts Replies Views Activity
4
Jan 23
10452
1
May 16
5723
4
Nov 24
5239
1
Mar 24
399
3
Sep 23
22666