Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

how to display x2many field in qweb?

By
Abdullah Sofan
on 12/14/14, 11:49 PM 1,178 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()

 

@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/

Luke Branch
on 12/15/14, 12:08 AM

@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.

Abdullah Sofan
on 12/15/14, 12:17 AM
1
Abdullah Sofan
On 12/15/14, 12:39 AM

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

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

@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.

Luke Branch
on 12/15/14, 1:09 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 12/14/14, 11:49 PM
Seen: 1178 times
Last updated: 3/16/15, 8:10 AM