From f94b4ddfd3bf1e25e3e9f8ac41e6bfb1434a467c Mon Sep 17 00:00:00 2001 From: Sabrina Romero Date: Wed, 12 Jun 2013 21:17:19 -0700 Subject: [PATCH] [IMP] Added one2many handling --- mass_editing/mass_editing_view.xml | 2 +- mass_editing/wizard/mass_editing_wizard.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mass_editing/mass_editing_view.xml b/mass_editing/mass_editing_view.xml index f0b3e7124..10ea6b6e8 100644 --- a/mass_editing/mass_editing_view.xml +++ b/mass_editing/mass_editing_view.xml @@ -14,7 +14,7 @@ + domain="[('ttype', 'not in', ['reference', 'function']), ('model_id', 'in', model_ids[0][2])]"/> diff --git a/mass_editing/wizard/mass_editing_wizard.py b/mass_editing/wizard/mass_editing_wizard.py index a773cf346..8bf88cf8f 100644 --- a/mass_editing/wizard/mass_editing_wizard.py +++ b/mass_editing/wizard/mass_editing_wizard.py @@ -49,6 +49,19 @@ class mass_editing_wizard(orm.TransientModel): etree.SubElement(xml_group, 'separator', {'string': field_info[field.name]['string'], 'colspan': '2'}) etree.SubElement(xml_group, 'field', {'name': "selection__" + field.name, 'colspan': '2', 'nolabel':'1'}) etree.SubElement(xml_group, 'field', {'name': field.name, 'colspan':'4', 'nolabel':'1', 'attrs':"{'invisible':[('selection__" + field.name + "','=','remove_m2m')]}"}) + elif field.ttype == "one2many": + all_fields["selection__" + field.name] = {'type':'selection', + 'string': field_info[field.name]['string'], + 'selection':[('set', 'Set'), + ('remove', 'Remove')]} + all_fields[field.name] = {'type':field.ttype, + 'string': field.field_description, + 'relation': field.relation} + etree.SubElement(xml_group, 'field', + {'name': "selection__" + field.name, 'colspan':'2'}) + etree.SubElement(xml_group, 'field', + {'name': field.name, 'colspan':'4', 'nolabel':'1', + 'attrs':"{'invisible':[('selection__" + field.name + "','=','remove_o2m')]}"}) elif field.ttype == "many2one": all_fields["selection__" + field.name] = {'type':'selection', 'string': field_info[field.name]['string'], 'selection':[('set', 'Set'), ('remove', 'Remove')]} all_fields[field.name] = {'type':field.ttype, 'string': field.field_description, 'relation': field.relation}