Odoo Help

0

How to appned category in list in POS template ? (Category wise Print POS Receipt)

By
Jignesh Mehta
on 5/25/16, 2:40 AM 799 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,
 

1
Jusab Sida (jsi)
On 5/25/16, 5:39 AM

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

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

Jignesh Mehta
on 5/25/16, 5:54 AM

Answer updated...

Jusab Sida (jsi)
on 5/25/16, 6:28 AM

Thanks for update but still facing same issue.

Jignesh Mehta
on 5/25/16, 8:42 AM

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

Jusab Sida (jsi)
on 5/26/16, 7:40 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/25/16, 2:40 AM
Seen: 799 times
Last updated: 5/25/16, 5:39 AM