From ac029c3f22259ab4991af13d5bbe98cd0a653ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 8 Jun 2026 09:09:23 +0200 Subject: [PATCH] Convert toolbar into mutable objects before modification Since 619fd425e3bb the toolbar may be immutable when it comes from the cache. Closes #14881 (grafted from 9e8d1bca2c7fd2fc4ce70284e069d4b06f5ec810) --HG-- branch : 8.0 --- modules/account/move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/account/move.py b/modules/account/move.py index fa1bcc327a..a7b615d6a8 100644 --- a/modules/account/move.py +++ b/modules/account/move.py @@ -1573,8 +1573,9 @@ class Line(DescriptionOriginMixin, MoveLineMixin, ModelSQL, ModelView): ('company', '=', company), ('journal', '=', journal), ]) + toolbar = dict(toolbar) + action = list(toolbar['action']) for template in templates: - action = toolbar['action'] # Use template id for action id to auto-select the template action.append({ 'name': template.name, @@ -1582,6 +1583,7 @@ class Line(DescriptionOriginMixin, MoveLineMixin, ModelSQL, ModelView): 'wiz_name': 'account.move.template.create', 'id': template.id, }) + toolbar['action'] = action return toolbar @classmethod