Skip to Content
Menu
This question has been flagged
2 Replies
4097 Views

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
Discard
Best Answer

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
Discard

I try it and still dont work on V14 / V15

Best Answer

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
Discard
Related Posts Replies Views Activity
1
Nov 20
3901
6
Jul 22
37871
0
Jun 20
1630
1
May 20
8016
3
Jan 20
6977