[IMP] added "disabled" on buttons in list view during execution of asynchrnous operation

bzr revid: nicolas.vanhoren@openerp.com-20121207154640-609iwn2y093kw171
This commit is contained in:
niv-openerp 2012-12-07 16:46:40 +01:00
parent 635d5cbf0e
commit d2863fbd59
1 changed files with 6 additions and 0 deletions

View File

@ -952,12 +952,18 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
field = $target.closest('td').data('field'),
$row = $target.closest('tr'),
record_id = self.row_id($row);
if ($target.attr('disabled')) {
return;
}
$target.attr('disabled', 'disabled');
// note: $.data converts data to number if it's composed only
// of digits, nice when storing actual numbers, not nice when
// storing strings composed only of digits. Force the action
// name to be a string
$(self).trigger('action', [field.toString(), record_id, function (id) {
$target.removeAttr('disabled');
return self.reload_record(self.records.get(id));
}]);
})