[FIX] handling of @onwrite

extraction was broken: using _.bind/3 will partially apply the
function (first argument) on top of binding it to a context (second
argument), but the partial application will be from the *left* (which
is pretty much the only one making sense, short of kwargs).

handle_onwrite_record took its arguments the wrong way around: the
partially applied one was specified on the right and the "actually
applied" one was on the left, so it used the wrong argument and ended
up blowing up the rest of the code.

bzr revid: xmo@openerp.com-20120718101744-bbbshq60x2kqhob6
This commit is contained in:
Xavier Morel 2012-07-18 12:17:44 +02:00
parent 01e6e3ec07
commit 71ede66dce
1 changed files with 1 additions and 1 deletions

View File

@ -352,7 +352,7 @@ openerp.web.list_editable = function (instance) {
_.bind(self.handle_onwrite_record, self, source_record)));
});
},
handle_onwrite_record: function (id, source_record) {
handle_onwrite_record: function (source_record, id) {
var record = this.records.get(id);
if (!record) {
// insert after the source record