Merge lp:~arthru/openupgrade-server/analysis-file-for-no-change into lp:openupgrade-server

Proposed by arthru
Status: Merged
Merged at revision: 4619
Proposed branch: lp:~arthru/openupgrade-server/analysis-file-for-no-change
Merge into: lp:openupgrade-server
Diff against target: 36 lines (+5/-3)
1 file modified
openerp/addons/openupgrade_records/model/analysis_wizard.py (+5/-3)
To merge this branch: bzr merge lp:~arthru/openupgrade-server/analysis-file-for-no-change
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Review via email: mp+174234@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/addons/openupgrade_records/model/analysis_wizard.py'
--- openerp/addons/openupgrade_records/model/analysis_wizard.py 2012-11-24 22:32:46 +0000
+++ openerp/addons/openupgrade_records/model/analysis_wizard.py 2013-07-11 16:05:33 +0000
@@ -94,6 +94,7 @@
94 # Retrieve field representations and compare94 # Retrieve field representations and compare
95 remote_records = remote_record_obj.field_dump(context)95 remote_records = remote_record_obj.field_dump(context)
96 local_records = local_record_obj.field_dump(cr, uid, context)96 local_records = local_record_obj.field_dump(cr, uid, context)
97 modules_record = set([record['module'] for record in remote_records + local_records])
97 res = compare.compare_sets(remote_records, local_records)98 res = compare.compare_sets(remote_records, local_records)
9899
99 # Retrieve xml id representations and compare100 # Retrieve xml id representations and compare
@@ -112,13 +113,12 @@
112 for x in remote_record_obj.read(113 for x in remote_record_obj.read(
113 remote_xml_record_ids, fields)114 remote_xml_record_ids, fields)
114 ]115 ]
116 modules_xml_records = set([record['module'] for record in remote_xml_records + local_xml_records])
115 res_xml = compare.compare_xml_sets(117 res_xml = compare.compare_xml_sets(
116 remote_xml_records, local_xml_records)118 remote_xml_records, local_xml_records)
117119
118 # reorder and output the result120 # reorder and output the result
119 keys = list(set(res.keys() + res_xml.keys()))121 keys = ['general'] + list(modules_record & modules_xml_records)
120 keys.remove('general')
121 keys = ['general'] + keys
122 module_obj = self.pool.get('ir.module.module')122 module_obj = self.pool.get('ir.module.module')
123 module_ids = module_obj.search(123 module_ids = module_obj.search(
124 cr, uid, [('state', '=', 'installed')])124 cr, uid, [('state', '=', 'installed')])
@@ -134,6 +134,8 @@
134 contents += '\n'.join([unicode(line) for line in sorted(res_xml[key])])134 contents += '\n'.join([unicode(line) for line in sorted(res_xml[key])])
135 if res_xml[key]:135 if res_xml[key]:
136 contents += '\n'136 contents += '\n'
137 if key not in res and key not in res_xml:
138 contents += '-- nothing has changed in this module'
137 if key == 'general':139 if key == 'general':
138 general += contents140 general += contents
139 continue141 continue

Subscribers

People subscribed via source and target branches