diff options
| author | vta vta@openerp.com <> | 2012-10-08 14:34:44 +0200 |
|---|---|---|
| committer | vta vta@openerp.com <> | 2012-10-08 14:34:44 +0200 |
| commit | 2b19de7169d2cfad54a3dc3d4f2bb5c0df3a44bf (patch) | |
| tree | 1b450629839aa591b7e221da6a525fa3b43f30f0 /addons | |
| parent | 06fd81019ca693abde0df78c4de73ffb6617cc5a (diff) | |
| parent | e00dcf2eb82c8b68f174e3e5cda7dcaed1b3c36d (diff) | |
[MERGE] Merged trunk-trigger-on_write_completed.
bzr revid: vta@openerp.com-20121008123444-alj156bzuz1rnep6
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 11 | ||||
| -rw-r--r-- | addons/web_gantt/static/src/js/gantt.js | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 5638d95a3a9..a17d43a0b5b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2959,7 +2959,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc title: _t("Open: ") + self.string } ); - pop.on_write_completed.add_last(function() { + pop.on('on_write_complete', self, function(){ self.display_value = {}; self.render_value(); self.focus(); @@ -4108,9 +4108,7 @@ instance.web.form.Many2ManyListView = instance.web.ListView.extend(/** @lends in title: _t("Open: ") + this.m2m_field.string, readonly: this.getParent().get("effective_readonly") }); - pop.on_write_completed.add_last(function() { - self.reload_content(); - }); + pop.on('on_write_complete', self, self.reload_content); } }); @@ -4357,7 +4355,9 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ }; this.dataset.write_function = function(id, data, options, sup) { var fct = self.options.write_function || sup; - return fct.call(this, id, data, options).then(self.on_write_completed); + return fct.call(this, id, data, options).then(function() { + self.trigger('on_write_complete'); + }); }; this.dataset.parent_view = this.options.parent_view; this.dataset.child_name = this.options.child_name; @@ -4377,7 +4377,6 @@ instance.web.form.AbstractFormPopup = instance.web.Widget.extend({ this.$buttonpane = dialog.$el.dialog("widget").find(".ui-dialog-buttonpane").html(""); this.start(); }, - on_write_completed: function() {}, setup_form_view: function() { var self = this; if (this.row_id) { diff --git a/addons/web_gantt/static/src/js/gantt.js b/addons/web_gantt/static/src/js/gantt.js index 00e057258f1..0d600712d4a 100644 --- a/addons/web_gantt/static/src/js/gantt.js +++ b/addons/web_gantt/static/src/js/gantt.js @@ -211,9 +211,7 @@ instance.web_gantt.GanttView = instance.web.View.extend({ on_task_display: function(task) { var self = this; var pop = new instance.web.form.FormOpenPopup(self); - pop.on_write_completed.add_last(function() { - self.reload(); - }); + pop.on('on_write_complete',self,self.reload); pop.show_element( self.dataset.model, task.id, |
