Search 1.9 billion lines of Odoo code on GitHub

crnd_web_m2o_info_widget

Author: Center of Research and Development
License: LGPL-3
Branch: 15.0
Repository: crnd-inc/crnd-web
Dependencies: web
Languages: HTML (53, 12.8%), JavaScript (207, 50.0%), PO File (26, 6.3%), Python (37, 8.9%), Sass (15, 3.6%), XML (9, 2.2%), and reStructuredText (67, 16.2%)
Other branches: 12.0, 13.0, and 14.0

<a name="crnd-many2one-info-widget"></a> <h2>CRND Many2one Info Widget</h2> <p><a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external" href="https://crnd.pro/doc-bureaucrat-itsm/11.0/en/Website_Service_Desk_eng/"><img alt="badge4" src="https://img.shields.io/badge/docs-Website_Service_Desk-yellowgreen.png" /></a> <a class="reference external" href="https://crnd.pro/"><img alt="badge5" src="https://img.shields.io/badge/maintainer-CR&amp;D-purple.png" /></a></p> <p>CRND Web M2O widget provide to display additional info about field.</p> <p>Read the <a class="reference external" href="https://crnd.pro/doc-bureaucrat-itsm/11.0/en/Website_Service_Desk_eng/">Website Service Desk</a> Module Guide for more information.</p> <a name="usage"></a> <h3>Usage</h3> <p>Simple example for internal usage:</p> <blockquote> <pre> <code lang="xml">&lt;field name=&quot;widget_partner_id&quot; placeholder=&quot;Partner...&quot; widget=&quot;m2o_info&quot; options=&quot;{ 'info_fields': [ 'name', 'commercial_company_name', 'website', 'email', 'phone', 'mobile']}&quot;/&gt;</code> </pre> </blockquote> <p>Another example of usage, using method that have to return all needed info on destination model:</p> <blockquote> <pre> <code lang="python">class ResPartner(models.Model): _inherit = 'res.partner' def helper_many2one_info(self): self.ensure_one() res = [] read_fields = [ 'name', 'commercial_company_name', 'website', 'email', 'phone', 'mobile' ] for field_name in read_fields: res += [{ 'value': self[field_name], 'string': self._fields[field_name].get_description( self.env)['string'], 'name': field_name, }] return res</code> </pre> <pre> <code lang="xml">&lt;field name=&quot;widget_partner_id&quot; placeholder=&quot;Partner...&quot; widget=&quot;m2o_info&quot; options=&quot;{'info_method': 'helper_many2one_info'}&quot;/&gt;</code> </pre> </blockquote> <p>Also, you can use simple helper function on python side to compute field info. With this function, example above could be rewritten as:</p> <blockquote> <pre> <code lang="python">from odoo.addons.crnd_web_m2o_info_widget import helper_get_many2one_info_data class ResPartner(models.Model): _inherit = 'res.partner' def helper_many2one_info(self): return helper_get_many2one_info_data(self, [ 'name', 'commercial_company_name', 'website', 'email', 'phone', 'mobile' ])</code> </pre> </blockquote> <p>This module is part of the Bureaucrat ITSM project. You can try it by the references below.</p> <a name="launch-your-own-itsm-system-in-60-seconds"></a> <h3>Launch your own ITSM system in 60 seconds:</h3> <p>Create your own <a class="reference external" href="https://yodoo.systems/saas/template/bureaucrat-itsm-demo-data-95">Bureaucrat ITSM</a> database</p> <p><a class="reference external" href="https://yodoo.systems"><img alt="badge3" src="https://img.shields.io/badge/powered%20by-yodoo.systems-00a09d.png" /></a></p> <a name="bug-tracker"></a> <h2>Bug Tracker</h2> <p>Bugs are tracked on <a class="reference external" href="https://crnd.pro/requests">https://crnd.pro/requests</a>. In case of trouble, please report there.</p> <a name="maintainer"></a> <h3>Maintainer</h3> <img alt="https://crnd.pro/web/image/3699/300x140/crnd.png" src="https://crnd.pro/web/image/3699/300x140/crnd.png" /> <p>Our web site: <a class="reference external" href="https://crnd.pro/">https://crnd.pro/</a></p> <p>This module is maintained by the Center of Research &amp; Development company.</p> <p>We can provide you further Odoo Support, Odoo implementation, Odoo customization, Odoo 3rd Party development and integration software, consulting services. Our main goal is to provide the best quality product for you.</p> <p>For any questions <a class="reference external" href="mailto:info&#64;crnd.pro">contact us</a>.</p>