Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
9591 Vistas

Currently if I change m2m widget to checkboxes, it will show all the possible values in a single column. Is there a way to show them in 2+ columns?

e.g. Normaly they are shown:

 

Tag 1
Tag 2
Tag 3
Tag 4

and I would like them to show 

Tag 1
Tag 3
Tag 2
Tag 4

or 

Tag 1
Tag 2
Tag 3
Tag 4

The order of the Tags doesn't really matter.

Avatar
Descartar
Mejor respuesta

Hello Anti Nuga,

     here is the way to change look of many2many_checkboxes widget's view from single column to two-column.


You have to change single line in xml file of web module.

    path: web >> static >> src >> xml >> base.xml

     

<t t-name="FieldMany2ManyCheckBoxes">
    <t t-foreach="widget.get('records')" t-as="record">
        <div>
......

to
 
<t t-name="FieldMany2ManyCheckBoxes">
    <t t-foreach="widget.get('records')" t-as="record">
        <div class="col-xs-6">

 

Hope this will help you, Thanks!

Avatar
Descartar
Mejor respuesta

Hi Anti,

I think there is no ready widget available for the solution which you are looking for.

You can develop your own widget to achieve this thing.

Inside the user form the access right groups are filtered and grouped in checkbox, that example may help you to develop your own widget for Many2many field.

If you develop that new widget than don't forgot to share ;)


Hope this will help.

Regards,

Anil.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jun 22
5497
1
mar 15
5460
2
ago 20
10438
1
may 19
9404
1
may 15
21536