Search 1.9 billion lines of Odoo code on GitHub

base_changeset

Author: Onestein, Camptocamp, Odoo Community Association (OCA)
License: AGPL-3
Branch: 13.0
Repository: AITIC/server-tools
Dependencies: web
Languages: HTML (460, 17.0%), JavaScript (144, 5.3%), Python (1365, 50.4%), Sass (10, 0.4%), XML (508, 18.7%), and reStructuredText (224, 8.3%)
Other branches: 12.0, and 14.0
Other repositories: Albin-John/server-tools, Artielkami/server-tools, Callino/server-tools, Change2improve/server-tools, Comunitea/server-tools, Digital5-Odoo/server-tools, Dobtor-OCA/server-tools, DucTruongKomit/server-tools, ERPLibre/server-tools, FernandoRomera/server-tools, ForgeFlow/server-tools, Gabinete-Digital/server-tools, Intesco2-0/server-tools, Jarsa/server-tools, LevelPrime/server-tools, LourenzoH/server-tools, NL66278/server-tools, OCA/server-tools, OdooIndonesia/server-tools, Rad0van/server-tools, ScopeaFrance/server-tools, SequarSrl/server-tools, SeuMarco/server-tools, StefanRijnhart/server-tools, TRESCLOUD/server-tools, Tecnativa/server-tools, TimLai125/server-tools, VanMoof/server-tools, Vauxoo/server-tools, YannickB/server-tools, aaltinisik/server-tools, acsone/server-tools, adhoc-dev/server-tools, akretion/server-tools, anhvu-sg/server-tools, antilhue/server-tools, aurestic/server-tools, avoinsystems/server-tools, blooparksystems/server-tools, bmya/server-tools, brain-tec/server-tools, camptocamp/server-tools, captivea-dcr/server-tools, coopiteasy/server-tools, dalal-intellisoft/server-tools, dennybiasiolli/server-tools, eLBati/server-tools, ecosoft-odoo/server-tools, emagdalenaC2i/server-tools, ewac-nl/server-tools, focusate/oca-server-tools, gab-net/server-tools, gitguohao/server-tools, grindtildeath/server-tools, gurneyalex/server-tools, hbrunn/server-tools, hibou-io/oca-server-tools, i-vyshnevska/server-tools, igallart/server-tools, initOS/server-tools, invitu/server-tools, jaballate/server-tools, kait-avalah/server-tools, kittiu/server-tools, kmee/server-tools, legalsylvain/server-tools, lideritjnma/server-tools, lonelyleaves/server-tools, modoolar/server-tools, multidadosti-erp/server-tools, nilshamerlinck/server-tools, ntsirintanis/server-tools, nuobit/server-tools, omalbastin/server-tools, petrus-v/server-tools, praxigento/oca-server-tools, rdeheele/server-tools, robertsvx27/server-tools, rsullivan2704/server-tools, rudisulistyo/server-tools, sebalix/server-tools, simahawk/server-tools, sodexis/server-tools, solvosci/server-tools, sunflowerit/server-tools, sunshineLhj/server-tools, sysprocesarcastro/server-tools, tafaRU/server-tools, tegin/server-tools, tirma-sa/server-tools, trevi-software/server-tools, trobz/server-tools, unitek-solusi/OCA-server-tools, ursais/server-tools, versada/server-tools, victoralmau/server-tools, xcgd/server-tools, ypapouin/server-tools, yuzhengxing/server-tools, zarumaru/server-tools, and zhaohuaw/server-tools

