From f6ce32531c83bdaf036eb8915228e7ede010b041 Mon Sep 17 00:00:00 2001 From: Victor Champonnois Date: Thu, 7 Sep 2023 10:19:36 +0200 Subject: [PATCH] [REM] no-delete on child_eater_ids many2many This check is not necessary. In a many2many widget, removing an item is a "3" (unlink) command. There doesn't seem to be a case where it would be a "2" command. --- eater/models/partner.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/eater/models/partner.py b/eater/models/partner.py index 960664467..45adff3ec 100644 --- a/eater/models/partner.py +++ b/eater/models/partner.py @@ -61,14 +61,6 @@ def write(self, values): ) % partner.parent_eater_id.name ) - # fixme : is this still necessary ? In a many2many widget, removing an item - # is a "3" (unlink) command. In which case would this be a delete command ? - # replace many2many command when writing on child_eater_ids to unlink - # rather than delete - if "child_eater_ids" in values: - for command in values["child_eater_ids"]: - if command[0] == 2: - command[0] = 3 return super().write(values) def _new_eater(self, surname, name, email):