I want to print the product_id and the name in my invoice if one differs from each other, if not only the product_id should be printed.
I added these two lines in my report, but it is not working :-( ....
<td t-if="l.name != l.product_id"><span t-field="l.product_id"/><br></br><div style="font-size:smaller; text-indent:10px"><span t-field="l.name"/></div></td>
<td t-if="l.name == l.product_id"><span t-field="l.product_id"/></td>
The Log files warns me: "Comparing apples and oranges" - but I don't know what that means!
Thanks for the advice - the condition is working now. But unfortunately it's not what I want. Like Ray mentioned not with products with description and not with products with different variants/attributes. How can I include this in my condition?
My intention is: if the user manually fills in or overwrites the text in field "description", both fields (name and product_id) should be printed on the invoice. Maybe my approach is wrong?
Are you trying to handle the case where users remove the product information and overwrite instead of just appending? Perhaps you need an additional field for them, and not let them change description?
Yes, that is what I'm trying. I thought it was easier than adding a custom field, but that's apparently not the case. I will add a field. Thanks for the help Ray!