ir.sequence
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
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.
This shouldnot autoincrement unless i save the previous data
Changed in openobject-server: | |
assignee: | nobody → OpenERP's Framework R&D (openerp-dev-framework) |
importance: | Undecided → Low |
status: | New → Confirmed |
Hello Bushair,
I'm not sure I understand your bug correctly, as there is no "ir.sequence" type for OpenERP fields, however the way OpenERP sequences is like this: the sequence will give you the next number as soon as you request it, in a atomic fashion.
That number is consumed and you cannot reverse that cleanly, because the next number might have been already consumed by someone else: the previous one cannot be reused without risking to have sequence numbers used out of order!
This is the reason why invoices do not ask for a sequence number until they are confirmed (invoices must be sequentially numbered in all cases, with no hole in the sequences). For other cases where it matters less (e.g. sale orders numbers), it's okay to consume sequences numbers even if the object is not saved in the end.
If this is not what you meant in your bug report, please reopen this bug and provide a more complete explanation of what you are trying to do: including detailed steps to reproduce, screenshots, or whatever else helps.
Thanks.