When you are on a form view, you click on a left/right arrow(on the top-right of the view) to pass to the next records. If you click on the widget to change the kanban_state, the widget will change the state of the previous record and not for the current because the record_id is not reset
if (li.length) {
var value = {};
value[self.name] = String(li.data('value'));
+ self.record_id = self.view.datarecord.id;
if (self.record_id) {
return self.view.dataset._model.call('write', [[self.record_id], value, self.view.dataset.get_context()]).done(self.reload_record.bind(self));
} else {