Ver Fonte

[FIX]mass_editing:Fixed the issue of uninstall the module.

Vacha Trivedi há 9 anos atrás
pai
commit
8893ba5e9a

+ 3 - 0
mass_editing/ChangeLog.txt → mass_editing/Doc/ChangeLog.txt

@@ -1,6 +1,9 @@
 ===============================================================================
  Version Change Log (mass_editing)
 ===============================================================================
+1.6 * Aug 31, 2015 : Serpent Consulting Services Pvt Ltd
+    * Resolved the error of module Uninstall.
+
 1.5 * Apr 27, 2015 : Serpent Consulting Services Pvt Ltd
 	* Made the search() of ir.model.fields v8 compatible. Thanks to Jonathan Wilson of WillowIT 
 	  for the fix and Luke branch for reporting.

+ 1 - 4
mass_editing/__init__.py

@@ -19,8 +19,5 @@
 #
 ##############################################################################
 
-import mass_editing
+import models
 import wizard
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-

+ 2 - 4
mass_editing/__openerp__.py

@@ -20,7 +20,7 @@
 ##############################################################################
 {
     "name" : "Mass Editing",
-    "version" : "1.5",
+    "version" : "1.6",
     "author" : "Serpent Consulting Services Pvt. Ltd.",
     "category" : "Tools",
     "website" : "http://www.serpentcs.com",
@@ -33,11 +33,9 @@
     'depends': ['base'],
     'data': [
         "security/ir.model.access.csv",
-        'mass_editing_view.xml',
+        "views/mass_editing_view.xml",
     ],
     'installable': True,
     'application': True,
     'auto_install': False,
 }
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 22 - 0
mass_editing/models/__init__.py

@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    This module uses OpenERP, Open Source Management Solution Framework.
+#    Copyright (C) 2012-Today Serpent Consulting Services (<http://www.serpentcs.com>)
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>
+#
+##############################################################################
+
+import mass_editing

+ 15 - 6
mass_editing/mass_editing.py → mass_editing/models/mass_editing.py

@@ -25,7 +25,7 @@ from lxml import etree
 class ir_model_fields(models.Model):
     _inherit = 'ir.model.fields'
 
-    @api.returns('self') #If we keep @api.v7, we have to add @api.v8 code too.
+    @api.returns('self')  # If we keep @api.v7, we have to add @api.v8 code too.
     def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False):
         model_domain = []
         for domain in args:
@@ -46,9 +46,6 @@ class ir_model_fields(models.Model):
 #                 model_domain.append(domain)
 #         return super(ir_model_fields, self).search(model_domain, offset=offset, limit=limit, order=order, count=count)
 
-
-ir_model_fields()
-
 class mass_object(models.Model):
     _name = "mass.object"
 
@@ -137,5 +134,17 @@ class mass_object(models.Model):
         default.update({'name':'', 'field_ids': []})
         return super(mass_object, self).copy(default)
 
-mass_object()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+class ir_module_module(models.Model):
+
+    _inherit = 'ir.module.module'
+    
+    @api.multi
+    def module_uninstall(self):
+        cr, uid, context = self.env.args
+        action_obj = self.pool.get('ir.actions.act_window')
+        # search window actions of mass editing  and delete it
+        if self.name == 'mass_editing':
+            action_ids = action_obj.search (cr, uid, [('res_model', '=', 'mass.editing.wizard')], context=context)
+            action_obj.unlink(cr, uid, action_ids, context=context)
+        return super(ir_module_module, self).module_uninstall()
+    

+ 0 - 0
mass_editing/mass_editing_view.xml → mass_editing/views/mass_editing_view.xml


+ 0 - 1
mass_editing/wizard/__init__.py

@@ -21,4 +21,3 @@
 
 import mass_editing_wizard
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 0 - 3
mass_editing/wizard/mass_editing_wizard.py

@@ -127,6 +127,3 @@ class mass_editing_wizard(models.Model):
     @api.v7
     def action_apply(self, cr, uid, ids, context=None):
         return  {'type': 'ir.actions.act_window_close'}
-
-mass_editing_wizard()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: