コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2516 ビュー

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
5860
2
6月 25
1992
4
5月 24
6071
1
5月 23
3858
1
12月 21
4062