[FIX] recompute aggregates after saving a record
bzr revid: xmo@openerp.com-20110608133301-l3cdm9r2254zs20u
This commit is contained in:
parent
80e26dce12
commit
f824cd6aa3
|
@ -20,6 +20,12 @@ openerp.base.list.editable = function (openerp) {
|
||||||
$(this.groups).bind({
|
$(this.groups).bind({
|
||||||
'edit': function (e, id, dataset) {
|
'edit': function (e, id, dataset) {
|
||||||
self.do_edit(dataset.index, 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# */{
|
_.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 () {
|
new_record: function () {
|
||||||
// TODO: handle multiple children
|
// TODO: handle multiple children
|
||||||
this.children[null].new_record();
|
this.children[null].new_record();
|
||||||
|
@ -187,6 +193,8 @@ openerp.base.list.editable = function (openerp) {
|
||||||
delete self.edition_form;
|
delete self.edition_form;
|
||||||
delete self.edition_index;
|
delete self.edition_index;
|
||||||
delete self.edition;
|
delete self.edition;
|
||||||
|
|
||||||
|
$(self).trigger('saved', [self.dataset]);
|
||||||
if (!edit_next) {
|
if (!edit_next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue