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

Proposed by Quentin THEURET @Amaris on 2013-11-06
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 2013-11-06 Pending
Review via email: mp+194071@code.launchpad.net
To post a comment you must log in.
4724. By Quentin THEURET @Amaris on 2013-11-06

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

4725. By Quentin THEURET @Amaris on 2013-11-06

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

4726. By Quentin THEURET @Amaris on 2013-11-07

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

4727. By Quentin THEURET @Amaris on 2013-11-19

Merge latest trunk

4728. By Quentin THEURET @Amaris on 2013-11-29

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
1=== modified file 'addons/openerp/controllers/actions.py'
2--- addons/openerp/controllers/actions.py 2013-08-06 09:55:16 +0000
3+++ addons/openerp/controllers/actions.py 2013-11-29 08:20:42 +0000
4@@ -35,6 +35,7 @@
5 from tree import Tree
6 from wizard import Wizard
7 import urllib
8+import re
9
10 def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None,
11 mode='form,tree', name=None, target=None, limit=None, search_view=None,
12@@ -182,9 +183,18 @@
13 proxy = rpc.RPCProxy('ir.actions.report.xml')
14 res = proxy.search([('report_name','=', name)])
15 if res:
16- report_name = proxy.read(res[0], ['name'])['name']
17+ read_ctx = datas.copy()
18+ read_ctx.setdefault('context', {}).update(ctx)
19+ report_name = proxy.read(res[0], ['filename'], read_ctx)['filename']
20
21 report_name = report_name.replace('Print ', '')
22+
23+ if not ids or not datas.get('id') or not datas.get('model'):
24+ if datas.get('target_filename'):
25+ report_name = datas['target_filename']
26+ elif datas.get('context', {}).get('_terp_view_name'):
27+ report_name = datas['context']['_terp_view_name']
28+
29 cherrypy.response.headers['Content-Disposition'] = 'filename="' + report_name + '.' + report_type + '"'
30
31 return _print_data(val)

Subscribers

People subscribed via source and target branches

to all changes: