Use name instead of rec_name for button_link action

Since issue9445, action values are explicitly defined. Default values for
actions are now: id, name, type and icon.rec_name. That's why we should use
name instead of rec_name.

issue9481
review310061002
This commit is contained in:
Maxime Richez committed 2020-07-15 17:32:39 +02:00
1 parent 4d7f0e7510
commit 969a3c11da
1 file changed
+3 -3
@@ -162,7 +162,7 @@ class Link(StateMixin, Gtk.Button):
action = common.RPCExecute(
'model', 'ir.action', 'get_action_value', self.action_id,
context=context)
self.set_label(action['rec_name'])
self.set_label(action['name'])
decoder = PYSONDecoder(pyson_ctx)
domain = decoder.decode(action['pyson_domain'])
@@ -171,10 +171,10 @@ class Link(StateMixin, Gtk.Button):
tab_domains = [(n, decoder.decode(d))
for n, d, c in action['domains'] if c]
if tab_domains:
label = ('%s\n' % action['rec_name']) + '\n'.join(
label = ('%s\n' % action['name']) + '\n'.join(
'%s (%%d)' % n for n, _ in tab_domains)
else:
label = '%s (%%d)' % action['rec_name']
label = '%s (%%d)' % action['name']
if record and self.action_id in record.links_counts:
counter = record.links_counts[self.action_id]
self._set_label_counter(label, counter)