Skip to Content
Menu
This question has been flagged

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
Discard
Best Answer

 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
Discard
Related Posts Replies Views Activity
0
Jun 19
3272
0
Jun 19
2634
0
Sep 23
1457
0
Apr 19
3250
2
Sep 18
4782