Skip to content

Latest commit

 

History

History

crnd_web_m2o_info_widget

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CRND Many2one Info Widget

License: LGPL-3 badge4 badge5

CRND Web M2O widget provide to display additional info about field.

Read the Website Service Desk Module Guide for more information.

Usage

Simple example for internal usage:

<field name="widget_partner_id"
       placeholder="Partner..."
       widget="m2o_info"
       options="{
           'info_fields': [
               'name', 'commercial_company_name', 'website',
               'email', 'phone', 'mobile']}"/>

Another example of usage, using method that have to return all needed info on destination model:

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
<field name="widget_partner_id"
      placeholder="Partner..."
      widget="m2o_info"
      options="{'info_method': 'helper_many2one_info'}"/>

Also, you can use simple helper function on python side to compute field info. With this function, example above could be rewritten as:

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'
        ])

This module is part of the Bureaucrat ITSM project. You can try it by the references below.

Launch your own ITSM system in 60 seconds:

Create your own Bureaucrat ITSM database

badge3

Bug Tracker

Bugs are tracked on https://crnd.pro/requests. In case of trouble, please report there.

Maintainer

https://crnd.pro/web/image/3699/300x140/crnd.png

Our web site: https://crnd.pro/

This module is maintained by the Center of Research & Development company.

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.

For any questions contact us.