Skip to Content
Menu
This question has been flagged
2 Replies
3645 Views

Hello, 

how can i display in a QWEB field one2many.

for example :

************************

class traceur(models.Model):

    _name = 'contrat_traceur'

    _inherit = ['mail.thread', 'ir.needaction_mixin']

     

    

    name=fields.Char(string='IMEI',required=True,primary_key=True,track_visibility='onchange')

    num_appel=fields.Char(string="Numero Appel",required=True,primary_key=True,track_visibility='onchange')

    reference_tt=fields.Char(string='Reference TT',track_visibility='onchange')

    activation_tt_date=fields.Date(string='Date Activation TT',track_visibility='onchange')

    application=fields.Char(string='Application',track_visibility='onchange')

    activation_client_date=fields.Date(string='Date Activation Client',track_visibility='onchange')

    partner_id= fields.Many2one('res.partner', 'Redevable a',track_visibility='onchange')

    contract_id=fields.Many2one('account.analytic.account','Contrat',track_visibility='onchange')

    traceur_id=fields.Many2one('contrat_traceur','traceur',track_visibility='onchange')

  

traceur()

******************
class account_analytic_account(osv.osv):
    _inherit = "account.analytic.account"

    _columns = {
        'traceur_ids': fields.one2many('contrat_traceur', 'contract_id', 'Traceurs'),
         
    }
************************
 plz i can print name, num_appel from a field one2many and how ??

Avatar
Discard
Best Answer

Hi,

try to use 'foreach' in your xml, e.g. to show a list:

<ol>
<t t-foreach="object.traceur_ids" t-as="traceur">
<li>
<t t-esc="traceur.name"/>, <t t-esc="traceur.num_appel"/>
</li>
</t>
</ol>
Avatar
Discard
Author Best Answer

I'm sorry, as usual empty fields :(

Avatar
Discard