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

I have successfully used the code below to hide the internal reference on a printed sales quote/order, but it does not work on a printed invoice, even though the xml structure of both views is essentially the same (unless I'm missing something). Thoughts? Odoo v11 CE

Note: if I change the "l.name" code to "l.product_id.name" directly in the report_invoice_layouted QWeb view in the Settings interface, I get the desired response (i.e. product name without the int reference).

<odoo>
    <data>
<template id="report_invoice_product_code" inherit_id="sale.report_invoice_layouted">
<xpath expr="//span[@t-field='l.name']" position="replace">
<span t-field="l.product_id.name"/>
</xpath>
</template>
</data>
</odoo>

아바타
취소

how to do the same in Odoo v18.2? 
Want to remove For quote/SO/delivery/invoice

베스트 답변

I have used this piece of Code  to hide the reference in the brackets [] in the qweb report layout:

<td>

     <span t-esc="l.name[l.name.find('] ')+2:]"/>
 </td>

아바타
취소

Hi Alex,

Thanks for your help!

I have a checkbox in my sales orders/quotation that if checked should show internal references and if unchecked should not show internal references.

How do I edit my qweb report to reflect this condition?

This is most elegant and simple trick I see for a very long time! Absolutely fantastic!

베스트 답변

for future users, 

and thanks to @Alex Lyngsoe, 

go to  settings->technical->actions->reports

search for quotation/order report and click the Qweb views action button

go to the report_saleorder_document view and search for the <td name="td_name"></td> line

edit the line to this <td name="td_name"><span t-esc="line.name[line.name.find('] ')+2:]"/></td>

this should fully hide your internal reference for sales orders/quotations

아바타
취소

This has been really helpful. Thank you so much for sharing!!

관련 게시물 답글 화면 활동
0
5월 21
3050
2
1월 20
3768
1
6월 19
4578
3
8월 22
11882
5
4월 20
10052