diff options
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base_old.css | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/chrome.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/core.js | 9 | ||||
| -rw-r--r-- | addons/web/static/src/js/formats.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/search.js | 11 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_list.js | 28 | ||||
| -rw-r--r-- | addons/web/static/src/js/view_tree.js | 14 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 2 |
8 files changed, 45 insertions, 29 deletions
diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 50bc20a0f0f..fe3a6074492 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -1228,11 +1228,11 @@ label.error { .openerp input.oe-binary-file { z-index: 0; line-height: 0; - font-size: 50px; + font-size: 12px; position: absolute; /* Should be adjusted for all browsers */ - top: -2px; - right: 0; + top: 1px; + right: 10px; opacity: 0; filter: alpha(opacity = 0); -ms-filter: "alpha(opacity=0)"; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 3b0e30382aa..1d465df1cc5 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -455,7 +455,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab submitHandler: function (form) { var $form = $(form), fields = $form.serializeArray(), - $db_list = $form.find('select[name=drop_db]'), + $db_list = $form.find('[name=drop_db]'), db = $db_list.val(); if (!confirm("Do you really want to delete the database: " + db + " ?")) { diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index fe2ca1beb4f..393e7613834 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -760,9 +760,12 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. _(_.extend({}, options.data || {}, {session_id: this.session_id, token: token})) .each(function (value, key) { - $('<input type="hidden" name="' + key + '">') - .val(value) - .appendTo($form_data); + var $input = $form.find('[name=' + key +']'); + if (!$input.length) { + $input = $('<input type="hidden" name="' + key + '">') + .appendTo($form_data); + } + $input.val(value) }); $form diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 4fb576e4a90..90d95f70ec5 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -336,7 +336,7 @@ openerp.web.format_cell = function (row_data, column, options) { case 'progressbar': return _.template( '<progress value="<%-value%>" max="100"><%-value%>%</progress>', { - value: row_data[column.id].value + value: _.str.sprintf("%.0f", row_data[column.id].value) }); } diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index b57dd2e2302..d2ccbfaa5c3 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -263,9 +263,14 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea var filter = this.managed_filters[val]; this.do_clear(false).then(_.bind(function() { select.val('get:' + val); - var groupbys = _.map(filter.context.group_by.split(","), function(el) { - return {"group_by": el}; - }); + + var groupbys = []; + var group_by = filter.context.group_by; + if (group_by) { + groupbys = _.map( + group_by instanceof Array ? group_by : group_by.split(','), + function (el) { return { group_by: el }; }); + } this.on_search([filter.domain], [filter.context], groupbys); }, this)); } else { diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 30654da0c7d..30a0018b6e1 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -291,6 +291,10 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# */ configure_pager: function (dataset) { this.dataset.ids = dataset.ids; + // Not exactly clean + if (dataset._length) { + this.dataset._length = dataset._length; + } var limit = this.limit(), total = dataset.size(), @@ -540,19 +544,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# * @param {Array} records selected record values */ do_select: function (ids, records) { - this.$element.find('.oe-list-delete') - .attr('disabled', !ids.length); - if (this.sidebar) { - if (ids.length) { - this.sidebar.do_unfold(); - } else { - this.sidebar.do_fold(); - } - } - if (!records.length) { + this.$element.find('.oe-list-delete').attr('disabled', !ids.length); + if (!ids.length) { + this.dataset.index = 0; + if (this.sidebar) { this.sidebar.do_fold(); } this.compute_aggregates(); return; } + + this.dataset.index = _(this.dataset.ids).indexOf(ids[0]); + if (this.sidebar) { this.sidebar.do_unfold(); } + this.compute_aggregates(_(records).map(function (record) { return {count: 1, values: record}; })); @@ -1259,9 +1261,11 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L if (column.meta) { // do not do anything } else if (column.id in group.aggregates) { - var value = group.aggregates[column.id]; + var r = {}; + r[column.id] = {value: group.aggregates[column.id]}; $('<td class="oe-number">') - .html(openerp.web.format_value(value, column)) + .html(openerp.web.format_cell( + r, column, {process_modifiers: false})) .appendTo($row); } else { $row.append('<td>'); diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index 1c6694ed930..6039e4a0822 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -224,21 +224,25 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView# active_model: self.dataset.model, active_id: id, active_ids: [id]}; - this.rpc('/web/treeview/action', { + return this.rpc('/web/treeview/action', { id: id, model: this.dataset.model, context: new openerp.web.CompoundContext( this.dataset.get_context(), local_context) - }, function (actions) { + }).pipe(function (actions) { if (!actions.length) { return; } var action = actions[0][2]; var c = new openerp.web.CompoundContext(local_context); if (action.context) { c.add(action.context); } - action.context = c; - self.do_action(action); - }); + return self.rpc('/web/session/eval_domain_and_context', { + contexts: [c], domains: [] + }).pipe(function (res) { + action.context = res.context; + return self.do_action(action); + }, null); + }, null); }, // show & hide the contents diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 08887e5b837..c8a2b4d920f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -143,7 +143,7 @@ <option t-att-value="db"><t t-esc="db"/></option> </t> </select> - <input t-if="!db_list" name="drop_db" class="required" + <input t-if="!db_list" name="backup_db" class="required" type="text" autofocus="autofocus"/> </td> </tr> |
