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 check if client is selected in pos-ticket?

By
Pascal Tremblay
on 10/8/15, 7:27 PM 853 views

Hello all,

In the file pos.xml, I'm able to display the customer name on the receipt. But if no customer is selected for the order, I get this error :

Error: QWeb2 - template['PosTicket']: Runtime Error: TypeError: dict.order.changed.client is null

How to write a condition to check if client.name is null or not? My condition doesn't work...

<h5>

    <t t-if="order.changed.client.name is not null">

            | Client : <t t-esc="order.changed.client.name || 'Client anonyme'"/> |

        </t>

</h5>

Do you  know how to fix it please?



3

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 10/9/15, 1:45 AM

Hi,

You may try like this:

<h5>
| Client : <t t-esc="order.changed.client ? order.changed.client.name : 'Client anyone'"/>|
</h5>

Exactly what I needed! BIG THANKS in INDIA!!!

Pascal Tremblay
on 10/9/15, 7:30 AM

(-- I have removed a « ; » at the end of your answer --)

Pascal Tremblay
on 10/9/15, 7:33 AM

Exactly what I needed! But, i have other cuestion about this.. I have customers grouped by companies, and also want the company appear... This is possible?

| Client : |
| Company : Name of Company |
arkamex
on 10/27/15, 10:11 AM
0
arkamex
On 10/27/15, 9:42 AM

this is a Perfect :3


But, i have other cuestion about this..


I have customers grouped by companies, and also want the company appear...


This is possible? 



<h5>

| Client : <t t-esc="order.changed.client ? order.changed.client.name : 'Client anyone'"/>| 

<br>

| Company :|

</h5>

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: 10/8/15, 7:27 PM
Seen: 853 times
Last updated: 10/27/15, 9:42 AM