Hey all how can we call a report action from a method of that particular object.......
for now we can call a report action from a button ( type is action )
but i want from button but (type is object )
thats i want
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hey all how can we call a report action from a method of that particular object.......
for now we can call a report action from a button ( type is action )
but i want from button but (type is object )
thats i want
Thanks
Your button function should return a dictionary with having type as 'ir.actions.report.xml' report_name as the name of the report and datas as the data of the current record. Following is an example
def check_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
datas = {
'ids': context.get('active_ids',[]),
'model': 'account.analytic.account',
'form': data
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.analytic.account.balance',
'datas': datas,
}
great answer....:):)
I can't make it work on Odoo 8.
I can write on a record, but I was unable to replicate with automated actions the button press to automatically create a pos order report. Could you gently help me Omal?
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký