Hi,
I want to put many values on my selection form.
Is it possible ?
models.py:
from odoo import models, fields, api
class MonHelpdeskTicket(models.Model):
"""Champs qui compose le modele d'une offres. Ce sont principalement les champs à compléter dans le formulaire"""
_name = "monmarchepublic"
_inherit = 'res.users'
_inherit = [
'mail.thread',
'ir.needaction_mixin',
]
x_name = fields.Char('Nom et Prenom', readonly=0, website_form_blacklisted=0, Store=True )
x_objet_consultation = fields.Char('Objet de la consultation', readonly=0, website_form_blacklisted=0, Store=True)
x_membre_interne = fields.Char("Membres de l'équipe INTERNE", readonly=0, website_form_blacklisted=0, Store=True)
x_membre_externe = fields.Char(" Membres de l'équipe EXTERNE et/ou informations utiles", readonly=0, website_form_blacklisted=0, Store=True)
x_equipeok = fields.Boolean('Equipe complète', readonly=0, website_form_blacklisted=0, Store=True)
x_admin = fields.Char('Administration', readonly=0, website_form_blacklisted=0, Store=True)
x_inputstreet1 = fields.Char('N° et Rue', readonly=0, website_form_blacklisted=0, Store=True)
x_inputcity1 = fields.Char('Ville', readonly=0, website_form_blacklisted=0, Store=True)
x_inputzip1 = fields.Integer('Code Postal', readonly=0, website_form_blacklisted=0, Store=True)
x_date_order = fields.Date('Date de publication', readonly=0, website_form_blacklisted=0, Store=True)
x_type_marche = fields.Selection([("offre_ferme", "Appel d'offre Fermé"), ('offre_ouvert', "Appel d'offre Ouvert"), ('concours', 'Concours'), ('consultation', 'Consultation'), ('mapa', 'MAPA')], readonly=0, website_form_blacklisted=0, Store=True)
x_date_limite = fields.Datetime('Date et heure limites de dépot de candidature', readonly=0, website_form_blacklisted=0, Store=True)
x_duree_marche = fields.Char('Durée du marché', readonly=0, website_form_blacklisted=0, Store=True)
x_montant_marche = fields.Integer('Montant du marché', readonly=0, website_form_blacklisted=0, Store=True)
x_inputstreet2 = fields.Char('N° et Rue', readonly=0, website_form_blacklisted=0, Store=True)
x_inputcity2 = fields.Char('Ville', readonly=0, website_form_blacklisted=0, Store=True)
x_inputzip2 = fields.Integer('Code Postal', readonly=0, website_form_blacklisted=0, Store=True)
x_num_ref = fields.Char('Numéro de référence attribué au marché', readonly=0, website_form_blacklisted=0, Store=True)
x_cat = fields.Selection([("Etudes, Maitrise d oeuvre, Controle", "Etudes, Maîtrise d'oeuvre, Contrôle"), ('Travaux de batiment', 'Travaux de bâtiment'), ('Travaux Publics', 'Travaux Publics'), ('Fournitures', 'Fournitures'), ('Services', 'Services')], readonly=0, website_form_blacklisted=0, Store=True)
x_pj = fields.Binary('Pièce Jointe', readonly=0, website_form_blacklisted=0, Store=True)
x_ville_adju = fields.Char('Ville du Pouvoir Adjudicateur', readonly=0, website_form_blacklisted=0, Store=True)
x_mail = fields.Char('Email', readonly=0, website_form_blacklisted=0, Store=True)
x_etape = fields.Selection([('New', 'New'), ('CCTP', 'CCTP'), ('En cours de traitement', 'En cours de traitement'), ('Valide', 'Validé'), ('Refuse', 'Refusé'), ('Archive', 'Archivé')], readonly=0, website_form_blacklisted=0, Store=True)
message_ids = fields.One2many('mail.message', 'res_id', string="Commentaire", Store=True)
partner_ids = fields.Many2many('res.partner', string='Recipients', help="List of partners that will be added as follower of the current document.", readonly=0, website_form_blacklisted=0, Store=True)
message_partner_ids = fields.Many2many(
comodel_name='res.partner', string='Followers Test',
compute='_get_followers', search='_search_follower_partners', readonly=0, website_form_blacklisted=0, Store=True)
follower_ids = fields.One2many('mail.followers', 'res_id', string="follo", readonly=0, website_form_blacklisted=0, Store=True)
x_etiquettes = fields.Many2many('res.user', string="many2many_tags",readonly=0, website_form_blacklisted=0, Store=True)
template.xml:
<div class="col-md-7 col-sm-8 ">
<select id="membre_interne" name="x_etiquettes" 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>
Thanks, regards