I want to override the report_download method in the addons/report/controllers/main.py file. but I do not know how to inherit the ReportController(Controller) class. I understand that inheriting a controller is not the same as the other classes. Can anyone please help me out?
 
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- 프로젝트
- MRP
신고된 질문입니다
I would suggest to do this:
from openerp import http
from openerp.http import request
import openerp.addons.report.controllers.main as main
class Extension(main.ReportController):
    @route(['/report/download'], type='http', auth="user")
    def report_download(self, data, token):
        do_what_you_need_to_do()
        return super(Extension, self).report_download(data, token)
Yup, this would be a cleaner way to do it. Thanks Gael.
Ok got it.
from openerp.addons import report
class ReportControllerDerived(report.controllers.main.ReportController):
@route(['/report/download'], type='http', auth="user")
def report_download(self, data, token):
///remaining code
I had not referenced the base class correctly earlier
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|  | 0 9월 16  | 4157 | ||
|  | 3 11월 21  | 8705 | ||
|  | 1 3월 19  | 7486 | ||
|  | 5 6월 17  | 9762 | ||
|  | 5 11월 16  | 7689 | 
