From d8638c46cc2c9773da3eec6a29a8f911471c79d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 5 Oct 2015 11:08:37 +0200 Subject: [PATCH] Escape '_' in button string issue5012 review22491004 --- CHANGELOG | 1 + tryton/common/button.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index adc216c9bd..d9faa37628 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Escape '_' in button string * Export selected records only * Use HTML for RichText widget * Change Progressbar to work with float between 0 and 1 diff --git a/tryton/common/button.py b/tryton/common/button.py index 0a4bb28301..6ba98c0e19 100644 --- a/tryton/common/button.py +++ b/tryton/common/button.py @@ -9,9 +9,7 @@ class Button(gtk.Button): def __init__(self, attrs=None): self.attrs = attrs or {} - label = attrs.get('string', '') - if '_' not in label: - label = '_' + label + label = '_' + attrs.get('string', '').replace('_', '__') super(Button, self).__init__(label=label, stock=None, use_underline=True) self._set_icon(attrs.get('icon'))