summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2013-10-18 12:36:31 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2013-10-18 12:36:31 +0200
commite080294dc0d47c9abb77dff587d2e1dd9e3642a7 (patch)
tree9888d24957563b75ac7c93d18fb4a71383020e83 /addons/web/static/src/js
parent5696282656e22df91591800333258d6ecf378df2 (diff)
parent3853f642ff327f886086c7a766cdf76da7a2b906 (diff)
[MERGE] saas2
bzr revid: nicolas.vanhoren@openerp.com-20131018103631-vennug4iy21zhp3x
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/chrome.js2
-rw-r--r--addons/web/static/src/js/data_export.js48
-rw-r--r--addons/web/static/src/js/view_form.js2
-rw-r--r--addons/web/static/src/js/view_list.js7
4 files changed, 34 insertions, 25 deletions
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index 09694bb0c38..0cdffb0d6b0 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -1247,6 +1247,7 @@ instance.web.Client = instance.web.Widget.extend({
this.$el.on('click', '.oe_dropdown_toggle', function(ev) {
ev.preventDefault();
var $toggle = $(this);
+ var doc_width = $(document).width();
var $menu = $toggle.siblings('.oe_dropdown_menu');
$menu = $menu.size() >= 1 ? $menu : $toggle.find('.oe_dropdown_menu');
var state = $menu.is('.oe_opened');
@@ -1255,7 +1256,6 @@ instance.web.Client = instance.web.Widget.extend({
$toggle.add($menu).toggleClass('oe_opened', !state);
if (!state) {
// Move $menu if outside window's edge
- var doc_width = $(document).width();
var offset = $menu.offset();
var menu_width = $menu.width();
var x = doc_width - offset.left - menu_width - 2;
diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js
index f642f0a334d..2725e18ea6e 100644
--- a/addons/web/static/src/js/data_export.js
+++ b/addons/web/static/src/js/data_export.js
@@ -62,8 +62,21 @@ instance.web.DataExport = instance.web.Dialog.extend({
});
}).change();
+ var got_domain = this.getParent().get_active_domain().then(function (domain) {
+ if (domain === undefined) {
+ self.ids_to_export = self.getParent().get_selected_ids();
+ self.domain = self.dataset.domain;
+ }
+ else {
+ self.ids_to_export = false;
+ self.domain = domain;
+ }
+ self.on_show_domain();
+ });
+
return $.when(
got_fields,
+ got_domain,
this.rpc('/web/export/formats', {}).done(this.do_setup_export_formats),
this.show_exports_list());
},
@@ -196,6 +209,9 @@ instance.web.DataExport = instance.web.Dialog.extend({
self.showcontent(record.id);
}
},
+ on_show_domain: function() {
+ this.$el.find('tr').first().find('td').append(QWeb.render('ExportTreeView-Domain', {'record': this}));
+ },
on_show_data: function(result, after) {
var self = this;
@@ -384,27 +400,17 @@ instance.web.DataExport = instance.web.Dialog.extend({
var export_format = this.$el.find("#export_format").val();
- this.getParent().get_active_domain().then(function (domain) {
- if (domain === undefined) {
- var ids_to_export = self.getParent().get_selected_ids();
- var domain = self.dataset.domain;
- }
- else {
- var ids_to_export = false;
- var domain = domain;
- }
- instance.web.blockUI();
- self.session.get_file({
- url: '/web/export/' + export_format,
- data: {data: JSON.stringify({
- model: self.dataset.model,
- fields: exported_fields,
- ids: ids_to_export,
- domain: domain,
- import_compat: !!self.$el.find("#import_compat").val(),
- })},
- complete: instance.web.unblockUI,
- });
+ instance.web.blockUI();
+ this.session.get_file({
+ url: '/web/export/' + export_format,
+ data: {data: JSON.stringify({
+ model: this.dataset.model,
+ fields: exported_fields,
+ ids: this.ids_to_export,
+ domain: this.domain,
+ import_compat: !!this.$el.find("#import_compat").val(),
+ })},
+ complete: instance.web.unblockUI,
});
},
close: function() {
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index c096dd884ad..cf3d8414795 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -5475,7 +5475,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
});
this.get_selection();
if (this.options.clickable) {
- this.$el.on('click','li:not(.oe_folded)',this.on_click_stage);
+ this.$el.on('click','li[data-id]',this.on_click_stage);
}
if (this.$el.parent().is('header')) {
this.$el.after('<div class="oe_clear"/>');
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index f9ec22bf712..9c613935aa1 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -802,9 +802,11 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
},
/**
* Calculate the active domain of the list view. This should be done only
- * if the header checkbox has been checked.
+ * if the header checkbox has been checked. This is done by evaluating the
+ * search results, and then adding the dataset domain (i.e. action domain).
*/
get_active_domain: function () {
+ var self = this;
if (this.$('.oe_list_record_selector').prop('checked')) {
var search_view = this.getParent().searchview;
var search_data = search_view.build_search_data();
@@ -813,7 +815,8 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
contexts: search_data.contexts,
group_by_seq: search_data.groupbys || []
}).then(function (results) {
- return results.domain;
+ var domain = self.dataset.domain.concat(results.domain || []);
+ return domain
});
}
else {