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

Hi,

I try to insert the widget manay2many_tags on my form but not working. 


This is my template : 
<div class="form-group form-field">
<div class="col-md-3 col-sm-4 text-right">
<label class="control-label" for="x_membre_interne" >
Membres de l'équipe INTERNE Coopaname</label>
</div>
<div class="col-md-7 col-sm-8 ">
<select id="membre_interne" name="x_membre_interne" widget='many2many_tags' class="form-control " >
<option value="" >Sélectionnez...</option>
<t t-foreach="users" t-as="user" >

<option t-att-name="x_membre_interne" t-att-value="user.login" >
<t t-esc="user.login" widget="many2many_tags"/>
</option>
</t>
</select>
</div>
</div>


Please help me my friends 
Avatar
Descartar
Mejor respuesta

 The 'widget' attribute is applied to the '<field/>' tags, which are used in the Odoo backend. It is in useless in the frontend (website pages, forms, and so on).

Also you can't use selection input, since it can't allow multi selection. Instead of that you should introduce input type text and certain JavaScript to process it.

For the example look at the module 'website_forum': https://github.com/odoo/odoo/blob/12.0/addons/website_forum/static/src/js/website_forum.js

Pay especial attention to the selector 'js_select2' in the XML and JS.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
jun 19
4122
0
jun 19
3382
0
ago 25
2609
0
abr 19
4005
2
sept 18
6045