[FIX] web: KanbanSelection and Priority widgets

Use directly datarecord id instead of previously stored value which may
not be up to date.
This commit is contained in:
Christophe Simonis 2015-02-27 17:18:06 +01:00
parent fb285d8695
commit 128de187a3
1 changed files with 2 additions and 4 deletions

View File

@ -2365,7 +2365,6 @@ instance.web.form.KanbanSelection = instance.web.form.FieldChar.extend({
},
render_value: function() {
var self = this;
this.record_id = this.view.datarecord.id;
this.states = this.prepare_dropdown_selection();;
this.$el.html(QWeb.render("KanbanSelection", {'widget': self}));
this.$el.find('li').on('click', this.set_kanban_selection.bind(this));
@ -2383,7 +2382,7 @@ instance.web.form.KanbanSelection = instance.web.form.FieldChar.extend({
write_values[self.name] = value;
return this.view.dataset._model.call(
'write', [
[self.record_id],
[this.view.datarecord.id],
write_values,
self.view.dataset.get_context()
]).done(self.reload_record.bind(self));
@ -2421,7 +2420,6 @@ instance.web.form.Priority = instance.web.form.FieldChar.extend({
},
render_value: function() {
var self = this;
this.record_id = this.view.datarecord.id;
this.priorities = this.prepare_priority();
this.$el.html(QWeb.render("Priority", {'widget': this}));
if (!this.get('readonly')){
@ -2441,7 +2439,7 @@ instance.web.form.Priority = instance.web.form.FieldChar.extend({
write_values[self.name] = value;
return this.view.dataset._model.call(
'write', [
[self.record_id],
[this.view.datarecord.id],
write_values,
self.view.dataset.get_context()
]).done(self.reload_record.bind(self));