Author: |
LasLabs, Odoo Community Association (OCA) |
License: |
AGPL-3 |
Branch: |
feature/9.0/website_field_autocomplete-relat |
Repository: |
LasLabs/website |
Dependencies: |
website,
and
website_field_autocomplete |
Languages: |
JavaScript (61, 28.5%),
Python (45, 21.0%),
XML (58, 27.1%),
and
reStructuredText (50, 23.4%) |
Other branches: |
release/10.0/website_field_autocomplete_related,
release/9.0/laslabs,
and
release/9.0/website_field_autocomplete_related |
<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/license-AGPL--3-blue.svg">
</a>
<a name="website-field-autocomplete-related"></a>
<h2>Website Field AutoComplete Related</h2>
<p>Extends Website Autocomplete field to allow for related fields, for example
a form that automatically completes based on search results.</p>
<a name="usage"></a>
<h3>Usage</h3>
<p>To use this module, you would follow the instructions provided in
<code>website_field_autocomplete</code>.</p>
<p>The only difference is that you would create multiple auto complete
fields, then utilize the <code>data-relate-recv</code> attribute to link the
fields' data & searches together.</p>
<p>If you would like to activate the relation on a non-autocomplete element,
you also need to add the <code>data-query-field</code> attribute or match the name of
the element to the name of the column.</p>
<p>If you would like to send data to a different Relation Group, you can use the
<code>data-relate-send</code> attribute. If you utilize this attribute, you will likely
also need <code>data-recv-field</code> which will select the field that should be
received when it is updated via its receive group.</p>
<p>Following is an example:</p>
<pre>
<code lang="xml"><label for="name">Name</label>
<input type="text"
name="name"
class="js_website_autocomplete"
data-query-field="name"
data-relate-recv="res_partner"
data-model="res.partner"
/>
<label for="company">Company</label>
<input type="text"
name="company"
class="js_website_autocomplete"
data-query-field="name"
data-relate-recv="res_partner"
data-relate-send="_"
data-model="res.company"
/>
<label for="name">Phone</label>
<input type="text"
name="phone"
class="js_website_autocomplete"
data-query-field="phone"
data-relate-recv="res_partner"
data-model="res.partner"
/>
<label for="name">Street</label>
<input type="text"
name="company"
data-query-field="street"
data-relate-recv="res_partner"
/>
<label for="name">Street 2</label>
<input type="text"
name="street2"
data-relate-recv="res_partner"
/></code>
</pre>
<p>Following is a breakdown of the attributes and functions provided:</p>
<table class="docutils">
<colgroup>
<col width="20%" />
<col width="54%" />
<col width="15%" />
<col width="10%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Attribute</th>
<th class="head">Description</th>
<th class="head">Default</th>
<th class="head">Required</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>data-relate-recv</td>
<td>Receive data updated from fields of this group</td>
<td> </td>
<td>False</td>
</tr>
<tr><td>data-relate-send</td>
<td>Send data to fields with this group name</td>
<td>relate-recv</td>
<td>False</td>
</tr>
<tr><td>data-recv-field</td>
<td>Column name to receive data on (from res model)</td>
<td>query-field</td>
<td>False</td>
</tr>
</tbody>
</table>
<a class="reference external image-reference" href="https://runbot.odoo-community.org/runbot/186/9.0"><img alt="Try me on Runbot" src="https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas" /></a>
<a name="known-issues-road-map"></a>
<h3>Known Issues / Road Map</h3>
<a name="bug-tracker"></a>
<h3>Bug Tracker</h3>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/website/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 feedback.</p>
<a name="credits"></a>
<h3>Credits</h3>
<a name="contributors"></a>
<h4>Contributors</h4>
<ul class="simple">
<li>Dave Lasley <<a class="reference external" href="mailto:dave@laslabs.com">dave@laslabs.com</a>></li>
</ul>
<a name="maintainer"></a>
<h4>Maintainer</h4>
<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>