Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4 Odpowiedzi
7911 Widoki

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?



Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

You may try like this:

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

Awatar
Odrzuć
Autor

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

Autor

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

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 |
Najlepsza odpowiedź

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>

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 24
2382
1
gru 24
1983
0
paź 24
1135
1
wrz 24
2007
0
sie 24
1608