<h1 class="title">Base Sequence</h1>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <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.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/15.0/base_sequence"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-15-0/server-tools-15-0-base_sequence"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/149/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module refactor the <cite>ir.sequence</cite> allowing more legends to be added with minimal code duplication and
adding <cite>preview</cite> fields on both <cite>ir.sequence</cite> and <cite>ir.sequence.date_range</cite> models.
the <cite>preview</cite> field is a computed fields that only visible in edit-mode of the form view works with <cite>range_</cite> and <cite>range_end_</cite>.
It helps users to check and validate the prefix, suffix, and padding configuration easily without a need to actually generate an actual document.</p>
<p>Adding more legends to <cite>ir.sequence</cite> requires an extension of an inner method <cite>_interpolation_dict()</cite>
of the <cite>_get_prefix_suffix()</cite> method. An extension of an inner method is impractical,
therefore this module override the <cite>_get_prefix_suffix()</cite> method
by moving the inner private method <cite>_interpolation_dict()</cite> to a private method.
Therefore, this allows another module to add more legends to the <cite>ir.sequence</cite>.</p>
<p>This modules works as a base module to other modules to add more legends to <cite>ir.sequence</cite>.
and extends the <cite>ir.sequence</cite> allowing <cite>range_end_</cite> , <cite>range_period_</cite> and <cite>qoy</cite> legends. It adds the following legends:</p>
<ul class="simple">
<li>The end of <cite>date_range</cite> year with century: <cite>%(range_end_year)s</cite></li>
<li>The end of <cite>date_range</cite> year without century: <cite>%(range_end_y)s</cite></li>
<li>The end of <cite>date_range</cite> month: <cite>%(range_end_month)s</cite></li>
<li>The end of <cite>date_range</cite> day: <cite>%(range_end_day)s</cite></li>
<li>The end of <cite>date_range</cite> day of the year: <cite>%(range_end_doy)s</cite></li>
<li>The end of <cite>date_range</cite> week of the year: <cite>%(range_end_woy)s</cite></li>
<li>The end of <cite>date_range</cite> weekday: <cite>%(range_end_weekday)s</cite></li>
<li>The end of <cite>date_range</cite> hour in 24-hour: <cite>%(range_end_h24)s</cite></li>
<li>The end of <cite>date_range</cite> hour in 12-hour: <cite>%(range_end_h12)s</cite></li>
<li>The end of <cite>date_range</cite> minute: <cite>%(range_end_min)s</cite></li>
<li>The end of <cite>date_range</cite> second: <cite>%(range_end_sec)s</cite></li>
<li>The period of <cite>date_range</cite> month: <cite>%(range_period_month)s</cite></li>
<li>Quarter of the Year: <cite>%(qoy)s</cite></li>
<li>The begin of <cite>date_range</cite> quarter of the Year: <cite>%(range_qoy)s</cite></li>
<li>The end of <cite>date_range</cite> quarter of the Year: <cite>%(range_end_qoy)s</cite></li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<a name="bug-tracker"></a>
<h2><a class="toc-backref" href="#id1">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-tools/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-tools/issues/new?body=module:%20base_sequence%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
<a name="credits"></a>
<h2><a class="toc-backref" href="#id2">Credits</a></h2>
<a name="authors"></a>
<h3><a class="toc-backref" href="#id3">Authors</a></h3>
<ul class="simple">
<li>Sansiri Tanachutiwat</li>
<li>Ecosoft</li>
</ul>
<a name="contributors"></a>
<h3><a class="toc-backref" href="#id4">Contributors</a></h3>
<ul class="simple">
<li><a class="reference external" href="http://tggs.kmtunb.ac.th">TGGS KMUTNB</a>:<ul>
<li>Sansiri Tanachutiwat <<a class="reference external" href="mailto:sansiri.t@tggs.kmutnb.ac.th">sansiri.t@tggs.kmutnb.ac.th</a>></li>
</ul>
</li>
<li><a class="reference external" href="http://ecosoft.co.th">Ecosoft</a>:<ul>
<li>Saran Lim. <<a class="reference external" href="mailto:saranl@ecosoft.co.th">saranl@ecosoft.co.th</a>></li>
</ul>
</li>
</ul>
<a name="maintainers"></a>
<h3><a class="toc-backref" href="#id5">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<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>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/sansirit"><img alt="sansirit" src="https://github.com/sansirit.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/Saran440"><img alt="Saran440" src="https://github.com/Saran440.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/15.0/base_sequence">OCA/server-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>