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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user