This question has been flagged
1 Reply
4960 Views

how can I display x2many (especially one2many) field in qweb? How can I use domain paramaters within qweb? 

 

Edit: More info 


I have this class of course batches with the one2many field batch_registrations. I want to be able to display the current registrations of the batch in a qweb report.

 

class intrac_batches(osv.osv):
        
    _name = 'intrac.batches'
    _columns = {
        'name': fields.char('Batch Number'),
        'batch_course_name': fields.many2one('intrac.courses', 'Course'),
        'batch_registrations': fields.one2many('intrac.batches.registrations', 'batch_number', 'Registrations'),
    }
intrac_batches()

 

Avatar
Discard

@Abdullah, Could you provide some more information regarding what you would like to achieve? Regardless you may find the information you need here: https://www.odoo.com/documentation/8.0/

Author

@Luke I edited my original question. I did look in the documentation for this specific topic but didn't find it. Please direct me if you can to the segment in the documentation where it shows how to display one2many fields in QWEB.

Author Best Answer

I figured it out thanks to this article from Empiro Technologies:

http://blog.emiprotechnologies.com/create-qweb-report-odoo/

Avatar
Discard

@Abdullah, good to know you have figured it out. I have recently figured out how to used t-foreach and t-as for qweb loops to display the output of a list of fields from one2many type relationships in this module: https://github.com/OdooCommunityWidgets/website_multi_image so I thought I may be able to offer some help. Do you know how to import into a one2many relationship? I've just recently posed the question to the forum here: https://www.odoo.com/forum/help-1/question/8-0-master-what-is-the-best-method-to-import-from-csv-into-a-one2many-relationship-70454 as this is the next step I need to figure out in order to make my module more user-friendly and usable for those who require import/export-compatible multiple product images on their website.