Skip to Content
Menu
This question has been flagged

Hi, i try to work the many2many_tags widget 

I've got a custom form, with selection .

I do foreach loop in order to list my users into the selection but i want to put few values in the input, like the widget does. 

template.xml : 


<?xml version="1.0" encoding="utf-8"?>

<odoo>
<data>
<record id="marchepublic_form" model="ir.ui.view">

<!-- Formulaire pour déposer une nouvelle annonce -->

<field name="model">coopaname_helpdesk.post_form_ticket</field>
<field name="inherit_id" ref="coopaname_helpdesk.marchepublic" />
<field name="key">coopaname_helpdesk.marchepublic_form</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//div" position="after">
<div id="wrap" class="oe_structure oe_empty ">
<form action="/coopaname_helpdesk/post_form_ticket/" method="post" class=" o_form_field s_website_form form-horizontal container-fluid mt32"
enctype="multipart/form-data" data-model_name="monmarchepublic" data-success_page="/coopaname_helpdesk/succes/">

<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"/>
</option>
</t>
</select>
</div>
</div>

Can someone help me please ? 

Regards

Avatar
Discard

widget won't work in front end templates. It only works in the default odoo views...

Related Posts Replies Views Activity
1
Nov 19
3891
1
Jun 19
4870
0
Jul 18
4900
4
Apr 23
22500
2
Jan 23
2863