Fix params of concurrency dialog

- ids is the first element of params
- javascript doesn't have negative index
- slice return an array
This commit is contained in:
Cédric Krier committed 2015-10-16 15:52:39 +02:00
1 parent 2f34461310
commit 2b13e24f5d
1 file changed
+3 -3
+3 -3
View File
@@ -67,10 +67,10 @@
(args.method.endsWith('.write') ||
args.method.endsWith('.delete'))) {
var model = args.method.split('.').slice(1, -1).join('.');
Sao.common.concurrency.run( model, args.params[1][0],
args.params[-1])
Sao.common.concurrency.run(model, args.params[0][0],
args.params.slice(-1)[0])
.then(function() {
delete args.params.slice(-1)._timestamp;
delete args.params.slice(-1)[0]._timestamp;
Sao.rpc(args, session).then(
dfd.resolve, dfd.reject);
}, dfd.reject);