Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
9928 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 22
11597
1
sept 21
5603
3
ene 20
6769
5
sept 19
6238
2
feb 25
5777