Browse Source

Merge pull request #799 from Tecnativa/9.0-mass_editing-fix_missing_views

9.0 mass editing fix missing views
pull/611/head
Pedro M. Baeza 8 years ago
committed by GitHub
parent
commit
2a30056592
  1. 2
      mass_editing/models/mass_object.py
  2. 4
      mass_editing/tests/test_mass_editing.py
  3. 3
      mass_editing/wizard/mass_editing_wizard.py

2
mass_editing/models/mass_object.py

@ -62,7 +62,7 @@ class MassObject(models.Model):
'src_model': src_obj, 'src_model': src_obj,
'view_type': 'form', 'view_type': 'form',
'context': "{'mass_editing_object' : %d}" % (self.id), 'context': "{'mass_editing_object' : %d}" % (self.id),
'view_mode': 'form, tree',
'view_mode': 'form,tree',
'target': 'new', 'target': 'new',
'auto_refresh': 1, 'auto_refresh': 1,
}).id }).id

4
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() result = self.mass_wiz_obj.with_context(ctx).fields_view_get()
self.assertTrue(result.get('arch'), self.assertTrue(result.get('arch'),
'Fields view get must return architecture.') '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): def test_onchange_model(self):
"""Test whether onchange model_id returns model_id in list""" """Test whether onchange model_id returns model_id in list"""

3
mass_editing/wizard/mass_editing_wizard.py

@ -207,6 +207,9 @@ class MassEditingWizard(models.TransientModel):
field.name + "','=','remove')]}"), field.name + "','=','remove')]}"),
'colspan': '4', 'colspan': '4',
}) })
# Patch fields with required extra data
for field in all_fields.values():
field.setdefault("views", {})
etree.SubElement(xml_form, 'separator', { etree.SubElement(xml_form, 'separator', {
'string': '', 'string': '',
'colspan': '6', 'colspan': '6',

Loading…
Cancel
Save