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
This commit is contained in:
Cédric Krier
2026-06-08 09:09:23 +02:00
parent ac0e3d842e
commit ac029c3f22
+3 -1
View File
@@ -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