<a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.svg">
</a>
<a name="fix-sequence-functionality"></a>
<h2>Fix Sequence Functionality</h2>
<p>Using sequence field implies that lines should keep an original order they were
added. However standard functionality does not yield this result.</p>
<p>With this module installed sequence value is based on other sequences in
the same list, which combined with <em>_order = 'sequence ASC'</em> allows to retain
ordering of which records were created.</p>
<p>What this module does:</p>
<ul class="simple">
<li>Works only for records created in front-end</li>
<li>Makes sure that new records gets highest or lowest sequence value depending
on where record is inserted (in case of editable list "top" or "bottom")</li>
</ul>
<p>What this module doesn't do:</p>
<ul class="simple">
<li>Does not work for records created from back-end</li>
<li>It does not ensure that first element has sequence = 1</li>
<li>It does not check for continues sequence numbering (e.g. sequences like
1, 2, 5, 8 are possible)</li>
<li>Does not ensure sequence uniqueness</li>
</ul>
<p><strong>Important</strong>: this module might create negative sequence numbers (e.g. in case
of tree view <em>editable=top</em>)</p>
<p><strong>Technical</strong>: The module injects computed sequence into context like so:
<em>{"default_sequence": <value>}</em>. This overrides defaults defined in <em>_defaults</em> dict. If you still want to provide your own sequence value you can do it by overriding
<em>default_get()</em> function.</p>
<a name="usage"></a>
<h3>Usage</h3>
<ul class="simple">
<li>Install this module</li>
<li>Define new field <em>sequence = fields.Integer()</em></li>
<li>Add sequence field in desired view (you can hide field with <em>invisible="1"</em> if
needed)</li>
<li>Ensure ordering with <em>_order = 'sequence ASC'</em></li>
</ul>
<a name="known-issues-roadmap"></a>
<h3>Known issues / Roadmap</h3>
<ul class="simple">
<li>Fix negative sequence numbers</li>
<li>Ensure continuous sequence numbering</li>
</ul>
<a name="credits"></a>
<h3>Credits</h3>
<a name="contributors"></a>
<h4>Contributors</h4>
<ul class="simple">
<li>Andrius Preimantas <<a class="reference external" href="mailto:andrius@versada.lt">andrius@versada.lt</a>></li>
</ul>
<a name="maintainer"></a>
<h4>Maintainer</h4>
<a class="reference external image-reference" href="http://odoo-community.org"><img alt="Odoo Community Association" src="http://odoo-community.org/logo.png" /></a>
<p>This module is maintained by the OCA.</p>
<p>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.</p>
<p>To contribute to this module, please visit <a class="reference external" href="http://odoo-community.org">http://odoo-community.org</a>.</p>