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 call report action from method or inside method

By
Sandeep
on 5/17/13, 8:00 AM 4,530 views

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

2

Omal Bastin

--Omal Bastin--
1146
| 6 6 8
Kochi, Kerala, India
--Omal Bastin--

Swiming deep into openERP/ODOO

Omal Bastin
On 5/17/13, 8:14 AM

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....:):)

Sandeep
on 5/17/13, 11:53 AM
0
FEDERICO LEONI
On 4/27/15, 4:15 PM

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? 

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

0 follower(s)

Stats

Asked: 5/17/13, 8:00 AM
Seen: 4530 times
Last updated: 9/18/15, 3:58 PM