Search 1.9 billion lines of Odoo code on GitHub

base_time_parameter

Author: Nimarosa, appstogrow, Odoo Community Association (OCA)
License: LGPL-3
Branch: 166_14.0_oca
Repository: Digital5-Odoo/server-tools
Dependencies: base
Languages: HTML (390, 47.3%), Python (234, 28.4%), XML (134, 16.3%), and reStructuredText (66, 8.0%)
Other branches: 101_14.0_oca, 134_14.0_oca, 152_14.0_oca, 161_14.0_oca, 162_14.0_oca, 164_14.0_oca, 167_14.0_oca, 168_14.0_oca, 169_14.0_oca, 176_14.0_oca, 177_14.0_oca, 178_14.0_oca, 179_14.0_oca, 180_14.0_oca, 936_14.0_oca, TSG_mrp_d5_14.0_oca, and base_14.0_oca
Other repositories: AITIC/server-tools, Change2improve/server-tools, ForgeFlow/server-tools, Jarsa/server-tools, LevelPrime/server-tools, OCA/server-tools, Rad0van/server-tools, StefanRijnhart/server-tools, acsone/server-tools, akretion/server-tools, aurestic/server-tools, brain-tec/server-tools, camptocamp/server-tools, coopiteasy/server-tools, grindtildeath/server-tools, gurneyalex/server-tools, kmee/server-tools, legalsylvain/server-tools, modoolar/server-tools, petrus-v/server-tools, sunflowerit/server-tools, tegin/server-tools, and zarumaru/server-tools

<h1 class="title">Time Parameter</h1> <p><a class="reference external" 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" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/base_time_parameter"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-tools-14-0/server-tools-14-0-base_time_parameter"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/149/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>A value may change over time. With this module you may set starting dates and values.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li> <li><a class="reference internal" href="#usage" id="id2">Usage</a><ul> <li><a class="reference internal" href="#example-of-implementation-in-another-module" id="id3">Example of implementation in another module</a></li> </ul> </li> <li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id5">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id6">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li> </ul> </li> </ul> </div> <a name="configuration"></a> <h2><a class="toc-backref" href="#id1">Configuration</a></h2> <p>The user needs the access right &quot;Manage Time Parameters&quot;.</p> <a name="usage"></a> <h2><a class="toc-backref" href="#id2">Usage</a></h2> <p>Menu: &quot;Settings/Technical/Time Parameters&quot;</p> <p>Create a parameter with different versions (start date and value).</p> <p>If model_id is empty, any model/record may get the time parameter.</p> <p>The value may be a text or reference.</p> <p>Get the value like this:</p> <pre> <code lang="python"># Pass no date: using today's date value = model.get_time_parameter(&quot;parameter_code_or_name&quot;) # Pass a date or datetime value = model.get_time_parameter(&quot;parameter_code_or_name&quot;, date=datetime.datetime.now())) # Pass the name of a date/datetime field of the record value = record.get_time_parameter(&quot;parameter_code_or_name&quot;, &quot;date&quot;)</code> </pre> <a name="example-of-implementation-in-another-module"></a> <h3><a class="toc-backref" href="#id3">Example of implementation in another module</a></h3> <p>Payroll implementation:</p> <ul class="simple"> <li>Menu &quot;Payroll/Configuration/Time Parameters&quot; only shows payslip parameters.</li> <li>New parameters will get &quot;model_id = payslip model&quot;.</li> <li>By default, the model_id field is hidden in the form.</li> </ul> <pre> <code lang="XML">&lt;record id=&quot;base_time_parameter_action&quot; model=&quot;ir.actions.act_window&quot;&gt; &lt;field name=&quot;name&quot;&gt;Time Parameters&lt;/field&gt; &lt;field name=&quot;res_model&quot;&gt;base.time.parameter&lt;/field&gt; &lt;field name=&quot;view_mode&quot;&gt;tree,form&lt;/field&gt; &lt;field name=&quot;domain&quot; eval=&quot;[('model_id', '=', ref('payroll.model_hr_payslip'))]&quot; /&gt; &lt;field name=&quot;context&quot; eval=&quot;{'default_model_id': ref('payroll.model_hr_payslip')}&quot; /&gt; &lt;/record&gt; &lt;menuitem id=&quot;menu_action_base_time_parameter&quot; action=&quot;base_time_parameter_action&quot; name=&quot;Time Parameters&quot; parent=&quot;payroll_menu_configuration&quot; sequence=&quot;35&quot; /&gt;</code> </pre> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id4">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_time_parameter%0Aversion:%2014.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="#id5">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id6">Authors</a></h3> <ul class="simple"> <li>Nimarosa</li> <li>appstogrow</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id7">Contributors</a></h3> <ul class="simple"> <li>Nimarosa (Nicolas Rodriguez) &lt;<a class="reference external" href="mailto:nicolasrsande&#64;gmail.com">nicolasrsande&#64;gmail.com</a>&gt;</li> <li>appstogrow (Henrik Norlin) &lt;<a class="reference external" href="mailto:henrik&#64;appstogrow.co">henrik&#64;appstogrow.co</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id8">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" href="https://github.com/appstogrow"><img alt="appstogrow" src="https://github.com/appstogrow.png?size=40px" /></a> <a class="reference external" href="https://github.com/nimarosa"><img alt="nimarosa" src="https://github.com/nimarosa.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/14.0/base_time_parameter">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>