Search 1.9 billion lines of Odoo code on GitHub

web_widget_many2one_simple

Author: Tecnativa, Odoo Community Association (OCA)
License: AGPL-3
Branch: 15.0
Repository: AITIC/web
Dependencies: web
Languages: HTML (392, 43.8%), JavaScript (244, 27.3%), PO File (69, 7.7%), Python (22, 2.5%), Sass (19, 2.1%), XML (53, 5.9%), and reStructuredText (95, 10.6%)
Other branches: 13.0, 13.0_sh, and 14.0
Other repositories: ACCOMODATA-BVBA/web, AntoniRomera/web, AyoubZahid/web, Change2improve/web, Darknroses/web, Digital5-Odoo/web, Dobtor-OCA/web, ForgeFlow/web, GSLabIt/web, Gabinete-Digital/web, GlodoUK/oca-web, HirenDangar/web, Ingeos/web, Jarsa/web, KKamaa/web, LevelPrime/web, Martronic-SA/web, NeatNerdPrime/web, OCA-MUK/web, OCA/web, StefanRijnhart/web, Studio73/web, TRESCLOUD/web, Tecnativa/web, Vauxoo/web, acsone/web, agrista/odoo-web, akretion/web, anhvu-sg/web, antilhue/web, aurestic/web, bizzappdev/web, blooparksystems/web, bmya/web, brain-tec/web, brian10048/web, camptocamp/web, coopiteasy/web, dingguijin/web, dynapps/web, ecosoft-odoo/web, ehsu0407/web, factorlibre/web, focusate/web-oca, gastonfeng/web, gfcapalbo/web, gtorresemmanuel/web, hbrunn/web, initOS/web, kmee/web, kos94ok-3D/web, leanhtuan1996/web, legalsylvain/web, modoolar/oca-web, mohamedhagag/web, onurugur/web, phuctranerp/web, praxigento/oca-web, rven/web, samsagaz/web, sodexis/web, sudhir-erpharbor/web, sunflowerit/web, tarteo/web, tegin/web, trevi-software/web, tvtma/web, unitek-solusi/OCA-web, ursais/web, versada/web, vialaurea/OCA-web, vnsofthe/web, wahello/oca-web, xcgd/web, and zcyuefan/web

<h1 class="title">Simple many2one widget</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/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/web/tree/15.0/web_widget_many2one_simple"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-15-0/web-15-0-web_widget_many2one_simple"><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/162/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module adds a new widget to many2one fields that allows to link records without any extra features (no autocomplete and no partial search).</p> <ul> <li><p class="first">Preview</p> <img alt="https://raw.githubusercontent.com/OCA/web/15.0/web_widget_many2one_simple/static/img/preview.gif" src="https://raw.githubusercontent.com/OCA/web/15.0/web_widget_many2one_simple/static/img/preview.gif" /> </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="#configuration" id="id1">Configuration</a><ul> <li><a class="reference internal" href="#attributes" id="id2">Attributes:</a></li> <li><a class="reference internal" href="#options" id="id3">Options:</a></li> </ul> </li> <li><a class="reference internal" href="#usage" id="id4">Usage</a><ul> <li><a class="reference internal" href="#example" id="id5">Example:</a></li> </ul> </li> <li><a class="reference internal" href="#bug-tracker" id="id6">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id7">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id8">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id9">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id10">Maintainers</a></li> </ul> </li> </ul> </div> <a name="configuration"></a> <h2><a class="toc-backref" href="#id1">Configuration</a></h2> <a name="attributes"></a> <h3><a class="toc-backref" href="#id2">Attributes:</a></h3> <ul class="simple"> <li>regex [String]: Defines the regex to test the search criteria</li> <li>can_create [Boolean]: Allow create new records</li> <li>can_write [Boolean]: Allow edit the linked record</li> </ul> <a name="options"></a> <h3><a class="toc-backref" href="#id3">Options:</a></h3> <ul class="simple"> <li>search [Dictionary] * field: The field to use in the search process [Default is 'id'] * oper: The operator (like, ilike, etc...) [Default is '=']</li> <li>no_create: Invalidates the 'can_create' flag</li> <li>no_write: Invalidates the 'can_write' flag</li> <li>no_open: Disables open the linked record</li> </ul> <a name="usage"></a> <h2><a class="toc-backref" href="#id4">Usage</a></h2> <p>You need to declare the usage of the new widget as follows: <code>&lt;field name=&quot;xxx&quot; widget=&quot;many2one_simple&quot; options=&quot;...&quot;&gt;</code></p> <p>If you have a database with demo data, you can test this widget following these instructions:</p> <ol class="arabic simple"> <li>Go to Contacts.</li> <li>Create or edit a record.</li> <li>Set &quot;Industry&quot; field (in Sales &amp; Purchase tab).</li> <li>Only if you set the correct industry name (&quot;Administrative&quot; for example), it will be defined. Otherwise, it will try to create one with that name.</li> </ol> <a name="example"></a> <h3><a class="toc-backref" href="#id5">Example:</a></h3> <pre> <code lang="xml">&lt;field name=&quot;partner_id&quot; widget=&quot;many2one_simple&quot; regex=&quot;^1\d*&quot; options=&quot;{&amp;quot;search&amp;quot;: { &amp;quot;field&amp;quot;: &amp;quot;name&amp;quot;, &amp;quot;oper&amp;quot;: &amp;quot;ilike&amp;quot; }}&quot;/</code> </pre> <p>** Only allows search by id's that starts with '1' ...</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id6">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/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/web/issues/new?body=module:%20web_widget_many2one_simple%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="#id7">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id8">Authors</a></h3> <ul class="simple"> <li>Tecnativa</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id9">Contributors</a></h3> <ul class="simple"> <li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul> <li>Alexandre D. Díaz</li> </ul> </li> <li>Foram Shah &lt;<a class="reference external" href="mailto:foram.shah&#64;initos.com">foram.shah&#64;initos.com</a>&gt;</li> <li>Thanakrit Pintana &lt;<a class="reference external" href="mailto:thanakrit.p39&#64;gmail.com">thanakrit.p39&#64;gmail.com</a>&gt;</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id10">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">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/Tardo"><img alt="Tardo" src="https://github.com/Tardo.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/15.0/web_widget_many2one_simple">OCA/web</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>