[FIX] Model#call not working correctly if the second argument (after method) is the kwargs
bzr revid: xmo@openerp.com-20120302100742-p1wrg44ght8d3cdy
This commit is contained in:
parent
1aed1963c0
commit
2c2df2b325
|
@ -192,6 +192,11 @@ openerp.web.Model = openerp.web.Class.extend(/** @lends openerp.web.Model# */{
|
||||||
call: function (method, args, kwargs) {
|
call: function (method, args, kwargs) {
|
||||||
args = args || [];
|
args = args || [];
|
||||||
kwargs = kwargs || {};
|
kwargs = kwargs || {};
|
||||||
|
if (!_.isArray(args)) {
|
||||||
|
// call(method, kwargs)
|
||||||
|
kwargs = args;
|
||||||
|
args = [];
|
||||||
|
}
|
||||||
return openerp.connection.rpc('/web/dataset/call_kw', {
|
return openerp.connection.rpc('/web/dataset/call_kw', {
|
||||||
model: this.name,
|
model: this.name,
|
||||||
method: method,
|
method: method,
|
||||||
|
@ -783,7 +788,7 @@ openerp.web.DataSet = openerp.web.OldWidget.extend( /** @lends openerp.web.Data
|
||||||
* @returns {$.Deferred}
|
* @returns {$.Deferred}
|
||||||
*/
|
*/
|
||||||
name_search: function (name, domain, operator, limit, callback) {
|
name_search: function (name, domain, operator, limit, callback) {
|
||||||
return this._model.call('name_search', [], {
|
return this._model.call('name_search', {
|
||||||
name: name || '',
|
name: name || '',
|
||||||
args: domain || false,
|
args: domain || false,
|
||||||
operator: operator || 'ilike',
|
operator: operator || 'ilike',
|
||||||
|
|
|
@ -80,7 +80,7 @@ around and use them differently/add new specifications on them.
|
||||||
|
|
||||||
name of the OpenERP model this object is bound to
|
name of the OpenERP model this object is bound to
|
||||||
|
|
||||||
.. js:function:: openerp.web.Model.call(method, args, kwargs)
|
.. js:function:: openerp.web.Model.call(method[, args][, kwargs])
|
||||||
|
|
||||||
Calls the ``method`` method of the current model, with the
|
Calls the ``method`` method of the current model, with the
|
||||||
provided positional and keyword arguments.
|
provided positional and keyword arguments.
|
||||||
|
|
Loading…
Reference in New Issue