Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
5310 Vistas

The default Invoice name that is printing on the PDF is of the format:

INV/2020/1208 for example. I'm trying to get rid of the 2020, I'm looking to just achieve INV/1208 as the heading. 


The code for this section in the Odoo account.report_invoice_document is as follows:

<h2>

                        <span t-if="o.type == 'out_invoice' and o.state == 'posted'">Invoice</span>

                        <span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>

                        <span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>

                        <span t-if="o.type == 'out_refund'">Credit Note</span>

                        <span t-if="o.type == 'in_refund'">Vendor Credit Note</span>

                        <span t-if="o.type == 'in_invoice'">Vendor Bill</span>

                        <span t-if="o.name != '/'" t-field="o.name"/>

</h2>


What is the best and efficient solution to achieve this?

Thank you for your time.

Avatar
Descartar
Mejor respuesta

Hi U.K.:

The Invoice number/name format is controlled by the Sequences setting. You can change the format by doing the following:

Go to Settings > General Settings, scroll all the way down and click on Activate the developer mode 

Go to Settings > Technical > Sequences & Identifiers > Sequences and search for INV Sequence 

Edit the sequence for your company and make the following changes:

  1. Change the value in the Prefix field to INV/  by removing %(range_year)s/ . This will remove the 2020/ part of the Invoice number.

  2. Uncheck the Use subsequences per date_range checkbox so that the system generates continuous numbers across years (since year is no longer a part of the Invoice number). If you skip this step, you will end up with duplicate Invoice numbers every year.

Here's a sample screenshot of the Sequences form before making the changes


Here's a sample screenshot after making the changes


Avatar
Descartar

I try it and still dont work on V14 / V15

Mejor respuesta

For that you can use this field "Save as Attachment Prefix" from Report menu.

See here: 

Put Prefix value as : 'Quotation_Order - '+time.strftime('%Y-%m-%d')

After setting this you will find your changes here:


Hope this will help you...


Regards

MUHAMMAD IMRAN
Technical and Functional Consultant  (ODOO)


Softtar Technologies Pvt. Ltd. Contact : Pakistan (+92)-3037701373
 
Address:
  
Allhafeez Shopping Mall
Lahore
Pakistan  (Branch Office)
http://sofftar.com
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
nov 20
5299
6
jul 22
39959
0
jun 20
2524
1
may 20
9497
3
ene 20
8007