Skip to Content
Menu
This question has been flagged
2 Replies
2315 Views

Dear Community,

i'd like to change Description line in pdf invoice - i'd like to show product SCU instead of description.

here what i have in report_invoice_document:
<div class="row mt32 mb32"> <div class="col-xs-2" t-if="o.name"> <strong>Description:</strong> <p t-field=" <div class="row mt32 mb32"> <div class="col-xs-2" t-if="o.name"> <strong>Description:</strong> <p t-field="o.name"/> </div>"/> </div>

when i'm trying to change o.name to o.product_id - i'm getting 503 server error.

probably i missed something, pls advice how to do it?

Avatar
Discard
Author Best Answer

Thanks Mitul, but unfortunately it's not working. Here is corrects answer, which i get on stackexchange forum:

>>>

You are trying to change o.name that refers to the name of the invoice record with o.product_idthat it's not a field of the account.invoice model, it's a field of the account.invoice.line model that it's backed by the field invoice_line_ids on the account.invoice model.

You will need to use it for example to change the line:

<td><span t-field="l.name"/></td>

With:

<td><span t-field="l.product_id.name"/></td>

>>>

Avatar
Discard

I should start to answer question here again. You should provide the link to my answer on stackoverflow:

https://stackoverflow.com/questions/52835167/odoo10-how-to-change-line-in-pdf-invoice/52838321#52838321

Best Answer

Hello,

 try with below code

 <div class="row mt32 mb32">
     <div class="col-xs-2" t-if="o.name">
      <strong>Description:</strong>
          <p t-field="o.product_id.your_field_name"/>
     </div>
</div>
Avatar
Discard
Related Posts Replies Views Activity
0
Dec 24
34
1
Jun 24
671
2
Oct 17
4650
0
Oct 24
232
11
Oct 24
20527