diff --git a/tryton/gui/window/view_form/screen/screen.py b/tryton/gui/window/view_form/screen/screen.py index 5c2fe69943..17a8e6c8dc 100644 --- a/tryton/gui/window/view_form/screen/screen.py +++ b/tryton/gui/window/view_form/screen/screen.py @@ -433,8 +433,8 @@ class Screen(SignalEvent): # XXX offset? pos = record.get_index_path() else: - pos = None - self.signal('record-message', (pos or 0, len(self.group) + self.offset, + pos = 0 + self.signal('record-message', (pos, len(self.group) + self.offset, self.search_count, record and record.id)) attachment_count = 0 if record and record.attachment_count > 0: diff --git a/tryton/gui/window/view_form/view/form_gtk/one2many.py b/tryton/gui/window/view_form/view/form_gtk/one2many.py index b49874e3a4..983d3709c7 100644 --- a/tryton/gui/window/view_form/view/form_gtk/one2many.py +++ b/tryton/gui/window/view_form/view/form_gtk/one2many.py @@ -257,6 +257,11 @@ class One2Many(Widget): o2m_size = None size_limit = False + first = last = False + if isinstance(self._position, int): + first = self._position <= 1 + last = self._position >= self._length + self.but_new.set_sensitive(bool( not self._readonly and self.attrs.get('create', True) @@ -276,10 +281,10 @@ class One2Many(Widget): and access['read'])) self.but_next.set_sensitive(bool( self._position - and self._position < self._length)) + and not last)) self.but_pre.set_sensitive(bool( self._position - and self._position > 1)) + and not first)) if self.attrs.get('add_remove'): self.but_add.set_sensitive(bool( not self._readonly @@ -481,7 +486,7 @@ class One2Many(Widget): def _sig_label(self, screen, signal_data): self._position = signal_data[0] self._length = signal_data[1] - if self._position >= 1: + if self._position: name = str(self._position) else: name = '_'