<h1 class="title">Track record changesets</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/server-tools/tree/13.0/base_changeset"><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-13-0/server-tools-13-0-base_changeset"><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/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module extends the functionality of records. It allows to create changesets that must be validated when a record is modified instead of direct modifications. Rules allow to configure which field must be validated.</p> <a name="what-is-a-changeset"></a> <h2>What is a changeset</h2> <p>A changeset is a list of changes made on a record.</p> <p>Some of the changes may be 'Pending', some 'Accepted' or 'Rejected' according to the changeset rules. The 'Pending' changes require an interaction by the approver user: only when that change is approved, its value is written on the record.</p> <div class="admonition important"> <p class="first admonition-title">Important</p> <p class="last">This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. <a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p> </div> <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> </ul> </div> <a name="configuration"></a> <h3><a class="toc-backref" href="#id1">Configuration</a></h3> <a name="access-rights"></a> <h2>Access Rights</h2> <p>The changesets rules must be edited by users with the group <code>Changesets Configuration</code>. The changesets can be applied or canceled only by users with the group <code>Changesets Validations</code></p> <a name="changesets-rules"></a> <h2>Changesets Rules</h2> <p>The changesets rules can be configured in <code>Configuration &gt; Record Changesets &gt; Fields Rules</code>.</p> <ul> <li><p class="first">Configuration of rules</p> <img alt="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/rules.png" src="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/rules.png" /> </li> </ul> <p>For each record field, an action can be defined:</p> <ul class="simple"> <li>Auto: the changes made on this field are always applied</li> <li>Validate: the changes made on this field must be manually confirmed by a 'Changesets User' user</li> <li>Never: the changes made on this field are always refused</li> </ul> <p>In any case, all the changes made by the users are always applied directly on the users, but a 'validated' changeset is created for the history.</p> <p>The supported fields are:</p> <ul class="simple"> <li>Char</li> <li>Text</li> <li>Date</li> <li>Datetime</li> <li>Integer</li> <li>Float</li> <li>Monetary</li> <li>Boolean</li> <li>Many2one</li> </ul> <p>Rules can be global (no source model) or configured by source model. Rules by source model have the priority. If a field is not configured for the source model, it will use the global rule (if existing).</p> <p>If a field has no rule, it is written to the record without changeset.</p> <a name="usage"></a> <h3>Usage</h3> <a name="changeset-rules"></a> <h2>Changeset rules</h2> <p>The first step is to configure the changeset rules. Once that done, writes on records will be created as changesets.</p> <a name="handling-changesets"></a> <h2>Handling changesets</h2> <p>The list of all the changesets is in <code>Configuration &gt; Record Changesets &gt; Changesets</code>.</p> <p>By default, only the pending changesets (waiting for validation) are shown. Remove the &quot;Pending&quot; filter to show all the changesets.</p> <ul> <li><p class="first">Changeset waiting for validation</p> <img alt="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/changeset.png" src="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/changeset.png" /> </li> </ul> <p>The changes view shows the name of the record's field, the Origin value and the New value alongside the state of the change. By clicking on the change in some cases a more detailed view is displayed, for instance, links for relations can be clicked on.</p> <p>A button on a changeset allows to apply or reject all the changes at once.</p> <a name="handling-single-changes"></a> <h2>Handling single changes</h2> <p>Accessing the changesets gives the full overview of all the changes made. However, it is more convenient to access the single changes directly from the records. When there is a pending change for a field you get a badge with the number of pending changes next to it like this:</p> <ul> <li><p class="first">Badge with the number of pending changes</p> <img alt="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/badge.png" src="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/badge.png" /> </li> </ul> <p>When you click on it:</p> <ul> <li><p class="first">Clicking the badge: red button to reject, green one to apply</p> <img alt="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/badge_click.png" src="https://raw.githubusercontent.com/OCA/server-tools/13.0/base_changeset/base_changeset/static/src/img/badge_click.png" /> </li> </ul> <p>Click the red button to reject the change, click the green one to apply it.</p> <a name="custom-source-rules-in-your-addon"></a> <h2>Custom source rules in your addon</h2> <p>Addons wanting to create changeset with their own rules should pass the following keys in the context when they write on the record:</p> <ul class="simple"> <li><code>__changeset_rules_source_model</code>: name of the model which asks for the change</li> <li><code>__changeset_rules_source_id</code>: id of the record which asks for the change</li> </ul> <p>Also, they should extend the selection in <code>ChangesetFieldRule._domain_source_models</code> to add their model (the same that is passed in <code>__changeset_rules_source_model</code>).</p> <p>The source is used for the application of the rules, allowing to have a different rule for a different source. It is also stored on the changeset for information.</p> <a name="known-issues-roadmap"></a> <h3>Known issues / Roadmap</h3> <ul class="simple"> <li>Only a subset of the type of fields is actually supported</li> <li>Multicompany not fully supported</li> </ul> <a name="bug-tracker"></a> <h3>Bug Tracker</h3> <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_changeset%0Aversion:%2013.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> <h3>Credits</h3> <a name="authors"></a> <h4>Authors</h4> <ul class="simple"> <li>Onestein</li> <li>Camptocamp</li> </ul> <a name="contributors"></a> <h4>Contributors</h4> <ul class="simple"> <li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li> <li>Denis Leemann &lt;<a class="reference external" href="mailto:denis.leemann&#64;camptocamp.com">denis.leemann&#64;camptocamp.com</a>&gt;</li> <li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li> <li>Dennis Sluijk &lt;<a class="reference external" href="mailto:d.sluijk&#64;onestein.nl">d.sluijk&#64;onestein.nl</a>&gt;</li> <li>Andrea Stirpe &lt;<a class="reference external" href="mailto:a.stirpe&#64;onestein.nl">a.stirpe&#64;onestein.nl</a>&gt;</li> </ul> <a name="maintainers"></a> <h4>Maintainers</h4> <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">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/astirpe"><img alt="astirpe" src="https://github.com/astirpe.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-tools/tree/13.0/base_changeset">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>