You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
oca-travis 8b20b5b7e5 [UPD] Update ir_sequence_standard_default.pot 5 years ago
..
i18n [UPD] Update ir_sequence_standard_default.pot 5 years ago
models [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
readme [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
static/description [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
tests [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
views [MIG] Migration to V12.0 - initial release 3 years ago
wizard [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
README.rst [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
__init__.py [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago
__manifest__.py [ADD] ir_sequence_standard_default: Use Standard instead No Gap sequence 5 years ago

README.rst

==============================
IrSequence Standard by Default
==============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github
:target: https://github.com/OCA/server-tools/tree/12.0/ir_sequence_standard_default
:alt: OCA/server-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-tools-12-0/server-tools-12-0-ir_sequence_standard_default
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/149/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

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**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20ir_sequence_standard_default%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Vauxoo

Contributors
~~~~~~~~~~~~

- Moises López <moylop260@vauxoo.com>
- Erick Birbe <erick@vauxoo.com>


Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-moylop260| image:: https://github.com/moylop260.png?size=40px
:target: https://github.com/moylop260
:alt: moylop260
.. |maintainer-ebirbe| image:: https://github.com/ebirbe.png?size=40px
:target: https://github.com/ebirbe
:alt: ebirbe

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-moylop260| |maintainer-ebirbe|

This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/12.0/ir_sequence_standard_default>`_ project on GitHub.

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