[6.1] Sequence number_next gives invalid feedback since new implementation
Bug #960201 reported by
Yann Papouin
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP Publisher's Warranty Team | ||
Therp Backports (Deprecated) |
Fix Released
|
Undecided
|
Ronald Portier (Therp) | ||
Server-6.1 |
Fix Released
|
Undecided
|
Ronald Portier (Therp) |
Bug Description
A "new" sequence implementation named "standard" is using the pgsql built-in sequence.
The "Next Number" value is incorrect because not updated when the built-in one is ('ir_sequence_
To reproduce:
[PURCHASES] -> [Purchase Management] -> [Purchase Orders] -> [Create]: PO00001
[PURCHASES] -> [Purchase Management] -> [Purchase Orders] -> [Create]: PO00002
[PURCHASES] -> [Purchase Management] -> [Purchase Orders] -> [Create]: PO00003
[PURCHASES] -> [Purchase Management] -> [Purchase Orders] -> [Create]: PO00004
[SETTINGS] -> [Configuration] -> [Sequences & Identifiers] -> [Sequences]: Purchase Order with Next Number = 1 (should be 5)
Related branches
lp:~therp-nl/therp-backports/openerp-server-6.1-lp960201_fix_sequence
- Stefan Rijnhart (Opener) (community): Approve
- Holger Brunn (Therp): Approve
- Cristian Salamea (community): Needs Information
-
Diff: 205 lines (+105/-10)2 files modifiedopenerp/addons/base/ir/ir.xml (+11/-1)
openerp/addons/base/ir/ir_sequence.py (+94/-9)
lp:~therp-nl/openobject-server/ronald@therp.nl_fix_sequence_lp960201
- OpenERP Core Team: Pending requested
-
Diff: 213 lines (+108/-10) (has conflicts)2 files modifiedopenerp/addons/base/ir/ir_sequence.py (+97/-9)
openerp/addons/base/ir/ir_sequence_view.xml (+11/-1)
lp:~openerp-dev/openobject-server/7.0-sequence-next-fix-csn
Ready for review
for merging
into
lp:openobject-server
- OpenERP Core Team: Pending requested
- Diff: 0 lines
- Olivier Dony (Odoo): Approve
- qdp (OpenERP): Pending requested
-
Diff: 129 lines (+49/-10)2 files modifiedopenerp/addons/base/ir/ir_sequence.py (+47/-8)
openerp/addons/base/ir/ir_sequence_view.xml (+2/-2)
Changed in openobject-server: | |
assignee: | OpenERP's Framework R&D (openerp-dev-framework) → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Changed in therp-backports: | |
status: | New → Fix Released |
assignee: | nobody → Ronald Portier (Therp) (rportier1962) |
To post a comment you must log in.
You're right, the Postgres-backed sequence implementation does not currently update its "next number", because updating the corresponding "ir.sequence" row with the new next_number value would make it subject to the same limitations and concurrency bottlenecks as the "no_gap" implementation.
We should probably replace the next_number field with a function field that queries the Postgres sequence on-demand if the sequence is of `standard` type, and reads it from the database for "no_gap" ones (also taking care of `update` operations like it is done now).
Any contributed patches are welcome, by the way :-)
Thanks for reporting!