This question has been flagged
2 Replies
6784 Views

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
Discard
Best Answer

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
Discard

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?

Best Answer

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
Discard

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