İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2488 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ağu 17
5831
2
Haz 25
1950
4
May 24
6053
1
May 23
3845
1
Ara 21
4037