← Back to team overview

credativ team mailing list archive

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

 

arthru has proposed merging lp:~arthru/openupgrade-server/analysis-file-for-no-change into lp:openupgrade-server.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)

For more details, see:
https://code.launchpad.net/~arthru/openupgrade-server/analysis-file-for-no-change/+merge/174234
-- 
https://code.launchpad.net/~arthru/openupgrade-server/analysis-file-for-no-change/+merge/174234
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~arthru/openupgrade-server/analysis-file-for-no-change into lp:openupgrade-server.
=== 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 @@
         # Retrieve field representations and compare
         remote_records = remote_record_obj.field_dump(context)
         local_records = local_record_obj.field_dump(cr, uid, context)
+        modules_record = set([record['module'] for record in remote_records + local_records])
         res = compare.compare_sets(remote_records, local_records)
 
         # Retrieve xml id representations and compare
@@ -112,13 +113,12 @@
             for x in remote_record_obj.read(
                 remote_xml_record_ids, fields)
             ]
+        modules_xml_records = set([record['module'] for record in remote_xml_records + local_xml_records])
         res_xml = compare.compare_xml_sets(
             remote_xml_records, local_xml_records)
 
         # reorder and output the result
-        keys = list(set(res.keys() + res_xml.keys()))
-        keys.remove('general')
-        keys = ['general'] + keys
+        keys = ['general'] + list(modules_record & modules_xml_records)
         module_obj = self.pool.get('ir.module.module')
         module_ids = module_obj.search(
             cr, uid, [('state', '=', 'installed')])
@@ -134,6 +134,8 @@
                 contents += '\n'.join([unicode(line) for line in sorted(res_xml[key])])
                 if res_xml[key]:
                     contents += '\n'
+            if key not in res and key not in res_xml:
+                contents += '-- nothing has changed in this module'
             if key == 'general':
                 general += contents
                 continue


Follow ups