This question has been flagged
1 Reply
5836 Views

Hi,

I have to create sequence number as FY/2019/001(it will increment as FY/2019/002 etc, till 31 march 2020),and I have to increment the year in next financial year

that is in next April 1 the  number should be FY/2020/001.

How could I do this??

Please help


Thanks in advance.

Avatar
Discard
Best Answer

Hello @VENI V R,

Yes, this is possible.

Please follow the below stpes,

First Activate the developers mode, Goto Setting-->Technical-->Sequences&identifiers-->Sequence. 

Create the new sequence as per your object,

For better understanding verify the below screenshot,


Screenshot-2 


Regards,




Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

Avatar
Discard
Author

Can I us this method other than invoice?Because I need to use it in contracts

Hello @veni,

Hello Yes you can use this in contract as well,

As per my knowledge you need to change the required field of name.

First you need to add one field in your .py and .xml file in (hr.contract) object

i.e : sequence_contact = fields.Char(string='Number', copy=False, default=lambda self: self.env['ir.sequence'].next_by_code('hr.contract'))

once you add field files you need to add this code in .xml file.

<record id="sequence_hr_contract" model="ir.sequence">

<field name="name">Contract Sequence</field>

<field name="code">hr.contract</field>

<field name="prefix">FY/%(range_year)s/</field>

<field eval="1" name="number_next"/>

<field eval="1" name="number_increment"/>

<field eval="True" name="use_date_range"/>

<field eval="False" name="company_id"/>

<field name="padding">3</field>

</record>