ir.sequence are getting incremented without saving the data

Asked by Bushair

Hi,
I have made the field Other ID in the Human Resources ->Employee -> New Employee -> Other ID field as ir.sequence type for making the Other ID to automatically generate when i create a new Employee.

But i could observe an issue with this sequence.

Whenever i create the New Employee this filed is getting incremented.Even if i dont save the Data for an employee this field is getting incremented...

Say for example , when i press the New Button ,this fled is coming as 1001 and i just cancel this employee without saving this data and again if press the New Employee button ,this field is coming 1002 which is wrong ,since i havent saved the previous datas.

why is to so ?

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
OpenBMS JSC (openbmsjsc) said :
#1

Basically you need to create your sequence in write method, not in create method

Check this http://www.openerp.com/forum/topic13661.html for more detailed explanation and example code

Can you help with this problem?

Provide an answer of your own, or ask Bushair for more information if necessary.

To post a message you must log in.