Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7634 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

   

Awatar
Odrzuć
Autor

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>

Powiązane posty Odpowiedzi Widoki Czynność
2
maj 24
8063
1
wrz 20
6544
2
kwi 18
6735
2
lip 24
2456
1
cze 24
4974