Odoo Help


print pos receipt

ramy mabrouk
on 7/22/15, 12:08 PM 1,289 views


i am using this function to print a pos receipt in my costume module but it shows nothing, no errors or pdf files  

def print_report(self):
cr, uid, context = self.env.args
pos_ids = self.pool.get('pos.order').search(cr, uid,[('id', '=', self.pos_order.id)], context=context)
datas = {
'ids': pos_ids,
'from': self.pos_order.read()[0],
print pos_ids
print datas
# print data['form']
        ret_val = self.env['report'].get_action(self.pos_order, 'point_of_sale.report_receipt', data=datas)
        return ret_val

ramy mabrouk
On 7/26/15, 6:45 PM

afer a lot of searches i found that changing the function to the below is calling the report but it does not call the report parser class which raises function not found error

def print_report(self):
report_obj = self.env['report']
report = report_obj._get_report_from_name('point_of_sale.report_receipt')
docargs = {
'doc_ids': self.pos_order.id,
'doc_model': report.model,
'docs': self.pos_order,
return report_obj.render('point_of_sale.report_receipt', docargs)

now the question is how to include the report parser class in this call ?

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: 7/22/15, 12:08 PM
Seen: 1289 times
Last updated: 7/26/15, 7:54 PM