Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
9917 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
1
mars 22
11591
1
sept. 21
5602
3
janv. 20
6765
5
sept. 19
6233
2
févr. 25
5774