From d908d739ccd23e6655cda7db979da3af6b14b8ca Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 7 May 2013 14:28:03 -0400 Subject: [PATCH 01/14] [ENH] Transformed mass.object's model_list char field into a proper m2m field. --- mass_editing/mass_editing.py | 15 +++++++-------- mass_editing/mass_editing_view.xml | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/mass_editing/mass_editing.py b/mass_editing/mass_editing.py index b7281b24c..a467e35fc 100644 --- a/mass_editing/mass_editing.py +++ b/mass_editing/mass_editing.py @@ -36,23 +36,22 @@ class mass_object(osv.osv): "of the related document model"), 'ref_ir_value':fields.many2one('ir.values', 'Sidebar button', readonly=True, help="Sidebar button to open the sidebar action"), - 'model_list': fields.char('Model List', size=256) + 'model_ids': fields.many2many('ir.model', string='Model List') } def onchange_model(self, cr, uid, ids, model_id): - model_list = "" + model_ids = [] if model_id: model_obj = self.pool.get('ir.model') model_data = model_obj.browse(cr, uid, model_id) - model_list = "[" + str(model_id) + "" + model_ids = [model_id] active_model_obj = self.pool.get(model_data.model) if active_model_obj._inherits: for key, val in active_model_obj._inherits.items(): - model_ids = model_obj.search(cr, uid, [('model', '=', key)]) - if model_ids: - model_list += "," + str(model_ids[0]) + "" - model_list += "]" - return {'value': {'model_list': model_list}} + found_model_ids = model_obj.search(cr, uid, [('model', '=', key)]) + if found_model_ids: + model_ids += found_model_ids[0] + return {'value': {'model_ids': [(6, 0, model_ids)]}} def create_action(self, cr, uid, ids, context=None): vals = {} diff --git a/mass_editing/mass_editing_view.xml b/mass_editing/mass_editing_view.xml index bb3cca0a9..df8346054 100644 --- a/mass_editing/mass_editing_view.xml +++ b/mass_editing/mass_editing_view.xml @@ -10,11 +10,11 @@
- + + domain="[('ttype', 'not in', ['one2many', 'refenrence', 'function']), ('model_id', 'in', model_ids[0][2])]"/> From 64a28c62e591bd2849280caf7746cca9ecf3a716 Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 5 Jun 2013 18:06:22 -0300 Subject: [PATCH 02/14] [FIX] TypeError bug #1187937 --- mass_editing/mass_editing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mass_editing/mass_editing.py b/mass_editing/mass_editing.py index a467e35fc..6ed0edba6 100644 --- a/mass_editing/mass_editing.py +++ b/mass_editing/mass_editing.py @@ -50,7 +50,7 @@ class mass_object(osv.osv): for key, val in active_model_obj._inherits.items(): found_model_ids = model_obj.search(cr, uid, [('model', '=', key)]) if found_model_ids: - model_ids += found_model_ids[0] + model_ids += [found_model_ids[0]] return {'value': {'model_ids': [(6, 0, model_ids)]}} def create_action(self, cr, uid, ids, context=None): From 9ad8472ce80c441a393e72a2d5015ea8453403bc Mon Sep 17 00:00:00 2001 From: Mariano Ruiz Date: Wed, 5 Jun 2013 18:49:18 -0300 Subject: [PATCH 03/14] [FIX] Better operation syntax --- mass_editing/mass_editing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mass_editing/mass_editing.py b/mass_editing/mass_editing.py index 6ed0edba6..537015ac4 100644 --- a/mass_editing/mass_editing.py +++ b/mass_editing/mass_editing.py @@ -50,7 +50,7 @@ class mass_object(osv.osv): for key, val in active_model_obj._inherits.items(): found_model_ids = model_obj.search(cr, uid, [('model', '=', key)]) if found_model_ids: - model_ids += [found_model_ids[0]] + model_ids.append(found_model_ids[0]) return {'value': {'model_ids': [(6, 0, model_ids)]}} def create_action(self, cr, uid, ids, context=None): From d49cabe310ea76c449e0ba877140842de645680f Mon Sep 17 00:00:00 2001 From: Anu Patel Date: Thu, 6 Jun 2013 17:27:33 +0530 Subject: [PATCH 04/14] [IMP] mass_editing: Fixed the issue occur on model change. --- mass_editing/mass_editing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mass_editing/mass_editing.py b/mass_editing/mass_editing.py index a467e35fc..537015ac4 100644 --- a/mass_editing/mass_editing.py +++ b/mass_editing/mass_editing.py @@ -50,7 +50,7 @@ class mass_object(osv.osv): for key, val in active_model_obj._inherits.items(): found_model_ids = model_obj.search(cr, uid, [('model', '=', key)]) if found_model_ids: - model_ids += found_model_ids[0] + model_ids.append(found_model_ids[0]) return {'value': {'model_ids': [(6, 0, model_ids)]}} def create_action(self, cr, uid, ids, context=None): From 38cc6d8083a371795c7184e53b32fd1e7b9dd830 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 19 Aug 2013 23:25:16 -0400 Subject: [PATCH 05/14] [IMP] Backporting v7 fixes --- mass_editing/__openerp__.py | 2 +- mass_editing/mass_editing_view.xml | 4 ++-- mass_editing/security/ir.model.access.csv | 2 +- mass_editing/wizard/mass_editing_wizard.py | 7 ------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/mass_editing/__openerp__.py b/mass_editing/__openerp__.py index bdd274113..406caa2f2 100644 --- a/mass_editing/__openerp__.py +++ b/mass_editing/__openerp__.py @@ -29,7 +29,7 @@ "website" : "http://www.serpentcs.com", "description": """This module provides the functionality to add, update or remove the values of more than one records on the fly at the same time. You can configure mass editing for any OpenERP model. - The video explaining the features is available at http://t.co/wukYMx1A + The video explaining the feature is available at http://t.co/wukYMx1A The menu is now Under Settings/Configuration. For more details/customization/feedback contact us on contact@serpentcs.com. """, diff --git a/mass_editing/mass_editing_view.xml b/mass_editing/mass_editing_view.xml index df8346054..30746e788 100644 --- a/mass_editing/mass_editing_view.xml +++ b/mass_editing/mass_editing_view.xml @@ -14,9 +14,9 @@ + domain="[('ttype', 'not in', ['reference','function']), ('model_id', 'in', model_ids[0][2])]"/> - +