Merge lp:~unifield-team/unifield-web/utp-820 into lp:unifield-web

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4725
Proposed branch: lp:~unifield-team/unifield-web/utp-820
Merge into: lp:unifield-web
Diff against target: 31 lines (+11/-1)
1 file modified
addons/openerp/controllers/actions.py (+11/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/utp-820
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+194071@code.launchpad.net
To post a comment you must log in.
4724. By Quentin THEURET @Amaris

UTP-820 [IMP] Add the first letters on report name

4725. By Quentin THEURET @Amaris

UTP-820 [IMP] Use a regex to get the first letter of a report name

4726. By Quentin THEURET @Amaris

UTP-820 [IMP] Use a parser to get the good filename

4727. By Quentin THEURET @Amaris

Merge latest trunk

4728. By Quentin THEURET @Amaris

UTP-820 [FIX] If the report has a target_filename, use the target filename

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py 2013-08-06 09:55:16 +0000
+++ addons/openerp/controllers/actions.py 2013-11-29 08:20:42 +0000
@@ -35,6 +35,7 @@
35from tree import Tree35from tree import Tree
36from wizard import Wizard36from wizard import Wizard
37import urllib37import urllib
38import re
3839
39def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None,40def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None,
40 mode='form,tree', name=None, target=None, limit=None, search_view=None,41 mode='form,tree', name=None, target=None, limit=None, search_view=None,
@@ -182,9 +183,18 @@
182 proxy = rpc.RPCProxy('ir.actions.report.xml')183 proxy = rpc.RPCProxy('ir.actions.report.xml')
183 res = proxy.search([('report_name','=', name)])184 res = proxy.search([('report_name','=', name)])
184 if res:185 if res:
185 report_name = proxy.read(res[0], ['name'])['name']186 read_ctx = datas.copy()
187 read_ctx.setdefault('context', {}).update(ctx)
188 report_name = proxy.read(res[0], ['filename'], read_ctx)['filename']
186189
187 report_name = report_name.replace('Print ', '')190 report_name = report_name.replace('Print ', '')
191
192 if not ids or not datas.get('id') or not datas.get('model'):
193 if datas.get('target_filename'):
194 report_name = datas['target_filename']
195 elif datas.get('context', {}).get('_terp_view_name'):
196 report_name = datas['context']['_terp_view_name']
197
188 cherrypy.response.headers['Content-Disposition'] = 'filename="' + report_name + '.' + report_type + '"'198 cherrypy.response.headers['Content-Disposition'] = 'filename="' + report_name + '.' + report_type + '"'
189199
190 return _print_data(val)200 return _print_data(val)

Subscribers

People subscribed via source and target branches

to all changes: