[fix]fix bug 884207.

lp bug: https://launchpad.net/bugs/884207 fixed

bzr revid: vme@tinyerp.com-20111220121135-k0pwb4j3jzwrr1we
This commit is contained in:
Vidhin Mehta (OpenERP) 2011-12-20 17:41:35 +05:30
parent 8ba259b3f6
commit d31512342a
2 changed files with 8 additions and 3 deletions

View File

@ -253,13 +253,15 @@ openerp.web.format_cell = function (row_data, column, value_if_empty, process_mo
if (attrs.invisible) { return ''; }
if (column.tag === 'button') {
return [
'<button type="button" title="', column.string || '', '">',
'<button type="button" title="', column.string || '', '" ',
(isNaN(row_data["id"].value)
&& openerp.web.BufferedDataSet.virtual_id_regex.test(row_data["id"].value))
?'disabled="disabled"':'','>',
'<img src="', openerp.connection.prefix, '/web/static/src/img/icons/', column.icon, '.png"',
' alt="', column.string || '', '"/>',
'</button>'
].join('')
}
if (!row_data[column.id]) {
return value_if_empty === undefined ? '' : value_if_empty;
}

View File

@ -557,6 +557,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
* @param {Function} callback should be called after the action is executed, if non-null
*/
do_button_action: function (name, id, callback) {
var self = this;
var action = _.detect(this.columns, function (field) {
return field.name === name;
});
@ -575,7 +576,9 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
c.add(action.context);
}
action.context = c;
this.do_execute_action(action, this.dataset, id, callback);
this.do_execute_action(action, this.dataset, id, function(){
self.o2m.view.reload();
});
},
/**
* Handles the activation of a record (clicking on it)