콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2487 화면

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
5831
2
6월 25
1950
4
5월 24
6053
1
5월 23
3845
1
12월 21
4037