From 69f200e4c31a9b0e1f2a019d95f151d5da579bb1 Mon Sep 17 00:00:00 2001 From: Vacha Trivedi Date: Fri, 29 Jun 2018 11:31:08 +0530 Subject: [PATCH] [FIX]mass_editing:Fixed Travis and m2m remove all data. --- mass_editing/wizard/mass_editing_wizard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mass_editing/wizard/mass_editing_wizard.py b/mass_editing/wizard/mass_editing_wizard.py index 5f0d015..028aba8 100644 --- a/mass_editing/wizard/mass_editing_wizard.py +++ b/mass_editing/wizard/mass_editing_wizard.py @@ -450,16 +450,17 @@ class MassEditingWizard(models.TransientModel): split_key))]) translation_ids.unlink() - elif val == 'remove_m2m': + elif val in ['remove_m2m', 'remove_m2m_all']: + m2m_list = [] if vals.get(split_key): - m2m_list = [] for m2m_id in vals.get(split_key)[0][2]: m2m_list.append((3, m2m_id)) if m2m_list: values.update({split_key: m2m_list}) else: values.update({split_key: [(5, 0, [])]}) - elif val in ['remove_o2m', 'remove_m2m_all']: + + elif val =='remove_o2m': # model_fieds will return the particular model # in order to get the field of the model # and its relation.