|
|
@ -101,21 +101,21 @@ class mass_editing_wizard(osv.osv_memory): |
|
|
|
model_vals = {} |
|
|
|
for key ,val in vals.items(): |
|
|
|
if key.startswith('selection_'): |
|
|
|
split_key= key.split('_',1)[1] |
|
|
|
model_field= key.split('_',1)[1] |
|
|
|
if val == 'set': |
|
|
|
model_vals.update({split_key: vals.get(split_key, False)}) |
|
|
|
model_vals.update({model_field: vals.get(model_field, False)}) |
|
|
|
elif val == 'remove': |
|
|
|
model_vals.update({split_key: False}) |
|
|
|
model_vals.update({model_field: False}) |
|
|
|
elif val == 'remove_m2m': |
|
|
|
m2m_list = [] |
|
|
|
for m2m_id in vals.get(split_key, False)[0][2]: |
|
|
|
for m2m_id in vals.get(model_field, False)[0][2]: |
|
|
|
m2m_list.append((3, m2m_id)) |
|
|
|
model_vals.update({split_key: m2m_list}) |
|
|
|
model_vals.update({model_field: m2m_list}) |
|
|
|
elif val == 'add': |
|
|
|
m2m_list = [] |
|
|
|
for m2m_id in vals.get(split_key, False)[0][2]: |
|
|
|
for m2m_id in vals.get(model_field, False)[0][2]: |
|
|
|
m2m_list.append((4, m2m_id)) |
|
|
|
model_vals.update({split_key: m2m_list}) |
|
|
|
model_vals.update({model_field: m2m_list}) |
|
|
|
if model_vals: |
|
|
|
model_obj.write(cr, uid, context.get('active_ids'), model_vals, context) |
|
|
|
result = super(mass_editing_wizard, self).create(cr, uid, {}, context) |
|
|
|