Package: odoo-addon-web-m2x-options
This modules modifies “many2one” and “many2manytags” form widgets so as to add some new display
control options.Options provided includes possibility to remove “Create…” and/or “Create and
Edit…” entries from many2one drop down. You can also change default number of
proposition appearing in the drop-down. Or prevent the dialog box poping in
case of validation error.If not specified, the module will avoid proposing any of the create options
if the current user has no permission rights to create the related object.Table of contentsUsagein the field’s options dictir.config_parameter optionsExampleKnown issues / RoadmapBug TrackerCreditsAuthorsContributorsOther creditsMaintainersUsagein the field’s options dictcreateboolean(Default: depends if user have create rights)Whether to display the “Create…” entry in dropdown panel.create_editboolean(Default: depends if user have create rights)Whether to display “Create and Edit…” entry in dropdown panelm2o_dialogboolean(Default: depends if user have create rights)Whether to display the many2one dialog in case of validation error.limitint(Default: openerp default value is7)Number of displayed record in drop-down panelsearch_morebooleanUsed to force disable/enable search more button.field_colorstringA string to define the field used to define color.
This option has to be used with colors.colorsdictionaryA dictionary to link field value with a HTML color.
This option has to be used with field_color.no_open_editboolean(Default: value ofno_openwhich isFalseif not set)Causes a many2one not to offer to click through in edit mode, but well in read modeopenboolean(Default:False)Makes many2many_tags and one2many rows buttons that open the linked resourceno_color_pickerboolean(Default:False)Deactivates the color picker on many2many_tags buttons to do nothing (ignored if open is set)ir.config_parameter optionsNow you can disable “Create…” and “Create and Edit…” entry for all widgets in the odoo instance.
If you disable one option, you can enable it for particular field by setting “create: True” option directly on the field definition.web_m2x_options.createboolean(Default: depends if user have create rights)Whether to display the “Create…” entry in dropdown panel for all fields in the odoo instance.web_m2x_options.create_editboolean(Default: depends if user have create rights)Whether to display “Create and Edit…” entry in dropdown panel for all fields in the odoo instance.web_m2x_options.m2o_dialogboolean(Default: depends if user have create rights)Whether to display the many2one dialog in case of validation error for all fields in the odoo instance.web_m2x_options.limitint(Default: openerp default value is7)Number of displayed record in drop-down panel for all fields in the odoo instanceweb_m2x_options.search_moreboolean(Default: default value isFalse)Whether the field should always show “Search more…” entry or not.web_m2x_options.field_limit_entriesintNumber of displayed lines on all One2many fieldsTo add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like:web_m2x_options.create: Falseweb_m2x_options.create_edit: Falseweb_m2x_options.m2o_dialog: Falseweb_m2x_options.limit: 10web_m2x_options.search_more: Trueweb_m2x_options.field_limit_entries: 5ExampleYour XML form view definition could contain:...
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more':true 'field_color':'state', 'colors':{'active':'green'}}"/>
...Known issues / RoadmapDouble check that you have no inherited view that removeoptionsyou set on a field !
If nothing works, add a debugger in the first line of_search methodand enable debug mode in Odoo. When you write something in a many2one field, javascript debugger should pause. If not verify your installation.Instead of making the tags rectangle clickable, I think it’s better to put the text as a clickable link, so we will get a consistent behaviour/aspect with other clickable elements (many2one…).In edit mode, it would be great to add an icon like the one on many2one fields to allow to open the many2many in a popup window.Include this feature as a configurable option via parameter to have this behaviour by default in all many2many tags.Bug TrackerBugs are tracked onGitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomedfeedback.Do not contact contributors directly about support or help with technical issues.CreditsAuthorsinitOS GmbHACSONE SA/NV0k.ioTecnativaContributorsDavid Coninckx <davconinckx@gmail.com>Emanuel Cino <ecino@compassion.ch>Holger Brunn <hbrunn@therp.nl>Nicolas JEUDY <nicolas@sudokeys.com>Yannick Vaucher <yannick.vaucher@camptocamp.com>Zakaria Makrelouf <z.makrelouf@gmail.com>Tecnativa:Jairo Llopis <jairo.llopis@tecnativa.com>David Vidal <david.vidal@tecnativa.com>Ernesto Tejeda <ernesto.tejeda87@gmail.com>Carlos RocaBhavesh Odedra <bodedra@opensourceintegrators.com>Dhara Solanki <dhara.solanki@initos.com> (http://www.initos.com)Trobz:Hoang Diep <hoang@trobz.com>Other creditsThe migration of this module from 15.0 to 16.0 was financially supported by CamptocampMaintainersThis module is maintained by the OCA.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.This module is part of theOCA/webproject on GitHub.You are welcome to contribute. To learn how please visithttps://odoo-community.org/page/Contribute.