Odoo Help


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

Jignesh Mehta
on 5/25/16, 2:40 AM 567 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]]"/>           
CCCCCCCCCC<div t-esc="cat"/>

Thanks in advance.



Jusab Sida (jsi)

--Jusab Sida (jsi)--
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--

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

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


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]"/>
<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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.


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)


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