Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits: a14d3fce by Cédric Krier at 2023-01-24T01:00:12+01:00 Set default badge and sent record message when current record is None Closes #12032 - - - - - 5 changed files: - sao/src/screen.js - sao/src/view/form.js - tryton/tryton/gui/window/view_form/screen/screen.py - tryton/tryton/gui/window/view_form/view/form_gtk/many2many.py - tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py Changes: ===================================== sao/src/screen.js ===================================== @@ -1276,7 +1276,7 @@ return this.__current_record; }, set current_record(record) { - if (this.__current_record === record) { + if ((this.__current_record === record) && record) { return; } this.__current_record = record; ===================================== sao/src/view/form.js ===================================== @@ -3118,7 +3118,8 @@ this.label = jQuery('<span/>', { 'class': 'badge', - }).appendTo(jQuery('<span/>', { + }).text('_ / 0' + ).appendTo(jQuery('<span/>', { 'class': 'btn hidden-xs', }).appendTo(buttons)); @@ -3779,7 +3780,8 @@ this.label = jQuery('<span/>', { 'class': 'badge', - }).appendTo(jQuery('<span/>', { + }).text('_ / 0' + ).appendTo(jQuery('<span/>', { 'class': 'btn hidden-xs', }).appendTo(buttons)); ===================================== tryton/tryton/gui/window/view_form/screen/screen.py ===================================== @@ -483,7 +483,7 @@ return self.__current_record def __set_current_record(self, record): - if self.__current_record == record: + if self.__current_record == record and record: return self.__current_record = record if record: ===================================== tryton/tryton/gui/window/view_form/view/form_gtk/many2many.py ===================================== @@ -72,7 +72,7 @@ self.but_add.set_relief(Gtk.ReliefStyle.NONE) hbox.pack_start(self.but_add, expand=False, fill=False, padding=0) - self.label = Gtk.Label(label='(0/0)') + self.label = Gtk.Label(label='(_/0)') hbox.pack_start(self.label, expand=False, fill=False, padding=0) self.but_remove = Gtk.Button(can_focus=False) ===================================== tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py ===================================== @@ -62,7 +62,7 @@ self.but_pre.set_relief(Gtk.ReliefStyle.NONE) hbox.pack_start(self.but_pre, expand=False, fill=False, padding=0) - self.label = Gtk.Label(label='(0/0)') + self.label = Gtk.Label(label='(_/0)') hbox.pack_start(self.label, expand=False, fill=False, padding=0) self.but_next = Gtk.Button(can_focus=False) View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/commit/a14d3fce722538581b068fcf2f6c4f2cce73e380 -- View it on Heptapod: https://foss.heptapod.net/tryton/tryton/-/commit/a14d3fce722538581b068fcf2f6c4f2cce73e380 You're receiving this email because of your account on foss.heptapod.net.