Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
8 Risposte
5619 Visualizzazioni

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

Avatar
Abbandona
Autore

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

Risposta migliore

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.

Avatar
Abbandona
Risposta migliore

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>

Avatar
Abbandona
Risposta migliore

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


Avatar
Abbandona
Autore Risposta migliore

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?

Avatar
Abbandona

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.

Autore

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

Post correlati Risposte Visualizzazioni Attività
2
mag 23
4804
0
feb 21
3287
0
ott 15
4123
2
giu 25
799
1
apr 25
1410