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.

1

What is the correct syntax for an "if" request ?

By
Anne-Sylvie Burri
on 6/11/13, 6:49 AM 1,047 views

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

3

Sandeep

--Sandeep--
6083
| 6 5 8
Delhi, India
--Sandeep--
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
Sandeep
On 6/11/13, 7:03 AM

Hey

try this

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

Thanks

It works perfectly! Thanks :)

J.-M. Burri - Bureau ing.-conseils informatique, Anne-Sylvie Burri
on 6/11/13, 7:17 AM
0
Juanjo Algaz
On 6/11/13, 7:25 AM

Maybe:

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

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

0 follower(s)

Stats

Asked: 6/11/13, 6:49 AM
Seen: 1047 times
Last updated: 3/16/15, 8:10 AM