Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Create and Edit... from many2one field.?

Please advice me How to remove "Create and Edit..." from many2one field.? that item shows below in the many2one fields which I filtered with domain option.

OpenERP version 7

like image 919
Anne Mary Avatar asked Mar 26 '13 05:03

Anne Mary


4 Answers

Many2one widget (default)

Options : Other possible options you can use with this widget.

  • no_quick_create - It will remove Create "entered text" option.
  • no_create_edit - It will remove Create and edit... option.
  • no_create - no_quick_create and no_create_edit combined.
  • no_open - in read mode: do not render as a link.

Example:

<field name="field_name" options="{'no_quick_create': True, 'no_create_edit' : True}"/>

You can refer it from Ludwik Trammer's post

like image 101
Emipro Technologies Pvt. Ltd. Avatar answered Nov 15 '22 19:11

Emipro Technologies Pvt. Ltd.


I don't have much idea. Maybe for that you have to make changes in web addons.

But an alternative solution is that you can make that many2one field selection. Add widget="selection" attribute in your xml.

<field name="Your_many2one_field" widget="selection">

like image 37
Sudhir Arya Avatar answered Nov 15 '22 19:11

Sudhir Arya


It is tested in openerp v7.0 , in which we can remove 'create and edit' by downloading a module present at,

https://www.odoo.com/apps/7.0/web_m2x_options/#access_token=31af017545174c1eb6745fa70c9b6684&scope=userinfo&state=&expires_in=3600&token_type=Bearer

and adding attribute 'create':false, 'create_edit': false like this

    <field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>

A nice tutorial about this is given here https://www.odoo.com/apps/7.0/web_m2x_options/

like image 6
shruti Avatar answered Nov 15 '22 19:11

shruti


For Odoo 8.0 and 9.0, you should use no_create and no_open.

no_create: Set to True to disable the option the create a new entry inside the drop down list.

no_open: Set to True to disable the button to the right of the drop down list which popup a windows allowing to edit the selected instance.

<field name="field_name"  options="{'no_create': True, 'no_open': True}" />
like image 5
Justin Lessard Avatar answered Nov 15 '22 18:11

Justin Lessard