Skip to Content
Menu
This question has been flagged
1 Reply
8805 Views

Dear all,

I am using Odoo 12.

I have a many2one field with the selection widget added to it:

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

I also added the "no_create_edit", "no_open" and "no_quick_create" options to prevent user from creating new records (Create and Edit...), do not allow link to original record (no_open) and disable the quick create option for the many2one field.

<field name="brand_id" options="{'no_open': True, 'no_create_edit': True, 'no_quick_create': True}" widget="selection"/>

The problem I found is that the selection widget do not allow user to search on the many2one field and the records are limited to the default 80 records.

So, my question is:

- How can I search a many2one field with selection widget added to it?

What I really want to do is to prevent user from adding new records from the many2one field.

The "no_create_edit" is working by removing the "Create new..." option but is still allow to "quick create" new records.

The "no_quick_create" is not working here...

Any idea?

Thank you all in advance

Best Regards

Paulo


Avatar
Discard
Best Answer

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

And if you want the search more option to appear in the many2one field, you need to remove widget="selection"


Avatar
Discard
Author

Dear @Techneith, thank you very much for your help.

Using "no_create" solved my problem and I do not need to use "widget="selection" anymore.

I think the "no_quick_create" option is only used on later Odoo versions.

Thank you once again.

Regards

Paulo

Related Posts Replies Views Activity
1
Mar 22
10318
1
Sep 21
4725
3
Jan 20
5850
5
Sep 19
5018
3
Oct 23
5984