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
1=== modified file 'openerp/addons/openupgrade_records/model/analysis_wizard.py'
2--- openerp/addons/openupgrade_records/model/analysis_wizard.py 2012-11-24 22:32:46 +0000
3+++ openerp/addons/openupgrade_records/model/analysis_wizard.py 2013-07-11 16:05:33 +0000
4@@ -94,6 +94,7 @@
5 # Retrieve field representations and compare
6 remote_records = remote_record_obj.field_dump(context)
7 local_records = local_record_obj.field_dump(cr, uid, context)
8+ modules_record = set([record['module'] for record in remote_records + local_records])
9 res = compare.compare_sets(remote_records, local_records)
10
11 # Retrieve xml id representations and compare
12@@ -112,13 +113,12 @@
13 for x in remote_record_obj.read(
14 remote_xml_record_ids, fields)
15 ]
16+ modules_xml_records = set([record['module'] for record in remote_xml_records + local_xml_records])
17 res_xml = compare.compare_xml_sets(
18 remote_xml_records, local_xml_records)
19
20 # reorder and output the result
21- keys = list(set(res.keys() + res_xml.keys()))
22- keys.remove('general')
23- keys = ['general'] + keys
24+ keys = ['general'] + list(modules_record & modules_xml_records)
25 module_obj = self.pool.get('ir.module.module')
26 module_ids = module_obj.search(
27 cr, uid, [('state', '=', 'installed')])
28@@ -134,6 +134,8 @@
29 contents += '\n'.join([unicode(line) for line in sorted(res_xml[key])])
30 if res_xml[key]:
31 contents += '\n'
32+ if key not in res and key not in res_xml:
33+ contents += '-- nothing has changed in this module'
34 if key == 'general':
35 general += contents
36 continue

Subscribers

People subscribed via source and target branches