Odoo Help

3

Remove CREATE AND EDIT when populating many2many fields?

By
jamesbale
on 6/21/13, 4:57 AM 11,149 views

how to remove option create and edit from many2many fields? For example In the sale order line or invoice lines, there is tax ids, which is a many2many field using the widget='many2many_tags', I want to remove the create and edit form here. But need to create taxes from its tree and form view.

9
Maxim Litnitskiy
On 11/10/14, 3:03 PM

To disable creation / edition of tags in many2many_tags widget pass options dictionary with either no_create or no_create_edit set.

Example:

<field name='subscribers' options="{'no_create_edit': True}" widget='many2many_tags' />

Someone should accept this answer, as it is the right one now.

PY
on 11/12/15, 5:32 AM
1
Alexander
On 6/21/13, 5:19 AM

If you want to do it by view overriding, you can use xpath.

For example:

        <xpath expr="//tree[@string='Your Tree Name']" position="attributes">
            <attribute name="create">0</attribute>
                <attribute name="create">0</attribute>
                <attribute name="delete">0</attribute>
                <attribute name="edit">0</attribute>
        </xpath>

hello by doing as you describe it stop creation from tree view, i want stop creation and edit from population of m2m field.

jamesbale
on 6/21/13, 10:27 AM

What widget was used for displaying m2m field in your case?

Alexander
on 6/21/13, 11:18 AM

widget="many2many_tags"

jamesbale
on 6/25/13, 4:56 AM
0
Daniela Scarpa
On 11/15/17, 9:01 AM

This worked for me in V7:
options="{'create_edit':False}"

0
Ankit H Gandhi(AHG)
On 5/25/17, 7:04 AM

Please use below code.

<attribute name="options">{'no_create_edit': True, 'no_create':True, 'no_open':True}</attribute>

I hope this help you.

Best Thanks,

Ankit H Gandhi.

0
Umesh Choudhari
On 3/7/16, 5:56 AM

options="{'no_create':True}"

0
Jeudy Nicolas
On 11/15/13, 3:55 PM

hello,

I just update web_m2o_enhanced module to support many2manytags widget.

You can check and use it:

Github repository

For comment and description of how to user, you can read This help question

0
Wiebe de Roos
On 12/2/13, 3:58 AM

Nicolas,

Thank you very much. I already used yr module for o2m and I just needed it for many2many as well ;-)

Merci!

Wiebe

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 6/21/13, 4:57 AM
Seen: 11149 times
Last updated: 11/15/17, 9:01 AM