From 969a3c11da0b1745ff91be939b24cc2d98ea5ec0 Mon Sep 17 00:00:00 2001 From: Maxime Richez Date: Wed, 15 Jul 2020 17:32:39 +0200 Subject: [PATCH] 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 --- tryton/gui/window/view_form/view/form_gtk/state_widget.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/state_widget.py b/tryton/gui/window/view_form/view/form_gtk/state_widget.py index db735f5b77..e95556036e 100644 --- a/tryton/gui/window/view_form/view/form_gtk/state_widget.py +++ b/tryton/gui/window/view_form/view/form_gtk/state_widget.py @@ -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)