Odoo Help

Welcome!

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

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 479 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)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 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

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

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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