Skip to Content
Menu
This question has been flagged
1 Reply
1357 Views

Hi all, 

first of all - I'm still newbie in Odoo so this is maybe explained wrong but I will try.

In inherited invoice_report xml document i have conditional field that needs to be shown - if column (field) in db is equal to another column. To be more precise - if invoice_origin is equal to name. 

This is it's code (using imgbb because code won't show in question):
https://ibb.co/BB2KZxx


For example in database this invoice_origin is [{'invoice_origin': 'S00151-2022'}]

On invoices that are created from more than one sales orders it is this [{'invoice_origin': 'S00123-2022, S00066-2022'}]

How can I strip this data to use in foreach separately the part [{'invoice_origin': 'S00123-2022'}] and separately [{'invoice_origin': 'S00066-2022'}]

Thank you.

Avatar
Discard
Author Best Answer

Ok, I got answer on stackoverflow - you can check it out here https://stackoverflow.com/questions/71528278/strip-string-from-a-field-with-defined-separator-in-invoice-report/71529787#71529787

Basically, splitting can be done like this 

t-value="o.invoice_origin and o.invoice_origin.split(', ') or []"

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 17
4800
4
May 24
4440
1
May 23
2205
1
Dec 21
2832
2
Sep 21
2611