[FIX] recompute aggregates after saving a record

bzr revid: xmo@openerp.com-20110608133301-l3cdm9r2254zs20u
This commit is contained in:
Xavier Morel 2011-06-08 15:33:01 +02:00
parent 80e26dce12
commit f824cd6aa3
1 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,12 @@ openerp.base.list.editable = function (openerp) {
$(this.groups).bind({
'edit': function (e, id, dataset) {
self.do_edit(dataset.index, id, dataset);
},
'saved': function () {
if (self.groups.get_selection().length) {
return;
}
self.compute_aggregates();
}
})
},
@ -78,7 +84,7 @@ openerp.base.list.editable = function (openerp) {
});
_.extend(openerp.base.ListView.Groups.prototype, /** @lends openerp.base.ListView.Groups# */{
passtrough_events: openerp.base.ListView.Groups.prototype.passtrough_events + " edit",
passtrough_events: openerp.base.ListView.Groups.prototype.passtrough_events + " edit saved",
new_record: function () {
// TODO: handle multiple children
this.children[null].new_record();
@ -187,6 +193,8 @@ openerp.base.list.editable = function (openerp) {
delete self.edition_form;
delete self.edition_index;
delete self.edition;
$(self).trigger('saved', [self.dataset]);
if (!edit_next) {
return;
}