diff options
| author | Jiten (OpenERP) <jra@tinyerp.com> | 2012-10-22 10:55:52 +0530 |
|---|---|---|
| committer | Jiten (OpenERP) <jra@tinyerp.com> | 2012-10-22 10:55:52 +0530 |
| commit | aa176f80b4a8ce2be9c082fa06cb14118a517d06 (patch) | |
| tree | 2ef107e1ce990bc0a991f3e19d20e1320e313bb3 /addons/web/static/src | |
| parent | 68e66d2dfbb42bbbe3dcbdff18599be0751310db (diff) | |
| parent | f6722a220cbf2ca9ff3ed6ecf418e99b91522e06 (diff) | |
[MERGE] Merged trunk.
bzr revid: jra@tinyerp.com-20121022052552-hfu0owavrs7tt1wy
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/data.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/search.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 27 | ||||
| -rw-r--r-- | addons/web/static/src/js/views.js | 19 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 3 |
5 files changed, 44 insertions, 11 deletions
diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 30a8b9862fc..0bc2848fe0b 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -557,8 +557,7 @@ instance.web.DataSet = instance.web.CallbackEnabled.extend({ return this._model.call('name_create', [name], {context: this._model.context()}); }, exec_workflow: function (id, signal) { - return this._model.exec_workflow(id, signal) - .pipe(function (result) { return { result: result }; }); + return this._model.exec_workflow(id, signal); }, get_context: function(request_context) { return this._model.context(request_context); diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 33d20980732..9351f621324 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -746,7 +746,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea this.on_invalid(search.errors); return; } - return this.trigger('search_data', search.domains, search.contexts, search.groupbys); + this.trigger('search_data', search.domains, search.contexts, search.groupbys); }, /** * Triggered after the SearchView has collected all relevant domains and @@ -777,6 +777,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea */ on_invalid: function (errors) { this.do_notify(_t("Invalid Search"), _t("triggered from search view")); + this.trigger('invalid_search', errors); } }); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d096e15b51d..bc171ef1d6e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3351,6 +3351,23 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ controller.on('edit:before', self, function (e) { e.cancel = true; }); + var has_handle = _(controller.columns).find(function (column) { + if (!column instanceof instance.web.list.Handle) { + return false; + } + column.modifiers.tree_invisible = true; + column.invisible = '1'; + // remove from visibles + controller.visible_columns.splice( + controller.visible_columns.indexOf(column), + 1); + return true; + }); + if (has_handle) { + // recompute aggregates + controller.aggregate_columns = + _(controller.visible_columns).invoke('to_aggregate'); + } } } else if (view_type === "form") { if (self.get("effective_readonly")) { @@ -3586,6 +3603,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ _template: 'One2Many.listview', init: function (parent, dataset, view_id, options) { this._super(parent, dataset, view_id, _.extend(options || {}, { + GroupsType: instance.web.form.One2ManyGroups, ListType: instance.web.form.One2ManyList })); this.on('edit:before', this, this.proxy('_before_edit')); @@ -3766,6 +3784,13 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ }); } }); +instance.web.form.One2ManyGroups = instance.web.ListView.Groups.extend({ + setup_resequence_rows: function () { + if (!this.view.o2m.get('effective_readonly')) { + this._super.apply(this, arguments); + } + } +}); instance.web.form.One2ManyList = instance.web.ListView.List.extend({ pad_table_to: function (count) { if (!this.view.is_action_enabled('create')) { @@ -4534,7 +4559,7 @@ instance.web.form.SelectCreatePopup = instance.web.form.AbstractFormPopup.extend }); }); }); - this.searchview.appendTo($(".oe_popup_list", self.$el)); + this.searchview.appendTo($(".oe_popup_search", self.$el)); }, do_search: function(domains, contexts, groupbys) { var self = this; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 705bc1b214e..d4b676f2c7a 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -24,10 +24,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ }, dialog_stop: function () { if (this.dialog) { - this.dialog_widget.destroy(); - this.dialog_widget = null; this.dialog.destroy(); - this.dialog = null; } }, /** @@ -299,6 +296,8 @@ instance.web.ActionManager = instance.web.Widget.extend({ } var widget = executor.widget(); if (executor.action.target === 'new') { + if (this.dialog_widget && ! this.dialog_widget.isDestroyed()) + this.dialog_widget.destroy(); if (this.dialog === null || this.dialog.isDestroyed()) { this.dialog = new instance.web.Dialog(this, { buttons: {"Close": function() {$(this).dialog("close")}}, @@ -306,8 +305,6 @@ instance.web.ActionManager = instance.web.Widget.extend({ }); this.dialog.on("closing", null, options.on_close); this.dialog.init_dialog(); - } else { - this.dialog_widget.destroy(); } this.dialog.dialog_title = executor.action.name; if (widget instanceof instance.web.ViewManager) { @@ -317,6 +314,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ }); } this.dialog_widget = widget; + this.dialog_widget.setParent(this.dialog); var initialized = this.dialog_widget.appendTo(this.dialog.$el); this.dialog.open(); return initialized; @@ -914,8 +912,17 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ view.set({ 'title': this.action.name }); return r; }, + get_action_manager: function() { + var cur = this; + while (cur = cur.getParent()) { + if (cur instanceof instance.web.ActionManager) { + return cur; + } + } + return undefined; + }, set_title: function(title) { - this.$el.find('.oe_breadcrumb_title:first').html(this.getParent().get_title()); + this.$el.find('.oe_breadcrumb_title:first').html(this.get_action_manager().get_title()); }, do_push_state: function(state) { if (this.getParent() && this.getParent().do_push_state) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 06603ad17a5..899bd614f76 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1297,7 +1297,8 @@ <div t-name="SearchView.InputView" class="oe_searchview_input" - contenteditable="true"/> + contenteditable="true" + tabindex="0"/> <!-- tabindex: makes div focusable --> <div t-name="SearchView.FacetView" class="oe_tag oe_tag_dark oe_searchview_facet" |
