Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

IrSequence Standard by Default

Beta License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

Set the implementation to “Standard” in all your current Sequences (ir.sequence) and all new sequences are created as “Standard” by default instead of “No Gap” implementation.

What’s the problem with “No Gap” Sequence Implementations

“No Gap” is the default value of sequences in Odoo. However, this kind of sequences cause more locks and can turn a database slow.

Taking as example an invoice, if you assign an invoice number to one record, but it sill not finish the process, this process must end in order to another invoice could assign a new number and there was no gaps between the invoice numbers. It seems to be good at first sight. But the problem starts when there is a chained process.

Imagine that there is one user that executes a process that produces 100 invoices and these at the same time produces 100 journal entries that also use a consecutive (no gap) sequence. And also those invoices are sent to sign with and external institution (that could take 2 seconds in giving a response because of internet latency or server load), and maybe they made another calculations that makes them to take 5 seconds more for each invoice, and all this is chained to one single transaction. This means that for 8.5 minutes anybody else could confirm invoices, neither journal entries of the involved journals.

Now, think there is 20 users that have to execute a similar process. The problem turns exponential. If another user comes to make an operation with the same jornal it will thrown a concurrency failure.

You can mitigate it if you segment each transaction and don’t chain them. It means, making commit for each invoice or process. It reduces the probability that there is a concurrency error or a lock wait. However, it still not solve it completely.

Why to use Sequences with “Standard” Implementation

If you use the standard sequence of PosgreSQL, it doesn’t lock because at the moment the request is done, the next sequence number it is changed in an isolated transaction, and it have not to wait the other transaction to end. However, if the transaction produces a rollback, this sequence isn’t reverted, it means, it’s lost. It may be not not serious because when you cancel or remove records that number is lost too.

What this module does

To eliminate completely that concurrency/slowness problem, this module changes all the sequences (ir.sequence) implementation from “No Gap” to “Standard” with the awareness that it will skip numbers. In the majority of database models and many users projects there is no problem with that jump occurs.

Table of contents

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Vauxoo

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainers:

moylop260 ebirbe

This module is part of the OCA/server-tools project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo12-addon-ir-sequence-standard-default 12.0.1.0.0.99.dev3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo12-addon-ir-sequence-standard-default 12.0.1.0.0.99.dev3
File Interpreter ABI Platform
odoo12_addon_ir_sequence_standard_default-12.0.1.0.0.99.dev3-py3-none-any.whl Python 3 none any Details

Release files / odoo12_addon_ir_sequence_standard_default-12.0.1.0.0.99.dev3-py3-none-any.whl

Download URL odoo12_addon_ir_sequence_standard_default-12.0.1.0.0.99.dev3-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0886fa0e4f12b6302ba6990aad70e97a2ec0c60818ba3c5d9e827af0e9ddace0
BLAKE2b-256 checksum
How to use checksums
496d4b44ac9b904a63c38d32faa048e9d0c5ffd4ece6e6ca570d60f43ffb5cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page