[FIX] KanbanSelection: Reload the record_id on form view
authortfossoul <fossoul.t@gmail.com>
Thu, 26 Jun 2014 07:55:26 +0000 (09:55 +0200)
committerMartin Trigaux <mat@openerp.com>
Thu, 26 Jun 2014 07:55:26 +0000 (09:55 +0200)
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

addons/web/static/src/js/view_form.js

index 1c75f34..7bfc718 100644 (file)
@@ -2399,6 +2399,7 @@ instance.web.form.KanbanSelection = instance.web.form.FieldChar.extend({
         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 {