From f64ca1c73c85aa8d1829c29f0ff632295ba5a0c2 Mon Sep 17 00:00:00 2001 From: "Pratik Raval (PRRA)" Date: Mon, 17 Jul 2023 05:18:04 +0000 Subject: [PATCH] [FIX] utm: consider default argument's name in copy method Before this commit, in the copy method override of `utm.source.mixin`, the name of the default, argument was not considered while `_get_unique_names` to get a unique name for the record. After this commit, the name parameter of the default argument will be considered for the same. taskID-2713198 Part-of: odoo/odoo#88997 --- addons/utm/models/utm_source.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/utm/models/utm_source.py b/addons/utm/models/utm_source.py index ed25b946bf3..4c3a4fe82e9 100644 --- a/addons/utm/models/utm_source.py +++ b/addons/utm/models/utm_source.py @@ -82,5 +82,6 @@ class UtmSourceMixin(models.AbstractModel): def copy(self, default=None): """Increment the counter when duplicating the source.""" default = default or {} - default['name'] = self.env['utm.mixin']._get_unique_names(self._name, [self.name])[0] + default_name = default.get('name') + default['name'] = self.env['utm.mixin']._get_unique_names(self._name, [default_name or self.name])[0] return super().copy(default)