Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4851 Lượt xem

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)
        

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

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 !

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 21
2789
1
thg 3 18
7024
0
thg 3 15
3474
3
thg 1 25
3839
0
thg 10 24
1686