Odoo Help


RML report display problem?

Alec Mouti
on 8/5/14, 12:23 PM 1,201 views

I have a get_hivaids() method which gives (results) a list of values. I want to display individual values(items) from the list across my report. My get_hivaids() method looks like this;

    def get_hivaids(self,date_start,date_end):
         self.cr.execute("select sum(hiv_consultation::int) as hiv_consultation, sum(pre_test_counselling::int) as pre_test_counselling, \
                   sum(rapid_test::int) as rapid_test, sum(post_test_counselling::int) as post_test_counselling, \
                   sum(post_test_counselling::int) as post_test_counselling, sum(risk_reduction::int) as risk_reduction, \
                   sum(arv::int) as arv, sum(oi::int) as oi, sum(cd4::int) as cd4, sum(viral_load::int) as viral_load, \
                   sum(prophylaxis::int) as prophylaxis, sum(sampling_procedure::int) as sampling_procedure \
                   from emr_client_hivaids as ech inner join emr_client as ec on ech.client_id=ec.id where ec.sex = 'm' \
                   and ech.date_serviced >= %s and ech.date_serviced <= %s  "\
        return res2

This is the RML code: 

[[get_hivaids(data['form']['date_start'],data['form']['date_end']) ]]

I get the following result in my report:

[  {'risk_reduction': 0L,   'oi': 1L,   'arv':1L, 'prophylaxis': 0L,  'rapid_test': 0L,  'post_test_counselling': 1L,  'cd4': 0L,
'sampling_procedure': 1L,  'pre_test_counselling': 0L,  'viral_load': 1L, 'hiv_consultation':1L}]  ]

How do I get individual results from the list?



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: 8/5/14, 12:23 PM
Seen: 1201 times
Last updated: 3/16/15, 8:10 AM