[FIX] kanban quick-create: don't attempt creation if the field is empty

bzr revid: xmo@openerp.com-20121128140428-s7w860xq7wlbi966
This commit is contained in:
Xavier Morel 2012-11-28 15:04:28 +01:00
parent 2b75593168
commit 67ad32f797
1 changed files with 3 additions and 1 deletions

View File

@ -1070,8 +1070,10 @@ instance.web_kanban.QuickCreate = instance.web.Widget.extend({
*/
quick_add: function () {
var self = this;
var val = this.$input.val();
if (/^\s*$/.test(val)) { return; }
this._dataset.call(
'name_create', [self.$input.val() || false, new instance.web.CompoundContext(
'name_create', [val, new instance.web.CompoundContext(
this._dataset.get_context(), this._context)])
.then(function(record) {
self.$input.val("");