Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3020 Widoki

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?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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>

>>>

Awatar
Odrzuć

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

Najlepsza odpowiedź

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>
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 25
469
1
sie 25
1319
1
cze 24
2212
2
paź 17
5632
0
sty 25
938