Search 1.9 billion lines of Odoo code on GitHub

web_widget_one2many_product_picker_secondary_unit

Author: Tecnativa, Odoo Community Association (OCA)
License: AGPL-3
Branch: 12.0-add-web_widget_one2many_product_picker_secondary_unit
Repository: Tecnativa/web
Dependencies: sale_order_secondary_unit, web, and web_widget_one2many_product_picker
Languages: HTML (403, 63.4%), JavaScript (23, 3.6%), Python (22, 3.5%), Sass (85, 13.4%), XML (18, 2.8%), and reStructuredText (85, 13.4%)

<h1 class="title">Web Widget One2Many Product Picker</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/12.0/web_widget_one2many_product_picker"><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-12-0/web-12-0-web_widget_one2many_product_picker"><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/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>Adds the 'one2many_product_picker' friendly mobile widget to create one2many lines linked with product.template records.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#usage" id="id1">Usage</a><ul> <li><a class="reference internal" href="#widget-options" id="id2">Widget options:</a></li> </ul> </li> <li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id4">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id5">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li> <li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li> </ul> </li> </ul> </div> <a name="usage"></a> <h2><a class="toc-backref" href="#id1">Usage</a></h2> <p>Create or edit a new view and use the new widget called 'one2many_product_picker'.</p> <a name="widget-options"></a> <h3><a class="toc-backref" href="#id2">Widget options:</a></h3> <ul> <li><p class="first">product_per_page &gt; Integer -&gt; Used to control the auto-load behaviour (scroll-pagination)</p> </li> <li><p class="first">groups &gt; Array of dictionaries -&gt; Declare the groups</p> </li> <li><p class="first">field_map &gt; Dictionary:</p> <blockquote> <ul class="simple"> <li>product -&gt; The field that represent the product_id</li> <li>name -&gt; The field that represent a name</li> <li>product_uom -&gt; The field that represent a product_uom</li> <li>product_uom_qty -&gt; The field that represent a product_uom_qty</li> <li>price_unit -&gt; The field that represent a price_unit</li> <li>parent_id -&gt; The field that represent the main record</li> </ul> </blockquote> </li> </ul> <p>Group dictionary definition:</p> <ul> <li><p class="first">name -&gt; The group name</p> </li> <li><p class="first">domain -&gt; Forced domain to use</p> </li> <li><p class="first">order -&gt; The order</p> <blockquote> <ul class="simple"> <li>name -&gt; The field name to order</li> <li>asc -&gt; Flag to use 'asc' order</li> </ul> </blockquote> </li> </ul> <p>Example:</p> <p><code>`t-options=&quot;{'groups': [{'name': 'Cheap', 'domain': [('list_price', '&lt;', 10.0)], 'field_map': { 'product': 'my_product_id' }}]}&quot;`</code></p> <p>Also you need define the view fields. The view must be an 'kanban' view. This is an example that uses the 'sale.order.line' fields:</p> <pre> <code lang="xml">&lt;field name=&quot;order_line&quot; attrs=&quot;{'readonly': [('state', 'in', ('done','cancel'))]}&quot; nolabel=&quot;1&quot; widget=&quot;one2many_product_picker&quot; options=&quot;{'groups': [{'name': 'Desk', 'domain': [('name', 'ilike', '%desk%')], 'order': {'name': 'id', 'asc': true}}, {'name': 'Chairs', 'domain': [('name', 'ilike', '%chair%')]}]}&quot; &gt; &lt;kanban&gt; &lt;field name=&quot;name&quot;/&gt; &lt;field name=&quot;product_id&quot; /&gt; &lt;field name=&quot;product_uom_qty&quot; /&gt; &lt;field name=&quot;product_uom&quot;/&gt; &lt;field name=&quot;price_unit&quot;/&gt; &lt;field name=&quot;order_id&quot;/&gt; &lt;/kanban&gt; &lt;/field&gt;</code> </pre> <p>** In this example we don't use 'field_map' option because the default match with the sale.order.line field names.</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id3">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_one2many_product_picker%0Aversion:%2012.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="#id4">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id5">Authors</a></h3> <ul class="simple"> <li>Tecnativa</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id6">Contributors</a></h3> <ul> <li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p> <blockquote> <ul class="simple"> <li>Alexandre D. Díaz</li> <li>Pedro M. Baeza</li> </ul> </blockquote> </li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id7">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>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_widget_one2many_product_picker">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>