Odoo Help


How to hide/invisible one of the print reports under Print Button depending conditions

Praveen Upadhyaya
on 5/19/14, 8:05 AM 1,903 views

I have generated two reports using two different rml  files for same class under the same Print button, i want to hide one of them based of the value in a field in the form

Please help me I am trying to do this but not working 

class esteem_wps_report(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(esteem_wps_report, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({'time': time})

class esteem_wps_report_9595(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(esteem_wps_report_9595, self).__init__(cr, uid, name, context=context)
        self.localcontext.update({'time': time})

def test_report(self, cr, uid, ids, context=None):
    wps = self.pool.get("esteem_wps")
    for id in ids:
        val = wps.browse(cr, uid, id).select_wp
        if (val == "qw_482"):
            report_sxw.report_sxw('report.esteem_wps_report', 'esteem_wps','addons/esteem_wps/report/wps_report.rml',parser=esteem_wps_report)
            report_sxw.report_sxw('report.esteem_wps_report_9595', 'esteem_wps','addons/esteem_wps/report/wps_report_9595.rml',parser=esteem_wps_report_9595)

On 1/27/17, 6:29 PM

hi Praven did you find the solution ? i have the same issue 

Did you find the solution? Same issue here

Baintex Technologies S.L.
on 4/18/17, 5:50 AM

hi in fact i find a solution is not as i wished but for me it was good.. so i just put the content of each "report" in div related to field in my form views with condition in way that if the field is true or exist i will show th div related with this field ... if u want more explain let me know

on 4/18/17, 6:12 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/19/14, 8:05 AM
Seen: 1903 times
Last updated: 1/27/17, 6:29 PM