This question has been flagged

How can i remove create Edit , search more from all many 2 one fields that exists in a view/all Over odoo .

We can remove single create edit ,search from single fields by passing options in xml <field name='field_name' options="{'no_create_edit': True}" />.Is there any way we can remove from whole view/all over odoo.

Avatar
Discard

You can use widget=selection also, by default there is no such option. Maybe some custom app can help on it

Best Answer

check the below module:-

https://apps.openerp.com/apps/modules/11.0/web_m2x_options/

To add these parameters go to Configuration -> Technical -> Parameters -> System Parameters and add new parameters like:

  • web_m2x_options.create: False
  • web_m2x_options.create_edit: False
  • web_m2x_options.limit: 10
Avatar
Discard

Thank you very much. It's working just as expected.

I didn't tried on other versions, but on Odoo 12 it seems system parameters above should added before install module. I added parameters after installed module. Then it does not worked. I uninstalled module and reinstalled then it worked. Thank you very much. It's working just as expected.

Best Answer

You can set the field to selection field by adding widget="selection" to the field attribute(s)

e.g <field name="many2one_field_id" widget="selection" />

or a better approach that O prefer, set no_create and no_edit option on the field.

 <field name="many2one_field_id" options="{'no_create': True, 'no_create_edit':True}" />

Avatar
Discard