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.

0

how to get log of reports being printed ?

By
harsh jain
on 6/1/14, 7:44 AM 579 views

i am trying to override the report.report_sxw.create() method to get the ids,context to know which report is being printed, but i am not being able to do so.

this is my code :


from openerp.report import report_sxw

class log_mod_1(report_sxw.report_sxw):
    
    def __init__(self,name, table, rml=False, parser=report_sxw.rml_parse, header='external', store=False):
        super(log_mod_1,self).__init__(name, table, rml=False, parser=report_sxw.rml_parse, header='external', store=False)
        
    
    def create(self, cr, uid, ids, data, context):
        print("context {} \n uid {} \n new".format(context,uid))
        return super(log_mod_1,self).create(cr,uid,ids,data,context=context)
        

thanks it helps , but i want to automate it so tht even if a new module is installed the log of printed reports is maintained , and one doesn't have to edit the 'save as attachment prefix' everytime

harsh jain
on 6/2/14, 10:13 PM
0
Mind And Go
On 6/2/14, 6:02 PM

Hy,

I think you could do this a better way. As reports could be stored in OpenERP, configure you document management so that your report will be store. Thnaks to this you'll be able to log the reports without changing any code !

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: 6/1/14, 7:44 AM
Seen: 579 times
Last updated: 3/16/15, 8:10 AM