تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5611 أدوات العرض

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 
الصورة الرمزية
إهمال
أفضل إجابة

 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.


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 19
4041
0
يونيو 19
3330
0
سبتمبر 23
2497
0
أبريل 19
3902
2
سبتمبر 18
5900