İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
3727 Görünümler

Hi everybody,

I'm trying to add an "if" request in my invoice report but I can't find the correct syntax.

I have companies and contacts (who are not linked to a company). I have a number (x_nocompany) for each company and a personal number (ref) for each contact.

What I want to do is if the invoice is for a company then the company number appear else if the invoice is for a contact then the contact number appear.

Now my code is the following :

[[ (o.partner_id.ref=='') and (o.partner_id.x_nocompany) or (o.partner_id.ref) ]]

Someone could help me ?

Many thanks in advance.

JMB

Avatar
Vazgeç
En İyi Yanıt

Hey

try this

 [[ (o.partner_id.ref) or (o.partner_id.x_nocompany) or (o.partner_id.ref) ]]

Thanks

Avatar
Vazgeç
Üretici

It works perfectly! Thanks :)

En İyi Yanıt

Maybe:

[[ o.partner_id.x_nocompany or o.partner_id.ref ]]
Avatar
Vazgeç