Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

How hide in m2o widget "Create and Edit..." line?

By
Vasiliy Birukov
on 2/21/13, 6:46 AM 3,279 views

Is there any option like:

options='{"no_open": True}'

but for hide "Create and Edit..." line?

2

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 6/20/13, 8:55 AM

you can make the widget = selection

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

good answer.

Borni DHIFI
on 6/20/13, 10:19 AM

It's sutable if small amount of records, but I have many records and need Search More... functionality.

Vasiliy Birukov
on 6/21/13, 2:40 AM

Hi, wowas... you can remove create and edit from (V.7) addons/web/static/src/js view_form.js , just comment the lines from 2939 to 2945, then create and edit will disappear. but it'll be for all of you modules..!

Ahmed M.Elmubarak
on 6/22/13, 9:57 AM

Maybe the 'base_optional_quick_create' module can be useful too: https://code.launchpad.net/~elbati/server-env-tools/adding_base_optional_quick_create_7 . This module allows to avoid to 'quick create' new records, through many2one fields, for a specific model. You can configure which models should allow 'quick create'. When specified, the 'quick create' option will always open the standard create form.

eLBati
on 6/23/13, 5:19 AM
0

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 6/20/13, 7:48 PM

simple use tags create and delete in your xml file

syntax:

<field name="field_name" create="false" delete="false"/>

It don't work for many2one.

Vasiliy Birukov
on 6/21/13, 2:54 AM
0

Daniel Reis

--Daniel Reis--
3436
| 6 7 9
Lisbon, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt


Daniel Reis
On 2/21/13, 7:04 AM

You could make it make it read-only, but that wouldn't allow you to edit lines:

<field name="myfield" readonly="1"/>

If you want it to be editable, but not able to add lines, the closest thing it to change the Access Rights on the related table so that the user has Write Access but no Create Access.

Need have Full Access for related table, because this field in the same object for choose parent instance. But need restrict create parent instance because it does not make sense (in my context).

Vasiliy Birukov
on 2/22/13, 12:29 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 2/21/13, 6:46 AM
Seen: 3279 times
Last updated: 3/27/15, 5:31 PM