Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3018 Weergaven

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
Annuleer
Auteur Beste antwoord

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
Annuleer

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

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
jul. 25
465
1
aug. 25
1317
1
jun. 24
2210
2
okt. 17
5631
0
jan. 25
926