Skip to content

Instantly share code, notes, and snippets.

@ovnicraft
Created June 17, 2013 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ovnicraft/5794893 to your computer and use it in GitHub Desktop.
Save ovnicraft/5794893 to your computer and use it in GitHub Desktop.
class FileNameReports(Reports):
# _cp_path = 'web/report'
def get_filename_report(self, action, report_struct):
filename = '%s %s.%s' %(action['name'], time.strftime('%Y-%m-%d %H%M%S'), report_struct['format'])
return filename
@openerpweb.httprequest
def index(self, req, action, token):
res = super(FileNameReports, self).index(req, action, token)
#here i can hack response
return res
#####################
2013-06-17 05:53:02,471 1145 ERROR ? openerp.addons.web.common.http.HttpRequest.dispatch: An error occurred while handling a json request
Traceback (most recent call last):
File "/home/ovnicraft/dev/openerp/61/web/addons/web/common/http.py", line 260, in dispatch
r = method(controller, self, **self.params)
File "/home/ovnicraft/dev/openerp/61/web-addons-report-name/web_report_name/controllers.py", line 19, in index
res = super(FileNameReports, self).index(req, action, token)
TypeError: http_handler() takes exactly 3 arguments (4 given)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment