diff --git a/mass_editing/tests/test_mass_editing.py b/mass_editing/tests/test_mass_editing.py index 518d6e2ec..7a737038f 100644 --- a/mass_editing/tests/test_mass_editing.py +++ b/mass_editing/tests/test_mass_editing.py @@ -80,6 +80,10 @@ class TestMassEditing(common.TransactionCase): result = self.mass_wiz_obj.with_context(ctx).fields_view_get() self.assertTrue(result.get('arch'), 'Fields view get must return architecture.') + fields = result.get("fields") + self.assertTrue(fields) + for name, values in fields.items(): + self.assertTrue(isinstance(values["views"], dict)) def test_onchange_model(self): """Test whether onchange model_id returns model_id in list""" diff --git a/mass_editing/wizard/mass_editing_wizard.py b/mass_editing/wizard/mass_editing_wizard.py index 845630708..c8bddcc91 100644 --- a/mass_editing/wizard/mass_editing_wizard.py +++ b/mass_editing/wizard/mass_editing_wizard.py @@ -207,6 +207,9 @@ class MassEditingWizard(models.TransientModel): field.name + "','=','remove')]}"), 'colspan': '4', }) + # Patch fields with required extra data + for field in all_fields.values(): + field.setdefault("views", {}) etree.SubElement(xml_form, 'separator', { 'string': '', 'colspan': '6',