Printing any field on an OpenERP report on a conditional basis, you can add a simple line in your report
[[(object.field == 'Some Value') and 'value1' or 'value2']] is equivalent to
if object.field:
print value1
else:
print value2
Suppose I want to print Cash Memo if cash_credit (the mode of payment for the invoice) is Cash and print Credit Memo if cash_credit is Credit, then I write this statement in my Openerp report as:
[[ (o.cash_credit == 'Cash') and 'Cash Memo' or 'Credit Memo' ]]
and convert to fields.
0 Comment(s)