[REF] bi_sql_editor : Make test independant

[FIX] bi_sql_editor : allow to pass default values in copy() function
This commit is contained in:
Sylvain LE GAL
2023-12-05 21:22:52 +01:00
committed by thien
parent 0612486f91
commit db6c8968a2
2 changed files with 31 additions and 23 deletions

View File

@@ -263,12 +263,10 @@ class BiSQLView(models.Model):
def copy(self, default=None):
self.ensure_one()
default = dict(default or {})
default.update(
{
"name": _("%s (Copy)") % self.name,
"technical_name": "%s_copy" % self.technical_name,
}
)
if "name" not in default:
default["name"] = _("%s (Copy)") % self.name
if "technical_name" not in default:
default["technical_name"] = f"{self.technical_name}_copy"
return super().copy(default=default)
# Action Section