Skip to Content
Menu
This question has been flagged
1 Reply
3788 Views

Hello Everyone,


I want to add category wise field in POS receipt.

For that, I taken one list for appending multiple category but it is not append.


So I want to know that, How to append multiple category value in list in POS template.


Here is code for that, which is implement by me. But it's not work.


Code :-

<t t-set="cat" t-value="[]"/>           
AAAA<div t-esc="cat"/>           
 <t t-foreach="orderlines" t-as="orderline">               
    CAT<t t-set="cat" t-esc="cat + [orderline.product.pos_categ_id[0]]"/>           
</t>               
CCCCCCCCCC<div t-esc="cat"/>

Thanks in advance.

Regards,
 

Avatar
Discard
Best Answer

For APPEND list, you nee to change "t-esc" with "t-value". like

UPDATED:

I have created a list and then append the product ids in it and its working well...

<t t-set="p_ids" t-value="[]"/>
<t t-foreach="doc.order_line" t-as="order_line">
    <t t-set="p_ids" t-value="p_ids+[order_line.product_id.id]"/>
</t>
<strong><div t-esc="p_ids"/></strong>

Hope this will help you...

Avatar
Discard
Author

Hello Jusab, It's not working. The output for this is like 156 but i want in [1,5,6]

Answer updated...

Author

Thanks for update but still facing same issue.

Well above answer is for append the data in list, If you not getting data then you must be doing something wrong...put you code, community will guide you....

Related Posts Replies Views Activity
0
May 24
274
2
Mar 24
298
2
Jun 24
2203
1
Sep 21
1080
0
Jul 24
155