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

Hello all,

I am trying to create a customer invoice report from Odoo Studio. After generating the report, the product image is not visible in the pdf. 
In the odoo studio, I cannot view the invoice lines option from which I can select the image option.

Please help me with this. If anyone has worked with odoo 17 studio, guide me on how to create customer invoice reports with images.

Thank you.

아바타
취소
베스트 답변

Hi,

In Odoo 17, there isn't a native option to include an image field and display images in reports like other fields. However, you can manually add an image using the 'Edit Sources' feature and customize the code with:

xml

<span t-field="line.product_id.image_128" t-options-widget="image" t-options-width="64px"/>

For more detailed instructions, you can refer to the documentation:

https://www.odoo.com/documentation/17.0/applications/productivity/studio/pdf_reports.html#editing-the-report-s-xml" target="_blank">Odoo 17 Documentation - Editing the Report's XML


Hope its helps


아바타
취소
베스트 답변

Hi,

According to the documentation this should work, however I get an error.

I try to achieve something simular, but then in de picking list report. Below the code I've tried

<tr t-foreach="o.move_line_ids_without_package.sorted(lambda ml: ml.product_id.display_name)" t-as="ml">
​<td>
​<span t-field="line.product_id.image_128" t-options-widget="image" t-options-width="64px"/>
​<span t-field="ml.product_id.display_name">Customizable Desk</span><br/>
​<span t-if="ml.product_id.description_picking" t-field="ml.product_id.description_picking">Description on transfer</span>
​</td>


And the error in return:

RPC_ERROR
Arbitrary Uncaught Python Exception
400
Bad Request
                                Session expired (invalid CSRF token)
The above server error caused the following client error:
RPC_ERROR: Arbitrary Uncaught Python Exception
    RPC_ERROR
        at makeErrorFromResponse (link) 
        at decoder.onload (link)


What am I doing wrong?

PS. Instead of line.product_id.image.. I have also tried ml.product_id.image..

Thanks!


아바타
취소