Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5326 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ

I try it and still dont work on V14 / V15

Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 20
5310
6
thg 7 22
39976
0
thg 6 20
2543
1
thg 5 20
9523
3
thg 1 20
8009