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

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

Awatar
Odrzuć
Autor

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

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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>

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Autor Najlepsza odpowiedź

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?

Awatar
Odrzuć

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.

Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
2
maj 23
4789
0
lut 21
3250
0
paź 15
4098
2
cze 25
761
1
kwi 25
1345