Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
8 ตอบกลับ
5687 มุมมอง

I would like the invoices PDF reports not to display the default code of articles in the article's names.


On a PDF invoice :

Description

[REF TEST] Test

screenshot: https://ibb.co/VY1XZWd


As a comparison, on a sales quotation PDF reports, the default code of articles does not show :

Description

Test

screenshot: https://ibb.co/xGf2Tjt


I would like the same on invoices PDF reports


I'm using Odoo 11 Community Edition

อวตาร
ละทิ้ง
ผู้เขียน

I have updated my post with screenshots so it is easier to understand what I'm looking for

คำตอบที่ดีที่สุด

Simple :

find report_saleorder_document report into odoo reports menu.
find code of qweb report code <span t-field="line.name"/> replace it will <td><span t-field="line.product_id.name"/></td>

only report name will come.

This you can do from odoo front end also and create new module and inherit report_saleorder_document report into it and change code.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Change From:

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


Change To:

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

this is because product ref and name are in the same field in sale.order.line model, like : 


'product_id': [152, '[LCLN1131-03] Maxi traversable 15 x 60 cm']

as @Bhaviraj Brahmkshatriya said, edit the report template and use a regex to remove the brackets and its content


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks Bhaviraj !

So I tried what you said:

Under report_invoice_document, I changed the line:

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

See here: https://ibb.co/7bjn7r6

After reloading Odoo under a private window and printing a PDF invoice, here is the result: https://ibb.co/LxYTKjC

So I still have the default_code appearing inside [] brackets. I would like it to disappear. Any idea why it didn't work?

อวตาร
ละทิ้ง

It works fine as i checked, But make sure, report is not loading from attachment. as report configuration is there, which gives options that old reports which are printed load from there.

ผู้เขียน

When I click on Print invoice: https://ibb.co/PTYV3xb

When I click on invoice under attachement: https://ibb.co/G5PSCM8

It is the same, default_code inside [] brackets is still here.

Are you sure you checked for report_invoice_document ? Because in your first answer you were talking about report_salesorder_document

Related Posts ตอบกลับ มุมมอง กิจกรรม
Header missing on reports แก้ไขแล้ว
2
พ.ค. 23
4867
0
ก.พ. 21
3340
0
ต.ค. 15
4178
1
ส.ค. 25
335
2
มิ.ย. 25
863