diff options
| author | Vo Minh Thu <vmt@openerp.com> | 2011-04-26 12:31:10 +0200 |
|---|---|---|
| committer | Vo Minh Thu <vmt@openerp.com> | 2011-04-26 12:31:10 +0200 |
| commit | 4c5292d799fdfd18afe86bbb9ab7ae3c46dddfa8 (patch) | |
| tree | fc40c5f248653979c7079524760957aa2eafd9e0 | |
| parent | 06202d25412cd4f29cf301fded5c0d4a4793d5ad (diff) | |
| parent | 4c65b5fbcc430dda6e246415e4629f0c5cfa4039 (diff) | |
[MERGE] merge nch fix for report window title
- the fix is based on a patch by Cristian Salamea
bzr revid: vmt@openerp.com-20110426103110-q92d4b5kxgfocsxd
| -rw-r--r-- | openerp/report/interface.py | 1 | ||||
| -rw-r--r-- | openerp/report/printscreen/ps_list.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/openerp/report/interface.py b/openerp/report/interface.py index fca5121896f..5bb1224a549 100644 --- a/openerp/report/interface.py +++ b/openerp/report/interface.py @@ -49,6 +49,7 @@ class report_int(netsvc.Service): self.name = name self.id = 0 self.name2 = '.'.join(name.split('.')[1:]) + # TODO the reports have methods with a 'title' kwarg that is redundant with this attribute self.title = None #self.joinGroup('report') self.exportMethod(self.create) diff --git a/openerp/report/printscreen/ps_list.py b/openerp/report/printscreen/ps_list.py index 851945922ab..8b0ece6eaa0 100644 --- a/openerp/report/printscreen/ps_list.py +++ b/openerp/report/printscreen/ps_list.py @@ -67,11 +67,12 @@ class report_printscreen_list(report_int): self.groupby_no_leaf = context.get('group_by_no_leaf',False) pool = pooler.get_pool(cr.dbname) model = pool.get(datas['model']) - # Title come from description of model which are specified in py file. + model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)]) model_desc = model._description + if model_id: + model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).name self.title = model_desc datas['ids'] = ids - model = pooler.get_pool(cr.dbname).get(datas['model']) result = model.fields_view_get(cr, uid, view_type='tree', context=context) fields_order = self.groupby + self._parse_string(result['arch']) if self.groupby: |
