[IMP]remove callback from name_create method and update related code.

bzr revid: vme@tinyerp.com-20120928094007-mx5p402a1ehdl73f
This commit is contained in:
Vidhin Mehta (OpenERP) 2012-09-28 15:10:07 +05:30
parent 6d692fac36
commit bb5fd9ba81
2 changed files with 3 additions and 4 deletions

View File

@ -746,10 +746,9 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({
* @param name
* @param callback
*/
name_create: function(name, callback) {
name_create: function(name) {
return this._model.call('name_create',
[name], {context: this._model.context()})
.then(callback);
[name], {context: this._model.context()});
},
exec_workflow: function (id, signal, callback) {
return this._model.exec_workflow(id, signal)

View File

@ -2719,7 +2719,7 @@ instance.web.form.CompletionFieldMixin = {
};
if (self.options.quick_create === undefined || self.options.quick_create) {
new instance.web.DataSet(this, this.field.relation, self.build_context())
.name_create(name, function(data) {
.name_create(name).then(function(data) {
self.add_id(data[0]);
}).fail(function(error, event) {
event.preventDefault();