From c7d91339872ba9b33ca66aa25e70b64f6ed60391 Mon Sep 17 00:00:00 2001 From: David Beal Date: Fri, 17 Feb 2017 15:02:30 +0100 Subject: [PATCH] FIX warning in mass editing module when read --- mass_editing/wizard/mass_editing_wizard.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mass_editing/wizard/mass_editing_wizard.py b/mass_editing/wizard/mass_editing_wizard.py index b266d3420..f02968b5b 100644 --- a/mass_editing/wizard/mass_editing_wizard.py +++ b/mass_editing/wizard/mass_editing_wizard.py @@ -183,6 +183,20 @@ class MassEditingWizard(orm.TransientModel): result['fields'] = all_fields return result + def read(self, cr, uid, ids, fields, context=None): + """ Without this call, dynamic fields defined in fields_view_get() + generate a log warning, i.e.: + + openerp.models: mass.editing.wizard.read() + with unknown field 'myfield' + openerp.models: mass.editing.wizard.read() + with unknown field 'selection__myfield' + """ + # We remove fields which are not in _columns + real_fields = [x for x in fields if x in self._columns] + return super(MassEditingWizard, self).read( + cr, uid, ids, real_fields, context=context) + def create(self, cr, uid, vals, context=None): if context.get('active_model') and context.get('active_ids'): model_obj = self.pool.get(context.get('active_model'))