Browse Source

[FIX] Don't allow for iterating over False

pull/78/head
Stefan Rijnhart 11 years ago
parent
commit
98c4733806
  1. 6
      mass_editing/wizard/mass_editing_wizard.py

6
mass_editing/wizard/mass_editing_wizard.py

@ -103,17 +103,17 @@ class mass_editing_wizard(osv.osv_memory):
if key.startswith('selection_'):
model_field= key.split('_',1)[1]
if val == 'set':
model_vals.update({model_field: vals.get(model_field, False)})
model_vals.update({model_field: vals[model_field]})
elif val == 'remove':
model_vals.update({model_field: False})
elif val == 'remove_m2m':
m2m_list = []
for m2m_id in vals.get(model_field, False)[0][2]:
for m2m_id in vals[model_field][0][2] or []:
m2m_list.append((3, m2m_id))
model_vals.update({model_field: m2m_list})
elif val == 'add':
m2m_list = []
for m2m_id in vals.get(model_field, False)[0][2]:
for m2m_id in vals[model_field][0][2] or []:
m2m_list.append((4, m2m_id))
model_vals.update({model_field: m2m_list})
if model_vals:

Loading…
Cancel
Save