Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
9239 Ansichten

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>

Avatar
Verwerfen

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

Beste Antwort

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>

Avatar
Verwerfen

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!

Beste Antwort

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

Avatar
Verwerfen

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

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Mai 21
2815
2
Jan. 20
3666
1
Juni 19
4327
3
Aug. 22
11654
5
Apr. 20
9907