Search 1.9 billion lines of Odoo code on GitHub

post_function_one_time

Author: Trobz
License: no license
Branch: 9.0-vas-contribute
Repository: fanha99/l10n-vietnam
Dependencies: base, and web
Languages: Python (57, 57.0%), and reStructuredText (43, 43.0%)
Other repositories: trobz/l10n-vn

<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="post-function-one-time"></a> <h2>Post Function One Time</h2> <p>This application supports the system to execute specific functions only one time after the first upgrade. The executed functions will not be recalled during next upgrades unless you remove them from the &quot;List_post_object_one_time_functions&quot; system parameter. There is one main function: * run_post_object_one_time(object_name, list_functions=[])</p> <a name="installation"></a> <h2>Installation</h2> <p>Just simply install the module.</p> <a name="usage"></a> <h2>Usage</h2> <p>Declare functions that you want to run during upgrade in XML file.</p> <p>Example:</p> <pre> <code lang="xml">&lt;openerp&gt; &lt;data noupdate=&quot;0&quot;&gt; &lt;function name=&quot;start&quot; model=&quot;post.object.test.data&quot; /&gt; &lt;/data&gt; &lt;/openerp&gt;</code> </pre> <pre> <code lang="python">from openerp import api, models class PostObjectTestData(models.AbstractModel): _name = &quot;post.object.test.data&quot; _description = &quot;Set Up Data&quot; &#64;api.model def start(self): # Functions run all times self.function_run_all_time_1() self.function_run_all_time_2() self.function_run_all_time_3() # Functions run one time PostFunction = self.env['post.function.one.time'] PostFunction.run_post_object_one_time( 'post.object.test.data', [ 'function_run_one_time_1', 'function_run_one_time_2', 'function_run_one_time_3' ] ) return True</code> </pre> <a name="known-issues-roadmap"></a> <h2>Known issues / Roadmap</h2> <ul class="simple"> <li>...</li> </ul> <a name="bug-tracker"></a> <h2>Bug Tracker</h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/{project_repo}/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/{project_repo}/issues/new?body=module:%20{module_name}%0Aversion:%20{branch}%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a name="credits"></a> <h2>Credits</h2> <a name="images"></a> <h3>Images</h3> <ul class="simple"> <li>Odoo Community Association: <a class="reference external" href="https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg">Icon</a>.</li> </ul> <a name="contributors"></a> <h3>Contributors</h3> <ul class="simple"> <li>Tuan Nguyen Duc &lt;<a class="reference external" href="mailto:tuannd&#64;trobz.com">tuannd&#64;trobz.com</a>&gt;</li> </ul> <a name="maintainer"></a> <h3>Maintainer</h3> <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>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="https://odoo-community.org">https://odoo-community.org</a>.</p>