From 420c19ef782171b5901231e8f0d6c9bd9f1ad72a Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 3 Aug 2009 20:47:56 +0530 Subject: [PATCH] [FIX] Print screen now displays the report as per WYSIWYG lp bug: https://launchpad.net/bugs/407637 fixed bzr revid: jvo@tinyerp.com-20090803151756-1itra28fx5p5pwn1 --- bin/report/printscreen/ps_list.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index b78a98a98a5..7ec98c1a0ab 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -72,7 +72,16 @@ class report_printscreen_list(report_int): result = model.fields_view_get(cr, uid, view_type='tree', context=context) fields_order = self._parse_string(result['arch']) - rows = model.read(cr, uid, datas['ids'], result['fields'].keys(), context ) + rows = model.read(cr, uid, datas['ids'], result['fields'].keys(), context) + ids2 = [x['id'] for x in rows] # getting the ids from read result + + if datas['ids'] != ids2: # sorted ids were not taken into consideration for print screen + rows_new = [] + for id in datas['ids']: + element = [elem for elem in rows if elem['id']==id] + rows_new.append(element[0]) + rows = rows_new + res = self._create_table(uid, datas['ids'], result['fields'], fields_order, rows, context, model_desc) return (self.obj.get(), 'pdf')