تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3030 أدوات العرض

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?

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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>

>>>

الصورة الرمزية
إهمال

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

أفضل إجابة

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>
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 25
523
1
أغسطس 25
1334
1
يونيو 24
2222
2
أكتوبر 17
5658
0
يناير 25
950