* @param {Function} error_callback
* @returns {$.Deferred}
*/
- call: function (method, args, callback, error_callback) {
- return this._model.call(method, args).then(callback, error_callback);
+ call: function (method, args) {
+ return this._model.call(method, args);
},
/**
* Calls an arbitrary method, with more crazy
});
t.test('call', function (openerp) {
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
- t.expect(ds.call('frob', ['a', 'b', 42]), function (r) {
+ t.expect(ds.call('frob', ['a', 'b', 42]).then(function (r) {
strictEqual(r.method, 'frob');
strictEqual(r.args.length, 3);
deepEqual(r.args, ['a', 'b', 42]);
ok(_.isEmpty(r.kwargs));
- });
+ }));
});
t.test('name_get').then(function (openerp) {
var ds = new openerp.web.DataSet({session: openerp.session}, 'mod');
var field_dataset = new instance.web.DataSetSearch(this, this.model, null, null);
var model_dataset = new instance.web.DataSetSearch(this, 'ir.model', null, null);
var view_string = "", field_name = false, self = this;
- field_dataset.call( 'fields_get', [], function(fields) {
+ field_dataset.call( 'fields_get', []).then(function(fields) {
_.each(['name', 'x_name'], function(value) {
if (_.include(_.keys(fields), value)) {
field_name = value;
var value = _.has(_CHILDREN, element) ? element : _.str.include(html_tag, element)?"html_tag":false;
property_to_check.push(value);
});
- field_dataset.call( 'fields_get', [], function(result) {
+ field_dataset.call( 'fields_get', []).then(function(result) {
var fields = _.keys(result);
fields.push(" "),fields.sort();
self.on_add_node(property_to_check, fields);