コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4351 ビュー

I really need to make a change to JasperReports but I'm not able to inherit and override a method.

In /JasperReports/JasperServer.py or /jasper_report.py, I need to change the "execute" method.

class Report:
    def __init__(self, name, cr, uid, ids, data, context):
        etc...
        etc...

    def execute(self):


How can one do this since the class has no name for us to declare the inheritance?

アバター
破棄
最善の回答

Rui, the Report is not an osv/orm Class, but a normal Python class.  So you can use normal Python inheritance for your purpose.

アバター
破棄
著作者

Thanks. So, following an example I found, what I did was: class Report(): def __init__(self, name, cr, uid, ids, data, context): Report.__init__(self) It didn't work. Not even the init was being executed.

I can point out that your code did not perform any inheritance at all. If you inherit a class in Python, you need to include it in the class definition, e.g. class My_Report(Report): ..... Do familiarize yourself with python language and inheritance or get help from someone who does. I can't say that I'm an expert.

関連投稿 返信 ビュー 活動
1
1月 17
3630
0
3月 15
3295
0
3月 15
3806
2
3月 15
5442
1
8月 20
15493