diff --git a/tryton/common/date_widget.py b/tryton/common/date_widget.py index 2da1204519..5dbf2c3e50 100644 --- a/tryton/common/date_widget.py +++ b/tryton/common/date_widget.py @@ -70,11 +70,18 @@ class DateEntry(gtk.Entry): if text == self.initial_value and pos >= len(self.initial_value): pos = 0 - text = text[:pos] + value + text[pos + length:] - if self.regex.match(text): + for char in value: + if pos >= len(self.initial_value): + continue + if char != ' ' and char in self.initial_value[pos:]: + pos += self.initial_value[pos:].index(char) + else: + while self.initial_value[pos] != ' ': + pos += 1 + text = text[:pos] + char + text[pos + 1:] pos += 1 - while (pos