Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2880 Vistas

I have a problem in checking multiple conditions in my openoffice report for openerp in my report i need to check conditions and prints the results.

my condition is.

[[ (l.invoice_line_tax_id.name[0] =='5 %' )and formatLang(l.price_unit /1.05) or (l.invoice_line_tax_id.name[0] == '14.5 %') and formatLang(l.price_unit/1.44) or formatLang(l.price_unit) ]]

in this first check tax name == '5 %' then print l.price_unit/1.05 then evaluate the or condition if tax name == '14.5 %' prints the value of l.price_unit/1.44, else print l.price_unit.

But there is a problem in my report it works fine when tax name == '5 %' and print its corresponding value, then it evaluate the false condition by printing the else value (l.price_unit) , It does n't evaluate the or condition (or (l.invoice_line_tax_id.name[0] == '14.5 %') and formatLang(l.price_unit/1.44)) .Any one please help me to find the solutions.

Avatar
Descartar
Mejor respuesta

Hello

Why will OR condition would work if your 1st condition already statisfied?

(l.invoice_line_tax_id.name[0] =='5 %' )and formatLang(l.price_unit /1.05) is true then or condition wont work.

in case (l.invoice_line_tax_id.name[0] =='5 %' )and formatLang(l.price_unit /1.05)=False

your OR (l.invoice_line_tax_id.name[0] == '14.5 %') and formatLang(l.price_unit/1.44) will work

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
oct 24
1127
0
ago 24
1001
0
ene 24
1548
1
nov 23
1211
0
jun 23
1600