跳至內容
選單
此問題已被標幟
1 回覆
2360 瀏覽次數

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.

頭像
捨棄
作者 最佳答案

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 []"

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
8月 17
5711
2
6月 25
1503
4
5月 24
5727
1
5月 23
3597
1
12月 21
3906