From 404ac17e0e3ad75ba0306e64f5231260c2cd9aab Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 17 Feb 2012 10:35:41 +0100 Subject: [FIX] evaluate compound context from treeview before executing action not actually sure if ActionManager#do_action is supposed to get a literal or a nonliteral context at this point... but ViewManager(Action) does not seem to like nonlit contexts at all so... lp bug: https://launchpad.net/bugs/933360 fixed bzr revid: xmo@openerp.com-20120217093541-pudzg8x4u1dhbkjf --- addons/web/static/src/js/view_tree.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index dea53793ffb..f0fc046a2f0 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 -- cgit v1.2.3 From 39d514678cdf26fb131745c2d733bcd202b1b0cf Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 17 Feb 2012 11:56:36 +0100 Subject: [imp] repaired illogic al's code bzr revid: nicolas.vanhoren@openerp.com-20120217105636-61tk67zbx9calc1b --- addons/web/static/src/js/chrome.js | 1 - 1 file changed, 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index ba31ec81846..72227c45dff 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1075,7 +1075,6 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC }, start: function() { var self = this; - this.$element = $(document.body); if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { this.$element.addClass("kitten-mode-activated"); this.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) { -- cgit v1.2.3 From feaade623ab11807b837dbf392608f9df25dd930 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 17 Feb 2012 12:01:52 +0100 Subject: [imp] put openerp into body bzr revid: nicolas.vanhoren@openerp.com-20120217110152-x66rfhyfkqao04k0 --- addons/web/static/src/css/base.css | 3 ++- addons/web/static/src/js/chrome.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2a27e61eb3d..324cc3fb108 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,7 +1,8 @@ -body.openerp { +body { padding: 0; margin: 0; overflow-y: scroll; + height: 100%; } .openerp { padding: 0; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 72227c45dff..1ce93216120 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1073,6 +1073,9 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC this._current_state = null; }, + render_element: function() { + this.$element.addClass("openerp"); + }, start: function() { var self = this; if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { -- cgit v1.2.3 From 0d061d6c77b30e137d7650d63155297e5695979c Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 17 Feb 2012 12:43:57 +0100 Subject: [fix] added openerp class to all dialogs bzr revid: nicolas.vanhoren@openerp.com-20120217114357-5jeue9292eg2zoqf --- addons/web/static/src/js/chrome.js | 18 ++++++++++++------ addons/web/static/src/js/data_import.js | 2 +- addons/web/static/src/js/search.js | 4 ++-- addons/web/static/src/js/view_form.js | 6 +++--- addons/web/static/src/js/views.js | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1ce93216120..558631c6f13 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -45,6 +45,12 @@ openerp.web.Notification = openerp.web.OldWidget.extend(/** @lends openerp.web. }); +openerp.web.dialog = function(element) { + var result = element.dialog.apply(element, _.rest(_.toArray(arguments))); + result.dialog("widget").addClass("openerp"); + return result; +} + openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# */{ dialog_title: "", /** @@ -86,7 +92,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# if (this.dialog_options.autoOpen) { this.open(); } else { - this.$element.dialog(this.get_options()); + openerp.web.dialog(this.$element, this.get_options()); } }, get_options: function(options) { @@ -125,7 +131,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# this.$element.html(this.render()); } var o = this.get_options(options); - this.$element.dialog(o).dialog('open'); + openerp.web.dialog(this.$element, o).dialog('open'); if (o.height === 'auto' && o.max_height) { this.$element.css({ 'max-height': o.max_height, 'overflow-y': 'auto' }); } @@ -166,7 +172,7 @@ openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({ } }, on_managed_error: function(error) { - $('
' + QWeb.render('CrashManagerWarning', {error: error}) + '
').dialog({ + openerp.web.dialog($('
' + QWeb.render('CrashManagerWarning', {error: error}) + '
'), { title: "OpenERP " + _.str.capitalize(error.type), buttons: [ {text: _t("Ok"), click: function() { $(this).dialog("close"); }} @@ -407,7 +413,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab * @param {String} error.error message of the error dialog */ display_error: function (error) { - return $('
').dialog({ + return openerp.web.dialog($('
'), { modal: true, title: error.title, buttons: [ @@ -704,7 +710,7 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header window.location = $.param.querystring( window.location.href, 'debug'); }); - $help.dialog({autoOpen: true, + openerp.web.dialog($help, {autoOpen: true, modal: true, width: 960, title: _t("About")}); }); }, @@ -828,7 +834,7 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header }); }, display_error: function (error) { - return $('
').dialog({ + return openerp.web.dialog($('
'), { modal: true, title: error.title, buttons: [ diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index 83eea2cccbb..e88ba765200 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -151,7 +151,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ }); }, toggle_import_button: function (newstate) { - this.$element.dialog('widget') + openerp.web.dialog(this.$element, 'widget') .find('.oe-dialog-import-button') .button('option', 'disabled', !newstate); }, diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 74ae65785f9..9cd3aca19f4 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -232,7 +232,7 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea context.add({"group_by": groupbys}); var dial_html = QWeb.render("SearchView.managed-filters.add"); var $dial = $(dial_html); - $dial.dialog({ + openerp.web.dialog($dial, { modal: true, title: _t("Filter Entry"), buttons: [ @@ -281,7 +281,7 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea selected_menu_id : menu.$element.find('a.active').data('menu') })); $dialog.find('input').val(this.fields_view.name); - $dialog.dialog({ + openerp.web.dialog($dialog, { modal: true, title: _t("Add to Dashboard"), buttons: [ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3f576089e5b..df59fdb3432 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -422,7 +422,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.on_form_changed(); } if (!_.isEmpty(result.warning)) { - $(QWeb.render("CrashManagerWarning", result.warning)).dialog({ + openerp.web.dialog($(QWeb.render("CrashManagerWarning", result.warning)), { modal: true, buttons: [ {text: _t("Ok"), click: function() { $(this).dialog("close"); }} @@ -1249,7 +1249,7 @@ openerp.web.form.WidgetButton = openerp.web.form.Widget.extend({ var exec_action = function() { if (self.node.attrs.confirm) { var def = $.Deferred(); - var dialog = $('
' + self.node.attrs.confirm + '
').dialog({ + var dialog = openerp.web.dialog($('
' + self.node.attrs.confirm + '
'), { title: _t('Confirm'), modal: true, buttons: [ @@ -3026,7 +3026,7 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp this.context = context || {}; this.options = _.defaults(options || {}, {"auto_write": true}); this.render_element(); - this.$element.dialog({ + openerp.web.dialog(this.$element, { title: options.title || '', modal: true, width: 960, diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 56997190bc1..534f940b56d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -916,7 +916,7 @@ session.web.Sidebar = session.web.OldWidget.extend({ var ids = self.widget_parent.get_selected_ids(); if (ids.length == 0) { //TODO: make prettier warning? - $("
").text(_t("You must choose at least one record.")).dialog({ + openerp.web.dialog($("
").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); -- cgit v1.2.3 From 9b1591c819dbb0a572951d803a93e99c4c6d5217 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 17 Feb 2012 14:45:23 +0100 Subject: [fix] added openerp style to autocomplete in m2o bzr revid: nicolas.vanhoren@openerp.com-20120217134523-bleeq4c1x3skjn4t --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index df59fdb3432..fc641521e3d 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2043,6 +2043,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ minLength: 0, delay: 0 }); + this.$input.autocomplete("widget").addClass("openerp"); // used to correct a bug when selecting an element by pushing 'enter' in an editable list this.$input.keyup(function(e) { if (e.which === 13) { -- cgit v1.2.3 From 8036408be55ab9ff3a5b1b6bf1b6241236277b8e Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 20 Feb 2012 10:52:38 +0100 Subject: [imp] made the body css properties be included only in full web-client mode bzr revid: nicolas.vanhoren@openerp.com-20120220095238-lxwtctbpo46ekpul --- addons/web/static/src/css/base.css | 6 ------ addons/web/static/src/css/full.css | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 addons/web/static/src/css/full.css (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 324cc3fb108..1fac47d128c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,9 +1,3 @@ -body { - padding: 0; - margin: 0; - overflow-y: scroll; - height: 100%; -} .openerp { padding: 0; margin: 0; diff --git a/addons/web/static/src/css/full.css b/addons/web/static/src/css/full.css new file mode 100644 index 00000000000..7f3a2f60ea4 --- /dev/null +++ b/addons/web/static/src/css/full.css @@ -0,0 +1,6 @@ +body { + padding: 0; + margin: 0; + overflow-y: scroll; + height: 100%; +} \ No newline at end of file -- cgit v1.2.3 From 571aac869c0c2383a23b0980baf81507e885fd17 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 20 Feb 2012 11:09:58 +0100 Subject: [fix] problem with reference fields lp bug: https://launchpad.net/bugs/934330 fixed bzr revid: nicolas.vanhoren@openerp.com-20120220100958-bujk0yuftdlzk3fz --- addons/web/static/src/js/view_form.js | 4 ++++ addons/web/static/src/xml/base.xml | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index fc641521e3d..f92db55f8e8 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3147,7 +3147,11 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ }, start: function() { this._super(); + this.selection.$element = $(".oe_form_view_reference_selection", this.$element); + this.selection.render_element(); this.selection.start(); + this.m2o.$element = $(".oe_form_view_reference_m2o", this.$element); + this.m2o.render_element(); this.m2o.start(); }, is_valid: function() { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 2d867c25390..8dae18b2915 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1105,11 +1105,9 @@ - -
- + - +
-- cgit v1.2.3 From 79a8b39369e3ee8636c493ba8784fdf5becb9110 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 20 Feb 2012 12:57:04 +0100 Subject: [FIX] avoid adding session_id and token fields in form if they are already there, reuse existing fields instead lp bug: https://launchpad.net/bugs/936704 fixed bzr revid: xmo@openerp.com-20120220115704-zxo024voy3dxa7qe --- addons/web/static/src/js/core.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index c4e37a8a3b1..106d2b86dc9 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -884,9 +884,12 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. _(_.extend({}, options.data || {}, {session_id: this.session_id, token: token})) .each(function (value, key) { - $('') - .val(value) - .appendTo($form_data); + var $input = $form.find('[name=' + key +']'); + if (!$input.length) { + $input = $('') + .appendTo($form_data); + } + $input.val(value) }); $form -- cgit v1.2.3 From 5d71f85f7d46da261a165f5fe311383bb8eb8a97 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 20 Feb 2012 13:22:08 +0100 Subject: [FIX] Broken reference field lp bug: https://launchpad.net/bugs/936864 fixed bzr revid: fme@openerp.com-20120220122208-k5pvpwodik78hnrq --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 640fff67293..6b7acd5a244 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3090,7 +3090,7 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ }; this.get_fields_values = view.get_fields_values; this.get_selected_ids = view.get_selected_ids; - this.do_onchange = this.on_form_changed = this.on_nop; + this.do_onchange = this.on_form_changed = this.do_notify_change = this.on_nop; this.dataset = this.view.dataset; this.widgets_counter = 0; this.view_id = 'reference_' + _.uniqueId(); -- cgit v1.2.3 From c02edfb523231ae48364fe07606f1614c3caec50 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 20 Feb 2012 15:43:22 +0100 Subject: [FIX] Broken reference field lp bug: https://launchpad.net/bugs/936864 fixed bzr revid: fme@openerp.com-20120220144322-e6ysl3qxsdhagls5 --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index f92db55f8e8..fcad37b8ff4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3116,7 +3116,7 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ }; this.get_fields_values = view.get_fields_values; this.get_selected_ids = view.get_selected_ids; - this.do_onchange = this.on_form_changed = this.on_nop; + this.do_onchange = this.on_form_changed = this.do_notify_change = this.on_nop; this.dataset = this.view.dataset; this.widgets_counter = 0; this.view_id = 'reference_' + _.uniqueId(); -- cgit v1.2.3 From 383f1750c53cae05210b143ba2457ea541d579d6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 10:58:56 +0100 Subject: [imp] wip bzr revid: nicolas.vanhoren@openerp.com-20120221095856-656l1so4ejc06gih --- addons/web/static/src/js/view_form.js | 4 +++- addons/web/static/src/js/view_list_editable.js | 24 ++++++++++----------- addons/web/static/src/xml/base.xml | 29 +++++++++++++------------- 3 files changed, 28 insertions(+), 29 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index fcad37b8ff4..9e6c5396091 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -103,7 +103,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# this.$element.html(this.rendered); this.root_frame = instanciate_widget(this.registry.get_object('frame'), this, this.fields_view.arch); - this.root_frame.appendTo($(".oe_form_header", this.$element)); + var to_append = $(".oe_form_header", this.$element); + this.root_frame.appendTo(to_append.length > 0 ? to_append : this.$element); + this.root_frame.$element.children().unwrap(); this.$form_header = this.$element.find('.oe_form_header:first'); this.$form_header.find('div.oe_form_pager button[data-pager-action]').click(function() { diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index c7222455889..de19fcdc3cd 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -202,7 +202,7 @@ openerp.web.list_editable = function (openerp) { var $new_row = $('', { id: _.uniqueId('oe-editable-row-'), 'data-id': record_id, - 'class': row ? $(row).attr('class') : '' + ' oe_forms', + 'class': row ? $(row).attr('class') : '' + ' oe_forms oe_form_header', click: function (e) {e.stopPropagation();} }) .delegate('button.oe-edit-row-save', 'click', function () { @@ -235,13 +235,10 @@ openerp.web.list_editable = function (openerp) { } self.edition = true; self.edition_id = record_id; - self.edition_form = _.extend(new openerp.web.ListEditableFormView(self.view, self.dataset, false), { - form_template: 'ListView.row.form', - registry: openerp.web.list.form.widgets, - $element: $new_row - }); - // HA HA - self.edition_form.appendTo(); + self.edition_form = new openerp.web.ListEditableFormView(self.view, self.dataset, false); + self.edition_form.$element = $new_row; + // HO HO + // empty $.when(self.edition_form.on_loaded(self.get_form_fields_view())).then(function () { // put in $.when just in case FormView.on_loaded becomes asynchronous $new_row.find('> td') @@ -383,7 +380,7 @@ openerp.web.list_editable = function (openerp) { openerp.web.list.form = {}; } openerp.web.list.form.WidgetFrame = openerp.web.form.WidgetFrame.extend({ - template: 'ListView.row.frame' + form_template: 'ListView.row.frame' }); var form_widgets = openerp.web.form.widgets; openerp.web.list.form.widgets = form_widgets.extend({ @@ -418,9 +415,10 @@ openerp.web.list_editable = function (openerp) { }); openerp.web.ListEditableFormView = openerp.web.FormView.extend({ - init_view: function() {}, - _render_and_insert: function () { - return this.start(); - } + form_template: 'ListView.row.form', + init: function() { + this._super.apply(this, arguments); + this.registry = openerp.web.list.form.widgets; + }, }); }; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 8dae18b2915..10779ee5994 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -728,7 +728,6 @@ - @@ -1519,21 +1518,21 @@ - - - $(document.createElement('t')) - .append(this.contents()) - .attr({ - 't-foreach': this.attr('t-foreach'), - 't-as': this.attr('t-as') - }) - .replaceAll(this) - .after($(document.createElement('td')).append( - $(document.createElement('button')).attr({ - 'class': 'oe-edit-row-save', 'type': 'button'}) - .html(' '))) - .unwrap(); + + + + + + + + + + -- cgit v1.2.3 From 4f09c66c3b1b7858faf45c04e782210a536c0073 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 11:15:22 +0100 Subject: [imp] removed useless class bzr revid: nicolas.vanhoren@openerp.com-20120221101522-c9hkpg381cz6j5l4 --- addons/web/static/src/js/view_list_editable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index de19fcdc3cd..6942f720863 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -202,7 +202,7 @@ openerp.web.list_editable = function (openerp) { var $new_row = $('', { id: _.uniqueId('oe-editable-row-'), 'data-id': record_id, - 'class': row ? $(row).attr('class') : '' + ' oe_forms oe_form_header', + 'class': row ? $(row).attr('class') : '' + ' oe_forms', click: function (e) {e.stopPropagation();} }) .delegate('button.oe-edit-row-save', 'click', function () { -- cgit v1.2.3 From efb48237bb23fc646ffb48db511ba2f36b10071f Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 11:52:29 +0100 Subject: [imp] improved html generation in editable lists bzr revid: nicolas.vanhoren@openerp.com-20120221105229-h7609f8boalmvl6q --- addons/web/static/src/js/view_list_editable.js | 9 +-------- addons/web/static/src/xml/base.xml | 5 +++-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 6942f720863..55f710d69ab 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -237,21 +237,14 @@ openerp.web.list_editable = function (openerp) { self.edition_id = record_id; self.edition_form = new openerp.web.ListEditableFormView(self.view, self.dataset, false); self.edition_form.$element = $new_row; + self.edition_form.editable_list = self; // HO HO // empty $.when(self.edition_form.on_loaded(self.get_form_fields_view())).then(function () { // put in $.when just in case FormView.on_loaded becomes asynchronous $new_row.find('> td') - .addClass('oe-field-cell') - .removeAttr('width') .end() .find('td:last').removeClass('oe-field-cell').end(); - if (self.options.selectable) { - $new_row.prepend(' + + @@ -1522,9 +1524,8 @@ -- cgit v1.2.3 From f4b4ef50887573f14689e59be7a3e6adfc1ba618 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 11:52:29 +0100 Subject: [imp] improved html generation in editable lists bzr revid: nicolas.vanhoren@openerp.com-20120221105229-xrxcjwx2jtteh444 --- addons/web/static/src/js/view_list_editable.js | 9 +-------- addons/web/static/src/xml/base.xml | 5 +++-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 6942f720863..55f710d69ab 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -237,21 +237,14 @@ openerp.web.list_editable = function (openerp) { self.edition_id = record_id; self.edition_form = new openerp.web.ListEditableFormView(self.view, self.dataset, false); self.edition_form.$element = $new_row; + self.edition_form.editable_list = self; // HO HO // empty $.when(self.edition_form.on_loaded(self.get_form_fields_view())).then(function () { // put in $.when just in case FormView.on_loaded becomes asynchronous $new_row.find('> td') - .addClass('oe-field-cell') - .removeAttr('width') .end() .find('td:last').removeClass('oe-field-cell').end(); - if (self.options.selectable) { - $new_row.prepend(' + + @@ -1522,9 +1524,8 @@ -- cgit v1.2.3 From fbf4c6dc0f815b69ab07a8f9c1765e9ab6e858ba Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 21 Feb 2012 15:05:17 +0100 Subject: [FIX] incorrect handling of saved filter group_by when not present or an array bzr revid: xmo@openerp.com-20120221140517-fs0axg9w8irapw06 --- addons/web/static/src/js/search.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 74ae65785f9..2809b3792de 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 { -- cgit v1.2.3 From a6f6b7fd9dd636bde823b39edc309f69eb994d6d Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:22:12 +0100 Subject: [imp] added setParent bzr revid: nicolas.vanhoren@openerp.com-20120221152212-yr6iaa2znq37mcsz --- addons/web/static/src/js/core.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 086f7f3b56a..647a8713dff 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1006,6 +1006,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W this.$element = $(document.createElement(this.tag_name)); + this.setParent(parent); + }, + setParent: function(parent) { this.widget_parent = parent; this.widget_children = []; if(parent && parent.widget_children) { -- cgit v1.2.3 From 8384876ef08ae3e8af97a9531da7f79a8359d607 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:30:23 +0100 Subject: [imp] renamed widget_parent to getParent() bzr revid: nicolas.vanhoren@openerp.com-20120221153023-cqs66neaddtuf7km --- addons/web/static/src/js/chrome.js | 10 +++++----- addons/web/static/src/js/core.js | 3 +++ addons/web/static/src/js/data_import.js | 4 ++-- addons/web/static/src/js/search.js | 14 +++++++------- addons/web/static/src/js/view_form.js | 2 +- addons/web/static/src/js/view_list.js | 2 +- addons/web/static/src/js/views.js | 34 ++++++++++++++++----------------- 7 files changed, 36 insertions(+), 33 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 558631c6f13..bbaad17c60c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -261,7 +261,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin $(".loading",this.$element).text(_.str.sprintf( _t("Loading (%d)"), this.count)); $(".loading",this.$element).show(); - this.widget_parent.$element.addClass('loading'); + this.getParent().$element.addClass('loading'); } else { this.count = 0; clearTimeout(this.long_running_timer); @@ -271,7 +271,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin $.unblockUI(); } $(".loading",this.$element).fadeOut(); - this.widget_parent.$element.removeClass('loading'); + this.getParent().$element.removeClass('loading'); } } }); @@ -381,7 +381,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab var admin = result[1][0]; setTimeout(function () { - self.widget_parent.do_login( + self.getParent().do_login( info.db, admin.login, admin.password); self.stop(); self.unblockUI(); @@ -437,7 +437,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab if (self.db_list) { self.db_list.push(self.to_object(fields)['db_name']); self.db_list.sort(); - self.widget_parent.set_db_list(self.db_list); + self.getParent().set_db_list(self.db_list); } var form_obj = self.to_object(fields); self.wait_for_newdb(result, { @@ -469,7 +469,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab $db_list.find(':selected').remove(); if (self.db_list) { self.db_list.splice(_.indexOf(self.db_list, db, true), 1); - self.widget_parent.set_db_list(self.db_list); + self.getParent().set_db_list(self.db_list); } self.do_notify("Dropping database", "The database '" + db + "' has been dropped"); }); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 647a8713dff..dca4ad47d0e 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1017,6 +1017,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W // useful to know if the widget was destroyed and should not be used anymore this.widget_is_stopped = false; }, + getParent: function() { + return this.widget_parent; + }, /** * Renders the current widget and appends it to the given jQuery object or Widget. * diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index e88ba765200..e50f5a7b3db 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -201,8 +201,8 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ return; } if (results['success']) { - if (this.widget_parent.widget_parent.active_view == "list") { - this.widget_parent.reload_content(); + if (this.getParent().getParent().active_view == "list") { + this.getParent().reload_content(); } this.stop(); return; diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 9cd3aca19f4..3645f761e33 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -303,10 +303,10 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea }); self.rpc('/web/searchview/add_to_dashboard', { menu_id: menu_id, - action_id: self.widget_parent.action.id, + action_id: self.getParent().action.id, context_to_save: context, domain: domain, - view_mode: self.widget_parent.active_view, + view_mode: self.getParent().active_view, name: title }, function(r) { if (r === false) { @@ -1173,9 +1173,9 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ props); }, stop: function() { - var parent = this.widget_parent; - if (this.widget_parent.widget_children.length == 1) - this.widget_parent.hide(); + var parent = this.getParent(); + if (this.getParent().widget_children.length == 1) + this.getParent().hide(); this._super(); parent.check_last_element(); }, @@ -1215,8 +1215,8 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** }, stop: function() { var parent; - if (this.widget_parent.widget_children.length == 1) - parent = this.widget_parent; + if (this.getParent().widget_children.length == 1) + parent = this.getParent(); this._super(); if (parent) parent.stop(); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 9e6c5396091..ad72bde16ee 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2782,7 +2782,7 @@ openerp.web.form.Many2ManyListView = openerp.web.ListView.extend(/** @lends open var pop = new openerp.web.form.FormOpenPopup(this); pop.show_element(this.dataset.model, id, this.m2m_field.build_context(), { title: _t("Open: ") + this.name, - readonly: this.widget_parent.is_readonly() + readonly: this.getParent().is_readonly() }); pop.on_write_completed.add_last(function() { self.reload_content(); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index eb13bbd927b..2394e12eb4d 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -96,7 +96,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# if (this._limit === undefined) { this._limit = (this.options.limit || this.defaults.limit - || (this.widget_parent.action || {}).limit + || (this.getParent().action || {}).limit || 80); } return this._limit; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 534f940b56d..3e5ae3b4c8e 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -47,14 +47,14 @@ session.web.ActionManager = session.web.OldWidget.extend({ } }, do_push_state: function(state) { - if (this.widget_parent && this.widget_parent.do_push_state) { + if (this.getParent() && this.getParent().do_push_state) { if (this.inner_action) { state['model'] = this.inner_action.res_model; if (this.inner_action.id) { state['action_id'] = this.inner_action.id; } } - this.widget_parent.do_push_state(state); + this.getParent().do_push_state(state); } }, do_load_state: function(state, warm) { @@ -150,7 +150,7 @@ session.web.ActionManager = session.web.OldWidget.extend({ this.dialog.open(); } else { if(action.menu_id) { - return this.widget_parent.do_action(action, function () { + return this.getParent().do_action(action, function () { session.webclient.menu.open_menu(action.menu_id); }); } @@ -209,7 +209,7 @@ session.web.ActionManager = session.web.OldWidget.extend({ window.open(action.url, action.target === 'self' ? '_self' : '_blank'); }, ir_ui_menu: function (action) { - this.widget_parent.do_action(action); + this.getParent().do_action(action); } }); @@ -680,9 +680,9 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner }); }, do_push_state: function(state) { - if (this.widget_parent && this.widget_parent.do_push_state) { + if (this.getParent() && this.getParent().do_push_state) { state["view_type"] = this.active_view; - this.widget_parent.do_push_state(state); + this.getParent().do_push_state(state); } }, do_load_state: function(state, warm) { @@ -702,7 +702,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner }, shortcut_check : function(view) { var self = this; - var grandparent = this.widget_parent && this.widget_parent.widget_parent; + var grandparent = this.getParent() && this.getParent().getParent(); // display shortcuts if on the first view for the action var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle'); if (!this.action.name || @@ -796,8 +796,8 @@ session.web.Sidebar = session.web.OldWidget.extend({ }, add_default_sections: function() { var self = this, - view = this.widget_parent, - view_manager = view.widget_parent, + view = this.getParent(), + view_manager = view.getParent(), action = view_manager.action; if (this.session.uid === 1) { this.add_section(_t('Customize'), 'customize'); @@ -912,8 +912,8 @@ session.web.Sidebar = session.web.OldWidget.extend({ }, on_item_action_clicked: function(item) { var self = this; - self.widget_parent.sidebar_context().then(function (context) { - var ids = self.widget_parent.get_selected_ids(); + self.getParent().sidebar_context().then(function (context) { + var ids = self.getParent().get_selected_ids(); if (ids.length == 0) { //TODO: make prettier warning? openerp.web.dialog($("
").text(_t("You must choose at least one record.")), { @@ -925,7 +925,7 @@ session.web.Sidebar = session.web.OldWidget.extend({ var additional_context = _.extend({ active_id: ids[0], active_ids: ids, - active_model: self.widget_parent.dataset.model + active_model: self.getParent().dataset.model }, context); self.rpc("/web/action/load", { action_id: item.action.id, @@ -937,7 +937,7 @@ session.web.Sidebar = session.web.OldWidget.extend({ result.result.flags.new_window = true; self.do_action(result.result, function () { // reload view - self.widget_parent.reload(); + self.getParent().reload(); }); }); }); @@ -1111,8 +1111,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{ var self = this; var result_handler = function () { if (on_closed) { on_closed.apply(null, arguments); } - if (self.widget_parent && self.widget_parent.on_action_executed) { - return self.widget_parent.on_action_executed.apply(null, arguments); + if (self.getParent() && self.getParent().on_action_executed) { + return self.getParent().on_action_executed.apply(null, arguments); } }; var context = new session.web.CompoundContext(dataset.get_context(), action_data.context || {}); @@ -1184,8 +1184,8 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{ this.$element.hide(); }, do_push_state: function(state) { - if (this.widget_parent && this.widget_parent.do_push_state) { - this.widget_parent.do_push_state(state); + if (this.getParent() && this.getParent().do_push_state) { + this.getParent().do_push_state(state); } }, do_load_state: function(state, warm) { -- cgit v1.2.3 From cdd8489e4ca4c790cc4772ec1a6edbee4fe8136f Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:44:58 +0100 Subject: [imp] further refactoring of parents bzr revid: nicolas.vanhoren@openerp.com-20120221154458-imbqiywuj91mds9c --- addons/web/static/src/js/core.js | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index dca4ad47d0e..ca4d5f00781 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -974,6 +974,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * That will kill the widget in a clean way and erase its content from the dom. */ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.Widget# */{ + __parented_mixin: true, /** * The name of the QWeb template that will be used for rendering. Must be * redefined in subclasses or the default render() method can not be used. @@ -1009,16 +1010,23 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W this.setParent(parent); }, setParent: function(parent) { - this.widget_parent = parent; - this.widget_children = []; - if(parent && parent.widget_children) { + if(this.getParent()) { + if (this.getParent().__parented_mixin) { + this.getParent().widget_children = _.without(this.getParent().widget_children, this); + } + this.__parented_parent = undefined; + } + this.__parented_parent = parent; + if(parent && parent.__parented_mixin) { + if (!parent.widget_children) + parent.widget_children = []; parent.widget_children.push(this); } // useful to know if the widget was destroyed and should not be used anymore this.widget_is_stopped = false; }, getParent: function() { - return this.widget_parent; + return this.__parented_parent; }, /** * Renders the current widget and appends it to the given jQuery object or Widget. @@ -1120,10 +1128,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W if(this.$element != null) { this.$element.remove(); } - if (this.widget_parent && this.widget_parent.widget_children) { - this.widget_parent.widget_children = _.without(this.widget_parent.widget_children, this); - } - this.widget_parent = null; + this.setParent(undefined); this.widget_is_stopped = true; }, /** @@ -1132,20 +1137,20 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W * If that's not the case this method will simply return `false`. */ do_action: function(action, on_finished) { - if (this.widget_parent) { - return this.widget_parent.do_action(action, on_finished); + if (this.getParent()) { + return this.getParent().do_action(action, on_finished); } return false; }, do_notify: function() { - if (this.widget_parent) { - return this.widget_parent.do_notify.apply(this,arguments); + if (this.getParent()) { + return this.getParent().do_notify.apply(this,arguments); } return false; }, do_warn: function() { - if (this.widget_parent) { - return this.widget_parent.do_warn.apply(this,arguments); + if (this.getParent()) { + return this.getParent().do_warn.apply(this,arguments); } return false; }, -- cgit v1.2.3 From be66f62357f7cf0658a7c04b8cc41c15e38c55c8 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:51:34 +0100 Subject: [imp] changed children bzr revid: nicolas.vanhoren@openerp.com-20120221155134-lej2ren1troagr72 --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/core.js | 13 ++++++++----- addons/web/static/src/js/search.js | 16 ++++++++-------- 3 files changed, 17 insertions(+), 14 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index bbaad17c60c..9c145c95d05 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1152,7 +1152,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC this.loading.appendTo(this.$element); }, destroy_content: function() { - _.each(_.clone(this.widget_children), function(el) { + _.each(_.clone(this.getChildren()), function(el) { el.stop(); }); this.$element.children().remove(); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index ca4d5f00781..d31d27b8fa4 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1012,15 +1012,15 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W setParent: function(parent) { if(this.getParent()) { if (this.getParent().__parented_mixin) { - this.getParent().widget_children = _.without(this.getParent().widget_children, this); + this.getParent().__parented_children = _.without(this.getParent().getChildren(), this); } this.__parented_parent = undefined; } this.__parented_parent = parent; if(parent && parent.__parented_mixin) { - if (!parent.widget_children) - parent.widget_children = []; - parent.widget_children.push(this); + if (!parent.getChildren()) + parent.__parented_children = []; + parent.getChildren().push(this); } // useful to know if the widget was destroyed and should not be used anymore this.widget_is_stopped = false; @@ -1028,6 +1028,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W getParent: function() { return this.__parented_parent; }, + getChildren: function() { + return this.__parented_children || []; + }, /** * Renders the current widget and appends it to the given jQuery object or Widget. * @@ -1122,7 +1125,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W * Destroys the current widget, also destroys all its children before destroying itself. */ stop: function() { - _.each(_.clone(this.widget_children), function(el) { + _.each(_.clone(this.getChildren()), function(el) { el.stop(); }); if(this.$element != null) { diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 3645f761e33..424d21f1d90 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1114,7 +1114,7 @@ openerp.web.search.ExtendedSearch = openerp.web.search.Input.extend({ if(this.$element.closest("table.oe-searchview-render-line").css("display") == "none") { return null; } - return _.reduce(this.widget_children, + return _.reduce(this.getChildren(), function(mem, x) { return mem.concat(x.get_domain());}, []); }, on_activate: function() { @@ -1133,9 +1133,9 @@ openerp.web.search.ExtendedSearch = openerp.web.search.Input.extend({ } }, check_last_element: function() { - _.each(this.widget_children, function(x) {x.set_last_group(false);}); - if (this.widget_children.length >= 1) { - this.widget_children[this.widget_children.length - 1].set_last_group(true); + _.each(this.getChildren(), function(x) {x.set_last_group(false);}); + if (this.getChildren().length >= 1) { + this.getChildren()[this.getChildren().length - 1].set_last_group(true); } } }); @@ -1148,7 +1148,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ }, add_prop: function() { var prop = new openerp.web.search.ExtendedSearchProposition(this, this.fields); - var render = prop.render({'index': this.widget_children.length - 1}); + var render = prop.render({'index': this.getChildren().length - 1}); this.$element.find('.searchview_extended_propositions_list').append(render); prop.start(); }, @@ -1163,7 +1163,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ }); }, get_domain: function() { - var props = _(this.widget_children).chain().map(function(x) { + var props = _(this.getChildren()).chain().map(function(x) { return x.get_proposition(); }).compact().value(); var choice = this.$element.find(".searchview_extended_group_choice").val(); @@ -1174,7 +1174,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ }, stop: function() { var parent = this.getParent(); - if (this.getParent().widget_children.length == 1) + if (this.getParent().getChildren().length == 1) this.getParent().hide(); this._super(); parent.check_last_element(); @@ -1215,7 +1215,7 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** }, stop: function() { var parent; - if (this.getParent().widget_children.length == 1) + if (this.getParent().getChildren().length == 1) parent = this.getParent(); this._super(); if (parent) -- cgit v1.2.3 From 7fcfcbaddbea0da9c17eed388ef5d7af21b9e100 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:55:16 +0100 Subject: [imp] changed is_stopped bzr revid: nicolas.vanhoren@openerp.com-20120221155516-7eczor9bobky9dxq --- addons/web/static/src/js/core.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index d31d27b8fa4..9e9e01428ba 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1022,8 +1022,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W parent.__parented_children = []; parent.getChildren().push(this); } - // useful to know if the widget was destroyed and should not be used anymore - this.widget_is_stopped = false; }, getParent: function() { return this.__parented_parent; @@ -1031,6 +1029,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W getChildren: function() { return this.__parented_children || []; }, + isStopped: function() { + return this.__parented_stopped; + }, /** * Renders the current widget and appends it to the given jQuery object or Widget. * @@ -1132,7 +1133,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W this.$element.remove(); } this.setParent(undefined); - this.widget_is_stopped = true; + this.__parented_stopped = true; }, /** * Informs the action manager to do an action. This supposes that @@ -1162,10 +1163,10 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W var def = $.Deferred().then(success, error); var self = this; openerp.connection.rpc(url, data). then(function() { - if (!self.widget_is_stopped) + if (!self.isStopped()) def.resolve.apply(def, arguments); }, function() { - if (!self.widget_is_stopped) + if (!self.isStopped()) def.reject.apply(def, arguments); }); return def.promise(); -- cgit v1.2.3 From 4ee34acbbec49b6de11b1ef0843b4e6605d60227 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 16:58:06 +0100 Subject: [imp] cosmetic changes bzr revid: nicolas.vanhoren@openerp.com-20120221155806-e6efydx5k7qtppdn --- addons/web/static/src/js/core.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 9e9e01428ba..992c7fef83c 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1029,9 +1029,22 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W getChildren: function() { return this.__parented_children || []; }, - isStopped: function() { + isDestroyed: function() { return this.__parented_stopped; }, + /** + * Destroys the current widget, also destroys all its children before destroying itself. + */ + stop: function() { + _.each(_.clone(this.getChildren()), function(el) { + el.stop(); + }); + if(this.$element != null) { + this.$element.remove(); + } + this.setParent(undefined); + this.__parented_stopped = true; + }, /** * Renders the current widget and appends it to the given jQuery object or Widget. * @@ -1122,19 +1135,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W start: function() { return $.Deferred().done().promise(); }, - /** - * Destroys the current widget, also destroys all its children before destroying itself. - */ - stop: function() { - _.each(_.clone(this.getChildren()), function(el) { - el.stop(); - }); - if(this.$element != null) { - this.$element.remove(); - } - this.setParent(undefined); - this.__parented_stopped = true; - }, /** * Informs the action manager to do an action. This supposes that * the action manager can be found amongst the ancestors of the current widget. @@ -1163,10 +1163,10 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W var def = $.Deferred().then(success, error); var self = this; openerp.connection.rpc(url, data). then(function() { - if (!self.isStopped()) + if (!self.isDestroyed()) def.resolve.apply(def, arguments); }, function() { - if (!self.isStopped()) + if (!self.isDestroyed()) def.reject.apply(def, arguments); }); return def.promise(); -- cgit v1.2.3 From 75d39c7f6a2565419c28bac4397678a6d60c5544 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 17:29:12 +0100 Subject: [imp] renammed stop() bzr revid: nicolas.vanhoren@openerp.com-20120221162912-zheko30qoh84hcoq --- addons/web/static/src/js/chrome.js | 14 ++++++------- addons/web/static/src/js/core.js | 8 ++++---- addons/web/static/src/js/data_import.js | 8 ++++---- addons/web/static/src/js/search.js | 14 ++++++------- addons/web/static/src/js/view_editor.js | 4 ++-- addons/web/static/src/js/view_form.js | 28 +++++++++++++------------- addons/web/static/src/js/view_list_editable.js | 2 +- addons/web/static/src/js/views.js | 12 +++++------ 8 files changed, 45 insertions(+), 45 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 9c145c95d05..060abeefc2c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -148,7 +148,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog# on_resized: function() { //openerp.log("Dialog resized to %d x %d", this.$element.width(), this.$element.height()); }, - stop: function () { + destroy: function () { // Destroy widget this.close(); this.$element.dialog('destroy'); @@ -240,7 +240,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin this.session.on_rpc_request.add_first(this.request_call); this.session.on_rpc_response.add_last(this.response_call); }, - stop: function() { + destroy: function() { this.session.on_rpc_request.remove(this.request_call); this.session.on_rpc_response.remove(this.response_call); this.on_rpc_event(-this.count); @@ -318,7 +318,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab self.hide(); }); }, - stop: function () { + destroy: function () { this.hide(); this.$option_id.empty(); @@ -383,7 +383,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab setTimeout(function () { self.getParent().do_login( info.db, admin.login, admin.password); - self.stop(); + self.destroy(); self.unblockUI(); }); }); @@ -799,7 +799,7 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header var inner_viewmanager = action_manager.inner_viewmanager; inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() .then(function() { - self.dialog.stop(); + self.dialog.destroy(); // needs to refresh interface in case language changed window.location.reload(); }); @@ -1101,7 +1101,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC self.header.do_update(); self.menu.do_reload(); if(self.action_manager) - self.action_manager.stop(); + self.action_manager.destroy(); self.action_manager = new openerp.web.ActionManager(self); self.action_manager.appendTo($("#oe_app")); self.bind_hashchange(); @@ -1153,7 +1153,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC }, destroy_content: function() { _.each(_.clone(this.getChildren()), function(el) { - el.stop(); + el.destroy(); }); this.$element.children().remove(); }, diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 992c7fef83c..63e0e2010c5 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -969,7 +969,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * * And of course, when you don't need that widget anymore, just do: * - * my_widget.stop(); + * my_widget.destroy(); * * That will kill the widget in a clean way and erase its content from the dom. */ @@ -994,7 +994,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W * @extends openerp.web.CallbackEnabled * * @param {openerp.web.Widget} parent Binds the current instance to the given Widget instance. - * When that widget is destroyed by calling stop(), the current instance will be + * When that widget is destroyed by calling destroy(), the current instance will be * destroyed too. Can be null. * @param {String} element_id Deprecated. Sets the element_id. Only useful when you want * to bind the current Widget to an already existing part of the DOM, which is not compatible @@ -1035,9 +1035,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W /** * Destroys the current widget, also destroys all its children before destroying itself. */ - stop: function() { + destroy: function() { _.each(_.clone(this.getChildren()), function(el) { - el.stop(); + el.destroy(); }); if(this.$element != null) { this.$element.remove(); diff --git a/addons/web/static/src/js/data_import.js b/addons/web/static/src/js/data_import.js index e50f5a7b3db..3054a7784c4 100644 --- a/addons/web/static/src/js/data_import.js +++ b/addons/web/static/src/js/data_import.js @@ -66,11 +66,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ this._super(); this.open({ buttons: [ - {text: _t("Close"), click: function() { self.stop(); }}, + {text: _t("Close"), click: function() { self.destroy(); }}, {text: _t("Import File"), click: function() { self.do_import(); }, 'class': 'oe-dialog-import-button'} ], close: function(event, ui) { - self.stop(); + self.destroy(); } }); this.toggle_import_button(false); @@ -204,7 +204,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ if (this.getParent().getParent().active_view == "list") { this.getParent().reload_content(); } - this.stop(); + this.destroy(); return; } @@ -358,7 +358,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({ } return true; }, - stop: function() { + destroy: function() { this.$element.remove(); this._super(); } diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 424d21f1d90..b57dd2e2302 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -552,7 +552,7 @@ openerp.web.search.Widget = openerp.web.OldWidget.extend( /** @lends openerp.web * "Stops" the widgets. Called when the view destroys itself, this * lets the widgets clean up after themselves. */ - stop: function () { + destroy: function () { delete this.view; this._super(); }, @@ -1159,7 +1159,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ _this.add_prop(); }); this.$element.find('.searchview_extended_delete_group').click(function () { - _this.stop(); + _this.destroy(); }); }, get_domain: function() { @@ -1172,7 +1172,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({ _.map(_.range(_.max([0,props.length - 1])), function() { return op; }), props); }, - stop: function() { + destroy: function() { var parent = this.getParent(); if (this.getParent().getChildren().length == 1) this.getParent().hide(); @@ -1210,16 +1210,16 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** _this.changed(); }); this.$element.find('.searchview_extended_delete_prop').click(function () { - _this.stop(); + _this.destroy(); }); }, - stop: function() { + destroy: function() { var parent; if (this.getParent().getChildren().length == 1) parent = this.getParent(); this._super(); if (parent) - parent.stop(); + parent.destroy(); }, changed: function() { var nval = this.$element.find(".searchview_extended_prop_field").val(); @@ -1235,7 +1235,7 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/** select_field: function(field) { var self = this; if(this.attrs.selected != null) { - this.value.stop(); + this.value.destroy(); this.value = null; this.$element.find('.searchview_extended_prop_op').html(''); } diff --git a/addons/web/static/src/js/view_editor.js b/addons/web/static/src/js/view_editor.js index 0258509f172..2c0dc3d70b4 100644 --- a/addons/web/static/src/js/view_editor.js +++ b/addons/web/static/src/js/view_editor.js @@ -1002,10 +1002,10 @@ openerp.web.ViewEditor = openerp.web.OldWidget.extend({ $.when(action_manager.do_action(action)).then(function() { var controller = action_manager.dialog_viewmanager.views['form'].controller; controller.on_button_cancel.add_last(function(){ - action_manager.stop() + action_manager.destroy() }); controller.do_save.add_last(function(){ - action_manager.stop(); + action_manager.destroy(); var value =controller.fields.name.value; self.add_node_dialog.$element.find('select[id=field_value]').append($("").attr("value",value).text(value)); _.detect(self.add_widget,function(widget){ diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index ad72bde16ee..17b9849cd42 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -74,13 +74,13 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# }, this.on_loaded); } }, - stop: function() { + destroy: function() { if (this.sidebar) { - this.sidebar.attachments.stop(); - this.sidebar.stop(); + this.sidebar.attachments.destroy(); + this.sidebar.destroy(); } _.each(this.widgets, function(w) { - w.stop(); + w.destroy(); }); this._super(); }, @@ -923,7 +923,7 @@ openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.fo this.width = this.node.attrs.width; }, - stop: function() { + destroy: function() { this._super.apply(this, arguments); $.fn.tipsy.clear(); }, @@ -2554,7 +2554,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({ this.previous_readonly = this.readonly; if (this.viewmanager) { this.is_loaded = this.is_loaded.pipe(function() { - self.viewmanager.stop(); + self.viewmanager.destroy(); return $.when(self.load_views()).then(function() { self.reload_current_view(); }); @@ -2734,7 +2734,7 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({ this.previous_readonly = this.readonly; if (this.list_view) { this.is_loaded = this.is_loaded.pipe(function() { - self.list_view.stop(); + self.list_view.destroy(); return $.when(self.load_view()).then(function() { self.reload_content(); }); @@ -2866,7 +2866,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope setup_search_view: function(search_defaults) { var self = this; if (this.searchview) { - this.searchview.stop(); + this.searchview.destroy(); } this.searchview = new openerp.web.SearchView(this, this.dataset, false, search_defaults); @@ -2896,7 +2896,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope $buttons.prepend(QWeb.render("SelectCreatePopup.search.buttons")); var $cbutton = $buttons.find(".oe_selectcreatepopup-search-close"); $cbutton.click(function() { - self.stop(); + self.destroy(); }); var $sbutton = $buttons.find(".oe_selectcreatepopup-search-select"); if(self.options.disable_multiple_selection) { @@ -2904,7 +2904,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope } $sbutton.click(function() { self.on_select_elements(self.selected_ids); - self.stop(); + self.destroy(); }); }); }); @@ -2988,7 +2988,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope if (this.created_elements.length > 0) { this.on_select_elements(this.created_elements); } - this.stop(); + this.destroy(); }, on_default_get: function(res) {} }); @@ -2999,7 +2999,7 @@ openerp.web.form.SelectCreateListView = openerp.web.ListView.extend({ }, select_record: function(index) { this.popup.on_select_elements([this.dataset.ids[index]]); - this.popup.stop(); + this.popup.destroy(); }, do_select: function(ids, records) { this._super(ids, records); @@ -3075,12 +3075,12 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp var $nbutton = $buttons.find(".oe_formopenpopup-form-save"); $nbutton.click(function() { self.view_form.do_save().then(function() { - self.stop(); + self.destroy(); }); }); var $cbutton = $buttons.find(".oe_formopenpopup-form-close"); $cbutton.click(function() { - self.stop(); + self.destroy(); }); if (self.options.readonly) { $nbutton.hide(); diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 55f710d69ab..b8699bcc006 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -139,7 +139,7 @@ openerp.web.list_editable = function (openerp) { } cancelled.then(function () { self.view.unpad_columns(); - self.edition_form.stop(); + self.edition_form.destroy(); self.edition_form.$element.remove(); delete self.edition_form; delete self.edition_id; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 3e5ae3b4c8e..08886ddfbe3 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -30,19 +30,19 @@ session.web.ActionManager = session.web.OldWidget.extend({ }, dialog_stop: function () { if (this.dialog) { - this.dialog_viewmanager.stop(); + this.dialog_viewmanager.destroy(); this.dialog_viewmanager = null; - this.dialog.stop(); + this.dialog.destroy(); this.dialog = null; } }, content_stop: function () { if (this.inner_viewmanager) { - this.inner_viewmanager.stop(); + this.inner_viewmanager.destroy(); this.inner_viewmanager = null; } if (this.client_widget) { - this.client_widget.stop(); + this.client_widget.destroy(); this.client_widget = null; } }, @@ -142,7 +142,7 @@ session.web.ActionManager = session.web.OldWidget.extend({ if(on_close) this.dialog.on_close.add(on_close); } else { - this.dialog_viewmanager.stop(); + this.dialog_viewmanager.destroy(); } this.dialog.dialog_title = action.name; this.dialog_viewmanager = new session.web.ViewManagerAction(this, action); @@ -385,7 +385,7 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V setup_search_view: function(view_id, search_defaults) { var self = this; if (this.searchview) { - this.searchview.stop(); + this.searchview.destroy(); } this.searchview = new session.web.SearchView( this, this.dataset, -- cgit v1.2.3 From a7386b589a99197453f1a5311fbf1d388efee3b0 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 21 Feb 2012 17:35:47 +0100 Subject: [imp] extracted parenting into a mixin bzr revid: nicolas.vanhoren@openerp.com-20120221163547-i1ii1frqj9b6ddtp --- addons/web/static/src/js/core.js | 63 +++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 27 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 63e0e2010c5..a02c6767ca3 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -925,6 +925,40 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. } }); +openerp.web.ParentedMixin = { + __parented_mixin: true, + setParent: function(parent) { + if(this.getParent()) { + if (this.getParent().__parented_mixin) { + this.getParent().__parented_children = _.without(this.getParent().getChildren(), this); + } + this.__parented_parent = undefined; + } + this.__parented_parent = parent; + if(parent && parent.__parented_mixin) { + if (!parent.getChildren()) + parent.__parented_children = []; + parent.getChildren().push(this); + } + }, + getParent: function() { + return this.__parented_parent; + }, + getChildren: function() { + return this.__parented_children ? _.clone(this.__parented_children) : []; + }, + isDestroyed: function() { + return this.__parented_stopped; + }, + destroy: function() { + _.each(this.getChildren(), function(el) { + el.destroy(); + }); + this.setParent(undefined); + this.__parented_stopped = true; + }, +}; + /** * Base class for all visual components. Provides a lot of functionalities helpful * for the management of a part of the DOM. @@ -973,8 +1007,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * * That will kill the widget in a clean way and erase its content from the dom. */ -openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.Widget# */{ - __parented_mixin: true, +openerp.web.Widget = openerp.web.CallbackEnabled.extend(openerp.web.ParentedMixin).extend(/** @lends openerp.web.Widget# */{ /** * The name of the QWeb template that will be used for rendering. Must be * redefined in subclasses or the default render() method can not be used. @@ -1009,29 +1042,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W this.setParent(parent); }, - setParent: function(parent) { - if(this.getParent()) { - if (this.getParent().__parented_mixin) { - this.getParent().__parented_children = _.without(this.getParent().getChildren(), this); - } - this.__parented_parent = undefined; - } - this.__parented_parent = parent; - if(parent && parent.__parented_mixin) { - if (!parent.getChildren()) - parent.__parented_children = []; - parent.getChildren().push(this); - } - }, - getParent: function() { - return this.__parented_parent; - }, - getChildren: function() { - return this.__parented_children || []; - }, - isDestroyed: function() { - return this.__parented_stopped; - }, /** * Destroys the current widget, also destroys all its children before destroying itself. */ @@ -1042,8 +1052,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W if(this.$element != null) { this.$element.remove(); } - this.setParent(undefined); - this.__parented_stopped = true; + this._super(); }, /** * Renders the current widget and appends it to the given jQuery object or Widget. -- cgit v1.2.3 From bd4723f66d0e5a68ab48214837fbca98d2d37ca2 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 22 Feb 2012 11:22:34 +0100 Subject: [fix] some details bzr revid: nicolas.vanhoren@openerp.com-20120222102234-k9jjclhmgpalf3qs --- addons/web/static/src/js/core.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index a02c6767ca3..fd0abcb0eb4 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -936,9 +936,9 @@ openerp.web.ParentedMixin = { } this.__parented_parent = parent; if(parent && parent.__parented_mixin) { - if (!parent.getChildren()) + if (!parent.__parented_children) parent.__parented_children = []; - parent.getChildren().push(this); + parent.__parented_children.push(this); } }, getParent: function() { @@ -948,14 +948,14 @@ openerp.web.ParentedMixin = { return this.__parented_children ? _.clone(this.__parented_children) : []; }, isDestroyed: function() { - return this.__parented_stopped; + return this.__parented_destroyed; }, destroy: function() { _.each(this.getChildren(), function(el) { el.destroy(); }); this.setParent(undefined); - this.__parented_stopped = true; + this.__parented_destroyed = true; }, }; @@ -1046,7 +1046,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(openerp.web.ParentedMixi * Destroys the current widget, also destroys all its children before destroying itself. */ destroy: function() { - _.each(_.clone(this.getChildren()), function(el) { + _.each(this.getChildren(), function(el) { el.destroy(); }); if(this.$element != null) { -- cgit v1.2.3 From 10e55d570197d27b78bdbb3502df3a5e85edfe18 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 22 Feb 2012 15:23:23 +0100 Subject: [ADD] Minh's sass playground bzr revid: fme@openerp.com-20120222142323-mg2z3kndzm29xisg --- addons/web/static/src/css/base.css | 2382 -------------------------------- addons/web/static/src/css/base.sass | 3 + addons/web/static/src/css/base_old.css | 2382 ++++++++++++++++++++++++++++++++ addons/web/static/src/js/chrome.js | 2 +- 4 files changed, 2386 insertions(+), 2383 deletions(-) create mode 100644 addons/web/static/src/css/base.sass create mode 100644 addons/web/static/src/css/base_old.css (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 1fac47d128c..e69de29bb2d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,2382 +0,0 @@ -.openerp { - padding: 0; - margin: 0; - height: 100%; - font-size: 80%; - font-family: Ubuntu, Helvetica, sans-serif; -} - -.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, -.openerp button, .openerp .ui-widget { - font-family: Ubuntu, Helvetica, sans-serif; - font-size:85%; -} - -.openerp .view-manager-main-content { - width: 100%; - padding: 0 8px 8px 8px; -} - -.openerp .oe_form_frame_cell .view-manager-main-content { - padding: 0; -} - -.oe_box { - border: 1px solid #aaf; - padding: 2px; - margin: 2px; -} - -#oe_header h2 { - margin: 2px 0; -} - -#oe_errors pre { - margin: 0; -} - -.openerp .oe-listview .oe-number { - text-align: right !important; -} -.oe-listview-header-columns { - background: #d1d1d1; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #d1d1d1 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#d1d1d1)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#d1d1d1',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* W3C */ -} - -.openerp .oe_hide { - display: none !important; -} - -/* STATES */ -.openerp .on_logged, -.openerp .db_options_row { - display: none; -} - -/* Loading */ -.loading { - cursor: wait; -} -.openerp .loading { - display: none; - z-index: 100; - position: fixed; - top: 0; - right: 50%; - padding: 4px 12px; - background: #A61300; - color: white; - text-align: center; - border: 1px solid #900; - border-top: none; - -moz-border-radius-bottomright: 8px; - -moz-border-radius-bottomleft: 8px; - border-bottom-right-radius: 8px; - border-bottom-left-radius: 8px; -} -.openerp .oe_notification { - z-index: 1050; - display: none; -} -.openerp .oe_notification * { - color: white; -} - -/* Login page */ - -.login { - padding: 0; - margin: 0; - font-family: "Lucida Grande", Helvetica, Verdana, Arial; - background: url("/web/static/src/img/pattern.png") repeat; - color: #eee; - font-size: 14px; - height: 100%; -} - -.login ul, ol { - padding: 0; - margin: 0; -} - -.login li { - list-style-type: none; - padding-bottom: 4px; -} - -.login a { - color: #eee; - text-decoration: none; -} - -.login button { - float: right; - display: inline-block; - cursor: pointer; - padding: 6px 16px; - font-size: 13px; - font-family: "Lucida Grande", Helvetica, Verdana, Arial; - border: 1px solid #222222; - color: white; - margin: 0; - background: #600606; - background: -moz-linear-gradient(#b92020, #600606); - background: -webkit-gradient(linear, left top, left bottom, from(#b92020), to(#600606)); - background: -ms-linear-gradient(top, #b92020, #600606); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b92020', endColorstr='#600606',GradientType=0 ); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(155, 155, 155, 0.4) inset; - -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; -} - -.login input, .login select { - width: 252px; - font-size: 14px; - font-family: "Lucida Grande", Helvetica, Verdana, Arial; - border: 1px solid #999999; - background: whitesmoke; - -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); - -box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.login input { - margin-bottom: 9px; - padding: 5px 6px; -} - -.login select { - padding: 1px; -} - -.login .dbpane { - position: fixed; - top: 0; - right: 8px; - padding: 5px 10px; - color: #eee; - border: solid 1px #333; - background: #1e1e1e; - background: rgba(30,30,30,0.94); - -moz-border-radius: 0 0 8px 8px; - -webkit-border-radius: 0 0 8px 8px; - border-radius: 0 0 8px 8px; -} - -.login .bottom { - position: absolute; - top: 50%; - left: 0; - right: 0; - bottom: 0; - text-shadow: 0 1px 1px #999999; - background: #600606; - background: -moz-linear-gradient(#b41616, #600606); - background: -webkit-gradient(linear, left top, left bottom, from(#b41616), to(#600606)); - background: -ms-linear-gradient(top, #b41616, #600606); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b41616', endColorstr='#600606',GradientType=0 ); -} - -.login .pane { - position: absolute; - top: 50%; - left: 50%; - margin: -160px -166px; - border: solid 1px #333333; - background: #1e1e1e; - background: rgba(30,30,30,0.94); - padding: 22px 32px; - text-align: left; - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; - -moz-box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); - -webkit-box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); - -box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); -} - -.login .pane h2 { - margin-top: 0; - font-size: 18px; -} - -.login #logo { - position: absolute; - top: -70px; - left: 0; - width: 100%; - margin: 0 auto; - text-align: center; -} - -.login .footer { - position: absolute; - bottom: -40px; - left: 0; - width: 100%; - text-align: center; -} - -.login .footer a { - font-size: 13px; - margin: 0 8px; -} - -.login .footer a:hover { - text-decoration: underline; -} - -.login .openerp { - font-weight: bold; - font-family: serif; - font-size: 16px; -} - -.openerp .login { - text-align: center; -} - -.openerp .login .login_error_message { - display: none; - background-color: #b41616; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); - color: #eee; - font-size: 14px; - padding: 14px 18px; - margin-top: 15px; - text-align: center; -} - -.openerp .login.login_invalid .login_error_message { - display: inline-block; -} - - - -/* Database */ -.login .oe-database-manager { - display: none; - height: 100%; - width: 100%; - background-color: white; -} -.login.database_block .bottom, -.login.database_block .login_error_message, -.login.database_block .pane { - display: none; -} -.login.database_block .oe-database-manager { - display: block; -} - -.login .database { - float: left; - width: 202px; - height: 100%; - background: #666666; -} -.login .oe_db_options { - margin-left: 202px; - color: black; - padding-top: 20px; -} - -.login .database ul { - margin-top: 65px; -} - -ul.db_options li { - padding: 5px 0 10px 5px; - background: #949292; /* Old browsers */ - background: -moz-linear-gradient(top, #949292 30%, #6d6b6b 95%, #282828 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(30%,#949292), color-stop(95%,#6d6b6b), color-stop(100%,#282828)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* W3C */ - /* for ie9 */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */ - border: none; - /* overriding jquery ui */ - -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; - display: block; - font-weight: bold; - text-transform: uppercase; - margin: 1px; - color: #EEEEEE; - cursor: pointer; - width: 195px; - font-size: 12px; -} - -.db_option_table { - border: 1px solid #5A5858; - padding: 5px; - -moz-border-radius: 10px; -} - -table.db_option_table input.required { - background-color: #D2D2FF !important; -} - -.db_option_table label { - display: block; - text-align: right; -} - -.db_option_table input[type="text"], -.db_option_table input[type="password"], -.db_option_table input[type="file"], -.db_option_table select { - width: 300px; -} - -.option_string { - font-weight: bold; - color: #555; - width: 100%; - text-align: center; - padding: 10px 0; - font-size: large; -} - -label.error { - float: none; - color: red; - padding-left: .5em; - vertical-align: top; -} - -/* Main*/ -.openerp .main_table { - width: 100%; - height: 100%; - background: #f0eeee; -} -.openerp .oe-application { - height: 100%; -} -.openerp .oe-application-container { - width: 100%; - height: 100%; -} - -/* IE Hack - for IE < 9 - * Avoids footer to be placed statically at 100% cutting the middle of the views - * */ -.openerp .oe-application-container { - height: auto\9; - min-height: 100%\9; -} - -/* Menu */ -.openerp .menu { - height: 34px; - background: #cc4e45; /* Old browsers */ - background: -moz-linear-gradient(top, #cc4e45 0%, #b52d20 8%, #7a211a 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cc4e45), color-stop(8%,#b52d20), color-stop(100%,#7a211a)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CC4E45', endColorstr='#7A211A',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* W3C */ -} -.openerp .menu td { - text-align: center; - padding:0; -} -.openerp .menu a { - display:block; - min-width: 60px; - height: 20px; - margin: 3px 2px; - padding: 0 8px; - - background: #bd5e54; /* Old browsers */ - background: -moz-linear-gradient(top, #bd5e54 0%, #90322a 60%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bd5e54), color-stop(60%,#90322a)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BD5E54', endColorstr='#90322A',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #bd5e54 0%,#90322a 60%); /* W3C */ - - border: 1px solid #5E1A14; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - - color: #eee; - text-shadow: #222 0 1px 0; - text-decoration: none; - text-transform: uppercase; - line-height: 20px; - font-weight: bold; - font-size: 75%; - - white-space: nowrap; -} -.openerp .menu a:hover, -.openerp .menu a:focus, -.openerp .menu a.active { - background: #c6c6c6; /* Old browsers */ - background: -moz-linear-gradient(top, #c6c6c6 0%, #5c5c5c 7%, #969595 86%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c6c6c6), color-stop(7%,#5c5c5c), color-stop(86%,#969595)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C6C6C6', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* W3C */ - /* for ie */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5c5c5c', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ - color: #fff; -} -/* Secondary Menu */ -.openerp .secondary_menu .oe_toggle_secondary_menu { - position: absolute; - cursor: pointer; - border-left: 1px solid #282828; - border-bottom: 1px solid #282828; - width: 21px; - height: 21px; - z-index: 10; - background: transparent; - color: white; - text-shadow: 0 1px 0 #333; - text-align: center; - font-size: 18px; - line-height: 18px; - right: 0; -} -.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu { - position: static; - border-left: none; - border-bottom: 1px solid #282828; - width: 21px; - height: 21px; - background: #818181; -} -.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu span.oe_menu_fold { - display: none; -} -.openerp .secondary_menu.oe_unfolded .oe_toggle_secondary_menu span.oe_menu_unfold { - display: none; -} -.openerp .secondary_menu { - width: 200px; - min-width: 200px; - border-right: 1px solid #3C3C3C; - border-bottom: 1px solid #5A5858; - background: #5A5858; - vertical-align: top; - height: 100%; - display: block; - position: relative; - font-size:85%; -} -.openerp .secondary_menu.oe_folded { - width: 20px; - min-width: 20px; - position: static; -} -.openerp .secondary_menu.oe_folded .oe_secondary_menu.active { - position: absolute; - z-index: 100; - border: 4px solid #585858; - border-color: rgba(88, 88, 88, .5); - border-radius: 4px; - min-width: 200px; -} -.openerp .secondary_menu a { - display: block; - padding: 0 5px 2px 5px; - line-height: 20px; - text-decoration: none; - white-space: nowrap; - color: white; - text-shadow: 0 1px 0 #333; -} -.openerp .oe_secondary_submenu { - background: #5A5858; -} -.openerp .secondary_menu a.oe_secondary_menu_item { - background: #949292; /* Old browsers */ - background: -moz-linear-gradient(top, #949292 0%, #6d6b6b 87%, #282828 99%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#949292), color-stop(87%,#6d6b6b), color-stop(99%,#282828)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* W3C */ - /* for ie9 */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */ - white-space: nowrap; - color: white; - text-shadow: 0 1px 0 #333; - -} -.openerp a.oe_secondary_submenu_item { - padding: 0 5px 2px 10px; -} -.openerp a.oe_secondary_submenu_item, -.openerp a.oe_secondary_menu_item { - overflow: hidden; - text-overflow: ellipsis; -} -.openerp a.oe_secondary_submenu_item:hover, -.openerp a.oe_secondary_submenu_item.leaf.active { - display: block; - background: #ffffff; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #d8d8d8 11%, #afafaf 86%, #333333 91%, #5a5858 96%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(11%,#d8d8d8), color-stop(86%,#afafaf), color-stop(91%,#333333), color-stop(96%,#5a5858)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#5A5858',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* W3C */ - padding: 0 5px 2px 10px; - line-height: 20px; - color: #3f3d3d; - text-decoration: none; - text-shadow: #fff 0 1px 0; -} -.openerp a.oe_secondary_submenu_item.submenu.opened span:before { - content: "\25be"; -} -.openerp a.oe_secondary_submenu_item.submenu span:before { - content: "\25b8"; -} - -/* Header */ -.openerp .header { - height: 65px; - background: url("/web/static/src/img/header-background.png") repeat-x scroll left top transparent; - color: #FFFFFF; - letter-spacing: 0.5px; - text-shadow: 0 1px 0 #333333; -} -.openerp .company_logo_link { - display: block; - float: left; - height: 63px; - width: 200px; - border: 1px solid white; - border-right-color: black; - border-bottom-color: black; - background: #FFFFFF; - background: -moz-linear-gradient(top, #FFFFFF 0%, #CECECE 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CECECE)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CECECE',GradientType=0 ); -} -.openerp .company_logo { - margin-top: 7px; - margin-left: 10px; - display: block; - background: url(/web/static/src/img/logo.png); - width:180px; - height:46px; -} -.openerp .header_title { - float: left; - font-size: 100%; - margin: 0; - padding: 4px 10px; - text-shadow: 0 1px 0 #111111; - font-weight:normal; - line-height:14px; -} -.openerp .header_title small { - color: #ccc; - font-size: 90%; - font-weight: normal; -} -.openerp .header_corner { - float: right; -} -.openerp .header_corner .block { - float: left; - height: 34px; - line-height: 34px; - /*background: url(../images/top-sep-a.png) no-repeat;*/ - border-left: 1px solid #6a6a6a; - background: #828282; - background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 ); -} -.openerp .header_corner .block a { - display: block; - color: white; - text-decoration: none; - padding: 0 10px; -} -.openerp .header_corner .block a:hover { - background: #929292; - background: -moz-linear-gradient(top, #929292 0%, #4D4D4D 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#929292), color-stop(100%,#4D4D4D)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#929292', endColorstr='#4D4D4D',GradientType=0 ); -} -.openerp .header_corner ul.block { - list-style: none; - height: 34px; - margin: 0; - padding: 0 0 0 2px; - line-height: 33px; -} -.openerp .header_corner ul.block li { - float: left; -} -.openerp .header_corner ul.block li a { - padding: 0 5px; - position: relative; - line-height: 32px; -} -.openerp .header_corner ul.block li a img { - vertical-align: middle; -} -.openerp .header_corner ul.block li a small { - position: absolute; - right: 0; - top: 5px; - padding: 1px 4px 2px; - background: rgba(0, 0, 0, 0.75); - border-radius: 7px; - -moz-border-radius: 7px; - -webkit-border-radius: 7px; - line-height: 1em; - font-weight: bold; -} - -.openerp .logout { - font-size:80%; -} - -/* Footer */ -.openerp div.oe_footer { - background: none repeat scroll 0 0 #CCCCCC; - overflow: hidden; - padding: 5px 0; - position: relative; - -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); -} -.openerp div.oe_footer p.oe_footer_powered { - left: 50%; - margin: 0; - padding: 0 15px; - color: #666666; - font-weight: bold; - font-size: 0.8em; - text-align: center; -} -.openerp div.oe_footer p.oe_footer_powered a { - text-decoration: none; - color: #666666; -} - - -/* Main Application */ -.openerp .oe-main-content { - padding: 0; - height: 100%; -} - -.openerp h2.oe_view_title { - font-size: 110%; - font-weight: normal; - margin: 2px 0; - color: #252424; - text-shadow: white 0 1px 0; -} -.openerp div[id^="notebook"] .oe_view_title { - font-size:85%; - padding-bottom:4px; -} - -/* View Manager */ -.openerp .oe_vm_switch { - float: right; -} -.openerp .oe-view-manager-header .oe_view_title { - font-size:150%; - padding:2px 0 0 0; -} - -/* SearchView */ -.openerp .oe_searchview_field > div { - position: relative; - white-space: nowrap; -} -.openerp .oe_searchview_field .oe_input_icon { - top: auto; - bottom: 3px; -} - -.openerp .filter_label, .openerp .filter_icon { - background: #F0F0F0; - border: 1px solid #999; - background: -moz-linear-gradient(top, #F0F0F0 0%, #C0C0C0 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F0F0F0), color-stop(100%,#C0C0C0)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F0F0F0', endColorstr='#C0C0C0',GradientType=0 ); -} -.openerp .filter_label:hover, .openerp .filter_icon:hover { - background: #F0F0F0; - background: -moz-linear-gradient(top, #F0F0F0 0%, #A1A7CE 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F0F0F0), color-stop(100%,#A1A7CE)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F0F0F0', endColorstr='#A1A7CE',GradientType=0 ); -} -.openerp .filter_label:active, .openerp .filter_icon:active { - background: #aaa; - background: -moz-linear-gradient(top, #999999 0%, #EEEEEE 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(100%,#EEEEEE)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#999999', endColorstr='#EEEEEE',GradientType=0 ); -} -.openerp .filter_label.enabled, .openerp .filter_icon.enabled { - background: #aaa; - filter: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - -o-box-shadow: none; - box-shadow: none; -} -.openerp .filter_icon { - height: 22px; - padding: 1px 2px 0 2px; - margin: 0; - vertical-align: bottom; -} -.openerp .filter_label { - font-weight: bold; - text-transform: uppercase; - text-shadow: #EEE 0 1px 0; - color: #4C4C4C; - white-space: nowrap; - min-height: 40px; - min-width: 75px; - padding: 2px 4px; - margin: 0; -} -.openerp .filter_label_group { - padding-right: 0.4em; - white-space: nowrap; -} - -.openerp .filter_label_group button { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - border-right: none; -} -.openerp .filter_label_group button:first-child { - -webkit-border-top-left-radius: 7px; - -webkit-border-bottom-left-radius: 7px; - -moz-border-radius-topleft: 7px; - -moz-border-radius-bottomleft: 7px; - border-top-left-radius: 7px; - border-bottom-left-radius: 7px; - border-right: none; -} -.openerp .filter_label_group button:last-child { - -webkit-border-top-right-radius: 7px; - -webkit-border-bottom-right-radius: 7px; - -moz-border-radius-topright: 7px; - -moz-border-radius-bottomright: 7px; - border-top-right-radius: 7px; - border-bottom-right-radius: 7px; - border-right: 1px solid #999; -} -.openerp .filter_label_group button.filter_icon img { - padding: 1px 8px 0 8px; -} -.openerp .filter_label_group button.filter_icon:first-child { - border-left: solid 1px #999; - margin-left: -7px; - -webkit-border-top-left-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 0; - -moz-border-radius-bottomleft: 0; - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} - -.openerp .searchview_group_string { - display: block; - color: #7D7979; - font-weight: bold; - padding: 2px 0 2px 10px; - text-decoration: none; -} -.openerp .searchview_group_string:hover { - background-color: #ccc; -} -.openerp .searchview_group.folded .searchview_group_string { - background: url("/web/static/src/img/ui/group-folded.png") no-repeat scroll 0 50%; -} -.openerp .searchview_group.folded .searchview_group_content { - display: none; -} -.openerp .searchview_group.expanded .searchview_group_string { - background: url("/web/static/src/img/ui/group-expanded.png") no-repeat scroll 0 50%; -} -.openerp .searchview_group.expanded .searchview_group_content { - display: block; - padding-bottom:3px; -} - -.openerp .searchview_group_content .oe_label, .openerp .searchview_group_content .oe_label_help { - font-weight: bold; - color: #4c4c4c; -} - -.openerp .oe-searchview-render-line .oe_label, .openerp .oe-searchview-render-line .oe_label_help { - font-weight: bold; - font-size: 80%; - white-space: nowrap; -} - -.openerp .searchview_extended_group { - padding: 3px; - margin: 2px; -} - -.openerp .searchview_extended_group .oe_adv_filters_and { - border-bottom: 1px solid #8E8E8E; - text-align: center; - margin-top: -10px; -} -.openerp .searchview_extended_group .oe_adv_filters_and span { - background: #F0EEEE; - position: relative; - top: 0.5em; - padding: 0 1em 0 1em; - color: #8E8E8E; -} - -.openerp .searchview_extended_group.last_group .oe_adv_filters_and { - display: none; -} - -.openerp .oe_search-view-buttons { - padding: 2px 0 10px 0; - vertical-align:middle; -} -.openerp .oe_search-view-filters-management { - float: right; -} -.openerp .oe_search-view-filters-management, .openerp .oe_search-view-custom-filter-btn { - float:right; -} - -.openerp .searchview_extended_add_proposition span { - font-size: 0.9em; - background: url(/web/static/src/img/icons/gtk-add.png) repeat-y; - padding-left: 18px; -} - -.openerp .searchview_extended_delete_group { - float:right; - display: none; -} - -.openerp .searchview_extended_delete_prop { - text-decoration: none; -} - -.openerp .searchview_extended_delete_group span, -.openerp .searchview_extended_delete_prop span { - font-size: 0.9em; - background: url(/web/static/src/img/icons/gtk-close.png) repeat-y; - padding-left: 18px; -} -/* List */ -.openerp table.oe-listview-content { - clear: right; - width: 100%; - border-spacing: 0; - border: 1px solid silver; -} - -.openerp .oe-listview thead table { - width: 100%; - border: none; -} -.openerp .oe-listview tr.odd { - background-color: #f3f3f3; -} -.openerp .oe-listview tbody tr:hover { - background-color: #ecebf2; -} -.openerp .oe-listview tbody tr:hover { - background-color: #eae9f0; -} -.openerp .oe-listview thead table tr, -.openerp .oe-listview thead table tr:hover { - background: none; -} - -.openerp .oe-listview > table > tbody > tr > td, -.openerp .oe-listview th { - vertical-align: middle; - text-align: left; - padding: 1px 2px; -} - -.openerp .oe-record-delete button, -.openerp button.oe-edit-row-save { - border: none; - height: 12px; - width: 12px; - background: url("/web/static/src/img/iconset-b-remove.png") no-repeat scroll center center transparent; - cursor: pointer; -} -.openerp button.oe-edit-row-save { - background-image: url('/web/static/src/img/icons/save-document.png'); -} - -/* Could use :not selectors if they were supported by MSIE8... */ -.openerp .oe-listview > table > tbody > tr > td { - border-left: 1px solid #dadada; /*currently commenting to test with no vertical lines in list view*/ -} -.openerp .oe-listview tbody td:first-child, -.openerp .oe-listview tbody td.oe-button, -.openerp .oe-listview tbody td.oe-button, -.openerp .oe-listview tbody th.oe-record-selector, -.openerp .oe-listview tbody td.oe-record-delete { - border-left: none; -} - -.openerp .oe-listview td.oe-record-delete { - text-align: right; -} -.openerp .oe-listview th.oe-sortable { - cursor: pointer; - font-size: 75%; - text-transform: uppercase; - padding: 0; - margin: 0; - padding-left: 3px; - color: #333; -} -.openerp .oe-listview th.oe-sortable .ui-icon { - height: 60%; - margin: -6px 0 0; - display: inline; - display: inline-block; - vertical-align: middle; -} - -.openerp .oe-listview > table > tbody > tr > td { - border-bottom: 1px solid #E3E3E3; -} - - -.openerp .oe-listview td.oe-actions { - border-bottom:none; -} - -.openerp .oe-listview .oe-record-selector, .openerp .oe-listview .oe-record-edit-link { - border-bottom: 1px solid #E3E3E3; -} -.openerp .oe-listview .oe-record-edit-link { - cursor: pointer; -} - -.openerp .oe-listview .oe-field-cell { - cursor: pointer; - margin-top: 0; - margin-bottom: 0; - padding-top: 3px; - padding-bottom: 3px; - font-size: 80%; -} -.openerp .oe-listview .oe-field-cell progress { - width: 100%; -} -.openerp .oe-listview .oe-field-cell.oe-button button, -.openerp .oe-listview .oe_form_button button { - margin: 0; - padding: 0; - border: none; - background: none; - width: 16px; - box-shadow: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; -} -.openerp .oe-listview .oe-field-cell button:active { - opacity: 0.5; -} -.openerp .oe-listview .oe-field-cell button img { - cursor: pointer; -} -.openerp .oe-listview .oe-field-cell button img:hover { - opacity: 0.75; -} - -.openerp .oe-listview .oe-field-cell .oe-listview-button-disabled img { - opacity: 0.5; -} - -.openerp .oe-listview th.oe-actions { - text-align: left; - white-space: nowrap; -} -.openerp .oe-listview th.oe-list-pager { - text-align: right; - white-space: nowrap; -} -.openerp .oe-list-pager .oe-pager-state { - cursor: pointer; - font-size: 90%; - color: #555; -} - -.openerp .oe_button.oe_button_pager, -.openerp .oe-list-pager > span, -.openerp .oe_form_pager > span { - line-height: 17px; - height: 17px; - cursor: pointer; - color: gray; - font-weight: bold; - vertical-align: middle; -} -.openerp .oe_button.oe_button_pager, -.openerp .oe_button.oe_button_pager:disabled { - padding: 0 3px 0 3px; - margin: 0; - height: 17px; -} -.openerp .oe-listview .oe-group-name { - padding-right: 1em; -} -.openerp .oe-listview .oe-group-name, -.openerp .oe-listview .oe-group-pagination { - white-space: nowrap; -} - -.openerp .oe-listview tfoot td { - padding: 3px 3px 0; -} -.openerp .oe-listview .oe-list-footer { - text-align: center; - white-space: nowrap; - color: #444; - font-size: 85%; -} -.openerp .oe-listview .oe-list-footer span { - margin: 0 1em; -} -.openerp .oe-listview .oe-list-footer progress { - vertical-align:-10% !important; - width: 100%; -} - -/** list rounded corners - - rounded corners are a pain on tables: need to round not only table, but - also on the first and last children of the first and last row - */ -.openerp .oe-listview table.oe-listview-content { - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.openerp .oe-listview table.oe-listview-content thead tr:first-child th:first-child { - -webkit-border-top-left-radius: 4px; - -moz-border-radius-topleft: 4px; - border-top-left-radius: 4px; -} -.openerp .oe-listview table.oe-listview-content thead tr:first-child th:last-child { - -webkit-border-top-right-radius: 4px; - -moz-border-radius-topright: 4px; - border-top-right-radius: 4px; -} -.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:first-child, -.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:first-child, -.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child th:first-child { - -webkit-border-bottom-left-radius: 4px; - -moz-border-radius-bottomleft: 4px; - border-bottom-left-radius: 4px; -} -.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:last-child, -.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:last-child, -.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child td:last-child { - -webkit-border-bottom-right-radius: 4px; - -moz-border-radius-bottomright: 4px; - border-bottom-right-radius: 4px; -} - -/* Notebook */ -.openerp .oe_form_notebook { - padding: 0; - background: none; - border-width: 0; -} -.openerp .oe_form_notebook .ui-tabs-panel { - padding: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; -} -.openerp .oe_form_notebook ul.ui-tabs-nav { - padding-left: 0; - background: transparent; - border-width: 0; - border-radius: 0; - -moz-border-radius: 0; - -webkit-border-radius: 0; - line-height: 0.8em; - font-size: 95%; - color: #555; -} -.openerp .oe_form_notebook ul.ui-tabs-nav li { - font-weight: bold; -} -.openerp .oe_form_notebook .ui-tabs-panel { - background: #f9f9f9; - border-width: 1px; -} -.openerp .oe_form_notebook .ui-tabs-selected { - background: #f9f9f9; -} -/* Unedit Form */ -.openerp .field_char, -.openerp .field_date, -.openerp .field_float, -.openerp .field_selection, -.openerp a.oe_form_uri { - vertical-align: middle; - padding-top: 3px; - font-size: 90%; - color: #222; -} -.openerp a.oe_form_uri { - color: #9A0404; - line-height: 12px; -} - - - -/* Form */ -.openerp .oe_form_button_save_dirty { - display: none; -} -.openerp .oe_form_dirty > .oe_form_header > .oe_form_buttons > .oe_form_button_save { - color: white; - background: #dc5f59; - background: -moz-linear-gradient(#dc5f59, #b33630); - background: -webkit-gradient(linear, left top, left bottom, from(#dc5f59), to(#b33630)); - background: -webkit-linear-gradient(#dc5f59, #b33630); - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; - font-weight: bold; -} -.openerp .oe_form_frame_cell input[type="checkbox"] { - margin-top: 3px; - vertical-align: middle; -} -.openerp .oe_form_frame_cell .input[type="text"] { - padding-bottom: 1px; -} - -.openerp table.oe_frame td { - color: #4c4c4c; -} -.openerp td.oe_form_frame_cell { - padding: 2px; - position: relative; -} -.openerp .oe_frame.oe_forms { - clear: both; -} -.openerp table.oe_frame { - color: #4c4c4c; -} -.openerp fieldset.oe_group_box { - border: 1px solid #AAAAAA; - moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - background: #F9F9F9; - padding: 4px; -} -.openerp fieldset.oe_group_box legend { - font-weight: bold; -} -.openerp td.oe_form_frame_cell { - padding: 2px; - position: relative; -} -.openerp td.oe_form_field_translatable, -.openerp td.oe_form_field_many2one, -.openerp td.oe_form_field_date, -.openerp td.oe_form_field_datetime { - white-space: nowrap; -} -.openerp td.oe_form_field_boolean { - padding-top: 4px; -} -.openerp td.oe_form_frame_cell.oe_form_group { - padding: 0; -} -.openerp .required.error { - border: 1px solid #900; -} -.openerp .oe_form_buttons, .openerp .oe_list_buttons { - float: left; -} -.openerp .oe_form_pager, .openerp .oe_list_pager { - float: right; - font-size: 80%; - color: gray; - font-weight: bold; -} - -.openerp .oe_form_pager { - margin-right: 3px; -} - - -.openerp label.oe_label_help, .openerp label.oe_label, -.openerp .oe_form_paragraph, -.openerp .oe_form_field_statusbar, -.openerp .oe_forms input[type="text"], -.openerp .oe_forms input[type="password"], -.openerp .oe_forms input[type="file"], -.openerp .oe_forms select, -.openerp .oe_forms .oe_button, -.openerp .oe_forms textarea { - font-size: 85%; -} - -.openerp label.oe_label_help, .openerp label.oe_label { - display: block; - color: #4c4c4c; - font-weight: normal; -} -.openerp label.oe_label_help { - cursor: help; -} -.openerp .oe_form_frame_cell .oe_label, .openerp .oe_form_frame_cell .oe_label_help { - font-weight: normal; -} -.openerp #tiptip_content { - font-size: 12px; -} -.openerp .oe_tooltip_string { - color: #FD5; - font-weight: bold; - font-size: 13px; -} -.openerp .oe_tooltip_help { - white-space: pre-wrap; -} -.openerp .oe_tooltip_technical { - padding: 0 0 4px 0; - margin: 5px 0 0 15px; - list-style: circle; -} -.openerp .oe_tooltip_technical_title { - font-weight: bold; -} - -.openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help { - margin: 3px 0 0 3px; - white-space: nowrap; -} -.openerp .oe_forms .searchview_group_content label.oe_label, .openerp .searchview_group_content .oe_forms label.oe_label_help { /* making a distinction between labels in search view and other labels */ - margin: 3px 0 0 3px; -} - -.openerp label.oe_label_help span { - font-size: 80%; - color: darkgreen; - vertical-align:top; - position: relative; - top: -4px; - padding: 0 2px; -} -.openerp .oe_align_left { - text-align: left; -} -.openerp .oe_align_right { - text-align: right; -} -.openerp .oe_align_center { - text-align: center; -} -.openerp .oe_forms .oe_form_paragraph { - margin: 3px 0 0 0; - white-space: normal; -} - -.openerp .oe_forms .oe_form_paragraph.oe_multilines { - white-space: pre; -} - -.openerp .oe_form_field_one2many .oe-actions h3.oe_view_title, -.openerp .oe_form_field_one2many_list .oe-actions h3.oe_view_title{ - display: inline; - margin: 0 0.5em 0 0; -} - -.openerp .oe_forms .oe-listview th.oe-sortable .ui-icon, -.openerp .oe_forms .oe-listview th.oe-sortable .ui-icon { - height: 100%; - margin-top: -9px; -} - -.openerp table.oe_frame .oe-listview-content td { - color: inherit; -} - -/* Uneditable Form View */ -.openerp .oe_form_readonly { - -} -.openerp .oe_form_readonly .oe_form_frame_cell .field_text, -.openerp .oe_form_readonly .field_char, -.openerp .oe_form_readonly .field_int, -.openerp .oe_form_readonly .field_float, -.openerp .oe_form_readonly .field_email, -.openerp .oe_form_readonly .field_date, -.openerp .oe_form_readonly .field_selection, -.openerp .oe_forms_readonly .oe_form_field_many2one { - padding: 3px 2px 2px 2px; - background-color: white; - height: 17px; -} -.openerp .oe_form_readonly .oe_form_frame_cell .field_text { - height: auto; -} -.openerp .oe_form_readonly .field_datetime { - padding: 1px 2px 2px 2px; - background-color: white; - height:19px; -} -.openerp .oe_form_readonly .oe_form_field_many2one div { - background-color:white; - height:18px; - margin-bottom:1px; - padding: 0px 2px 5px 2px; -} - -.openerp .oe_form_readonly .oe_form_field_email div { - background-color: white; - padding: 1px 2px 3px 2px; -} - - -.openerp .oe_form_readonly .oe_form_field_text div.field_text, -.openerp .oe_form_readonly .oe_form_field_text_html div.field_text_html { - white-space: pre-wrap; -} -.openerp .oe_form_readonly .oe_form_frame_cell .field_text { - min-height:100px; -} -/* Inputs */ -.openerp .oe_forms input[type="text"], -.openerp .oe_forms input[type="password"], -.openerp .oe_forms input[type="file"], -.openerp .oe_forms select, -.openerp .oe_forms textarea { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - padding: 0 2px; - margin: 0 2px; - border: 1px solid #999; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - background: white; - min-width: 90px; - color: #1f1f1f; -} - -.openerp .oe_forms input.field_many2one, -.openerp .oe_forms input.field_binary, -.openerp .oe_forms input.field_binary, -.openerp .oe_forms input.field_email, -.openerp .oe_forms input.field_url { - border-right: none; - -webkit-border-top-right-radius: 0px; - -webkit-border-bottom-right-radius: 0px; - -moz-border-radius-topright: 0px; - -moz-border-radius-bottomright: 0px; - border-top-right-radius: 0px; - border-bottom-right-radius: 0px; -} -.openerp .oe_button.oe_field_button { - -webkit-border-top-left-radius: 0px; - -webkit-border-bottom-left-radius: 0px; - -moz-border-radius-topleft: 0px; - -moz-border-radius-bottomleft: 0px; - border-top-left-radius: 0px; - border-bottom-left-radius: 0px; - margin-right:-1px; - height: 22px; -} - -.openerp .oe_form_field_email button img, -.openerp .oe_form_field_url button img { - vertical-align: top; -} -/* vertically recentering filter management select tag */ -.openerp select.oe_search-view-filters-management { - margin-top:2px; -} - -.openerp .oe_forms select{ - padding-top: 2px; -} -.openerp .oe_forms input[readonly], -.openerp .oe_forms select[readonly], -.openerp .oe_forms textarea[readonly], -.openerp .oe_forms input[disabled], -.openerp .oe_forms select[disabled], -.openerp .oe_forms textarea[disabled]{ - background: #E5E5E5 !important; - color: #666; -} -.openerp .oe_forms textarea { - resize:vertical; -} -.openerp .oe_forms input[type="text"], -.openerp .oe_forms input[type="password"], -.openerp .oe_forms input[type="file"], -.openerp .oe_forms select, -.openerp .oe_forms .oe_button { - height: 22px; -} - -.openerp .oe_forms input.field_datetime { - min-width: 11em; -} -.openerp .oe_forms .oe_form_button .oe_button { - color: #4c4c4c; - white-space: nowrap; - min-width: 100%; - width: 100%; -} -@-moz-document url-prefix() { - /* Strange firefox behaviour on width: 100% + white-space: nowrap */ - .openerp .oe_forms .oe_form_button .oe_button { - width: auto; - } -} -/* IE Hack - for IE < 9 - * Avoids buttons overflow - * */ -.openerp .oe_forms .oe_form_button .oe_button { - min-width: auto\9; -} -.openerp .oe_forms .button { - height: 22px; -} -.openerp .oe_forms .oe_button span { - position: relative; - vertical-align: top; -} -.openerp .oe_input_icon { - cursor: pointer; - margin: 3px 0 0 -21px; - vertical-align: top; -} -.openerp .oe_datepicker_container { - display: none; -} -.openerp .oe_datepicker_root { - display: inline-block; -} -.openerp .oe_form_frame_cell .oe_datepicker_root { - width: 100%; -} -.openerp .oe_input_icon_disabled { - position: absolute; - cursor: default; - opacity: 0.5; - filter:alpha(opacity=50); - right: 5px; - top: 3px; -} -.openerp .oe_trad_field.touched { - border: 1px solid green !important; -} - -/* http://www.quirksmode.org/dom/inputfile.html - * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image - */ -.openerp .oe-binary-file-set { - overflow: hidden; - position: relative; -} -.openerp input.oe-binary-file { - z-index: 0; - line-height: 0; - font-size: 50px; - position: absolute; - /* Should be adjusted for all browsers */ - top: -2px; - right: 0; - opacity: 0; - filter: alpha(opacity = 0); - -ms-filter: "alpha(opacity=0)"; - margin: 0; - padding:0; -} - -/* Widgets */ -.openerp .separator { - border: 0 solid #666; -} -.openerp .separator.horizontal { - font-weight: bold; - border-bottom-width: 1px; - margin: 3px 4px 3px 1px; - height: 17px; - font-size: 95%; -} -.openerp .separator.horizontal:empty { - height: 5px; -} -.openerp .oe_form_frame_cell.oe_form_separator_vertical { - border-left: 1px solid #666; -} -.openerp td.required input, .openerp td.required select { - background-color: #D2D2FF !important; -} -.openerp td.invalid input, .openerp td.invalid select, .openerp td.invalid textarea { - background-color: #F66 !important; - border: 1px solid #D00 !important; -} -.openerp div.oe-progressbar span { - position: absolute; - margin-left: 10px; - margin-top: 5px; - font-weight: bold; -} - -/* jQuery UI override */ -.openerp .ui-widget { - font-size: 1em; -} -.openerp .oe_form_field_progressbar .ui-progressbar { - height: 22px; - font-size: 10px; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - border: 1px solid #999; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - background: white; - min-width: 90px; -} -.openerp tbody.ui-widget-content { - margin-bottom: 10px; - border-spacing: 4px; -} -.openerp .ui-widget-header { - background: white none; -} -/* progress bars */ -.openerp .ui-progressbar .ui-widget-header { - background: #cccccc url(/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; -} - -/* Sidebar */ -.openerp .view-manager-main-table { - margin: 0; - width:100%; - border-collapse:collapse; - height:100%; -} - -.openerp .view-manager-main-table tbody { - vertical-align: top; -} - -.openerp .oe-view-manager-header { - overflow: auto; - background: url("/web/static/src/img/sep-a.gif") 0 100% repeat-x; - margin:6px 0 6px 2px; -} -.openerp .oe_form_frame_cell .oe-view-manager-header { /* Trick: remove the background when element is in a formular */ - background: none; -} - -.openerp .oe-view-manager-header h2 { - float: left; -} - -.openerp .oe_view_manager_menu_tips blockquote { - display: none; - font-size: 85%; - margin: 0; - background: #fff; - border-bottom: 1px solid #CECBCB; - padding: 1px 10px; - color: #4C4C4C; -} -.openerp .oe_view_manager_menu_tips blockquote p { - margin: 0; - padding: 6px 1px 4px; -} - -.openerp .oe_view_manager_menu_tips blockquote div { - text-align: right; - margin-right:10px; -} - -.openerp .oe_view_manager_menu_tips blockquote div button { - border: none; - background: none; - padding: 0 4px; - margin: 0; - display: inline; - text-decoration: underline; - color: inherit; -} -.openerp .oe-view-manager-logs { - clear: both; - background: #fff; - margin: 0.25em 0; - font-size: 85%; - color: #4C4C4C; - position: relative; - overflow: hidden; -} -.openerp .oe-view-manager-logs ul { - margin: 0; - padding: 0 10px; - list-style: none; -} -.openerp .oe-view-manager-logs li:before { - content: '\2192 '; -} -.openerp .oe-view-manager-logs a { - text-decoration: none; - color: inherit; -} -/* only display first three log items of a folded logs list */ -.openerp .oe-view-manager-logs.oe-folded li:nth-child(n+4) { - display: none; -} -/* display link to more logs if there are more logs to view and the logview is - currently folded */ -.openerp .oe-view-manager-logs a.oe-more-logs { - display: none; -} -.openerp .oe-view-manager-logs.oe-folded.oe-has-more a.oe-more-logs { - display: block; -} -.openerp .oe-view-manager-logs a.oe-remove-everything { - position: absolute; - top: 0; - right: 0; - cursor: pointer; -} - -.openerp .view-manager-main-sidebar { - width: 180px; - padding: 0; - margin: 0; -} - -.openerp .sidebar-main-div { - height: 100%; - border-left: 1px solid #D2CFCF; -} - -.openerp .sidebar-content { - padding: 0; - margin: 0; - width: 180px; - height: 100%; - font-size: 0.9em; -} - -.openerp .closed-sidebar .sidebar-content { - width: 22px; -} - -.openerp .closed-sidebar .sidebar-content { - display: none; -} - -.openerp .sidebar-main-div a { - color: #555; - text-decoration: none; -} - -.openerp .sidebar-main-div a:hover { - color: black; -} - -.openerp .oe-sidebar-attachments-toolbar { - margin: 4px 0 0 4px; -} -.openerp .oe-sidebar-attachments-items { - clear: both; - padding-top: 5px !important; -} -.openerp .oe-sidebar-attachments-items li { - position: relative; - padding: 0 0 3px 10px !important; -} -.openerp .oe-sidebar-attachments-items li:hover { - background: #ddd; -} -.openerp .oe-sidebar-attachments-link { - display: block; - margin-right: 15px; - overflow: hidden; -} -.openerp .oe-sidebar-attachment-delete { - position: absolute; - right: 2px; - top: 1px; - overflow: hidden; - width: 15px; - height: 15px; - padding: 1px; - border-radius: 7px; - -moz-border-radius: 7px; - -webkit-border-radius: 7px; -} -.openerp .oe-sidebar-attachment-delete:hover { - background-color: white; -} - -.openerp .view-manager-main-sidebar h2 { - margin:0; - font-size: 1.15em; - color: #8E8E8E; - text-shadow: white 0 1px 0; - padding-left: 10px; - padding-right: 21px; - height: 21px; - - background: #ffffff; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #ebe9e9 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ebe9e9)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#EBE9E9',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* W3C */ - - border: 1px solid #D2CFCF; - border-right-width: 0; - border-left-width: 0; -} -.openerp .view-manager-main-sidebar h2 { - border-top-width: 0; -} - -.openerp .view-manager-main-sidebar ul { - list-style-type: none; - margin: 0; - padding: 0; - display: block; -} - -.openerp .view-manager-main-sidebar li { - display: block; - padding: 3px 3px 3px 10px; -} - -.openerp .toggle-sidebar { - cursor: pointer; - border: 1px solid #D2CFCF; - border-top-width: 0; - display: block; - background: url(/web/static/src/img/toggle-a-bg.png); - width: 21px; - height: 21px; - z-index: 10; -} -.openerp .open-sidebar .toggle-sidebar { - margin-left: 158px; - background-position: 21px 0; - position: absolute; -} -.openerp .closed-sidebar .toggle-sidebar { - border-left: none; -} -.openerp li.oe_sidebar_print { - padding-left: 20px; - background: 1px 3px url(/web/static/src/img/icons/gtk-print.png) no-repeat; -} - -.openerp .oe_sidebar_print ul { - padding-left:8px; -} - -.openerp.kitten-mode-activated .main_table { - background: url(http://placekitten.com/g/1500/800) repeat; -} -.openerp.kitten-mode-activated.clark-gable .main_table { - background: url(http://amigrave.com/ClarkGable.jpg); - background-size: 100%; -} - -.openerp.kitten-mode-activated .header { - background: url(http://placekitten.com/g/211/65) repeat; -} - -.openerp.kitten-mode-activated .secondary_menu { - background: url(http://placekitten.com/g/212/100) repeat; -} - -.openerp.kitten-mode-activated .menu { - background: #828282; - background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 ); -} -.openerp.kitten-mode-activated .menu a { - background: none; -} -.openerp.kitten-mode-activated .menu span { - background: none; -} -.openerp.kitten-mode-activated .sidebar-content li a, -.openerp.kitten-mode-activated .oe-application .view-manager-main-content h2.oe_view_title, -.openerp.kitten-mode-activated .oe-application .view-manager-main-content a.searchview_group_string, -.openerp.kitten-mode-activated .oe-application .view-manager-main-content label { - color: white; -} -.openerp.kitten-mode-activated .menu, -.openerp.kitten-mode-activated .header_corner, -.openerp.kitten-mode-activated .header_title, -.openerp.kitten-mode-activated .secondary_menu div, -.openerp.kitten-mode-activated .oe-application, -.openerp.kitten-mode-activated .oe_footer, -.openerp.kitten-mode-activated .loading, -.openerp.kitten-mode-activated .ui-dialog { - opacity:0.8; - filter:alpha(opacity=80); -} -.openerp.kitten-mode-activated .header .company_logo { - background: url(http://placekitten.com/g/180/46); -} -.openerp.kitten-mode-activated .loading { - background: #828282; - border-color: #828282; -} - -.openerp .oe-m2o-drop-down-button { - margin-left: -24px; -} -.openerp .oe-m2o-drop-down-button img { - margin-bottom: -4px; - cursor: pointer; -} -.openerp .oe-m2o input { - border-right: none; - margin-right: 0px !important; - padding-bottom: 2px !important; -} -.openerp .oe-m2o-disabled-cm { - color: grey; -} -.openerp ul[role="listbox"] li a { - font-size:80%; -} -.parent_top { - vertical-align: text-top; -} - -.openerp .oe-dialog-warning p { - padding-left: 1em; - font-size: 1.2em; - font-weight: bold; -} - -.openerp .dhx_mini_calendar { - -moz-box-shadow: none; - -khtml-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} -.openerp .oe-treeview-table { - width: 100%; - background-color : #FFFFFF; - border-spacing: 0; - -} -.openerp .oe-treeview-table tr:hover{ - color: blue; - background-color : #D8D8D8; -} -.treeview-tr, .treeview-td { - cursor: pointer; - vertical-align: top; - text-align: left; - border-bottom: 1px solid #CFCCCC; -} -.openerp .oe-treeview-table .oe-number { - text-align: right !important; -} -.treeview-tr span, .treeview-td span { - font-size: 90%; - font-weight: normal; - white-space: nowrap; - display: block; - } -.treeview-tr.oe-treeview-first { - background: transparent url(/web/static/src/img/expand.gif) 0 50% no-repeat; -} -.oe-open .treeview-tr.oe-treeview-first { - background-image: url(/web/static/src/img/collapse.gif); -} -.treeview-tr.oe-treeview-first span, -.treeview-td.oe-treeview-first span { - margin-left: 16px; -} - -.treeview-header { - vertical-align: top; - background-color : #D8D8D8; - white-space: nowrap; - text-align: left; - padding: 4px 5px; -} -/* Shortcuts*/ -.oe-shortcut-toggle { - height: 20px; - margin-top: 3px; - padding: 0; - width: 24px; - cursor: pointer; - display: block; - background: url(/web/static/src/img/add-shortcut.png) no-repeat center center; - float: left; -} -.oe-shortcut-remove{ - background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center; -} -.oe-shortcuts { - position: absolute; - margin: 0; - padding: 6px 15px; - top: 37px; - left: 197px; - right: 0; - height: 17px; - line-height: 1.2; -} -.oe-shortcuts ul { - display: block; - overflow: hidden; - list-style: none; - white-space: nowrap; - padding: 0; - margin: 0; -} -.oe-shortcuts li { - cursor: pointer; - display: -moz-inline-stack; - display: inline-block; - display: inline; /*IE7 */ - color: #fff; - text-align: center; - border-left: 1px solid #909090; - padding: 0 4px; - font-size: 80%; - font-weight: normal; - vertical-align: top; -} - -.oe-shortcuts li:hover { - background-color: #666; -} -.oe-shortcuts li:first-child { - border-left: none; - padding-left: 0; -} - -ul.oe-arrow-list { - padding-left: 1.1em; - margin: 0; - white-space: nowrap; -} -ul.oe-arrow-list li { - display: inline-block; - margin-left: -1em; -} -ul.oe-arrow-list li span { - vertical-align: top; - display: inline-block; - border: 1em solid #DEDEDE; - line-height:0em; -} -ul.oe-arrow-list .oe-arrow-list-before { - border-left-color: rgba(0,0,0,0); - border-right-width:0; -} -ul.oe-arrow-list .oe-arrow-list-after { - border-color: rgba(0,0,0,0); - border-left-color: #DEDEDE; - border-right-width:0; -} -ul.oe-arrow-list li.oe-arrow-list-selected span { - border-color: #B5B9FF; -} -ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-before { - border-left-color: rgba(0,0,0,0); -} -ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { - border-color: rgba(0,0,0,0); - border-left-color: #B5B9FF; -} -.openerp ul.oe-arrow-list li:first-child span:first-child{ - -webkit-border-top-left-radius: 3px; - -moz-border-radius-topleft: 3px; - border-top-left-radius: 3px; - -webkit-border-bottom-left-radius: 3px; - -moz-border-radius-bottomleft: 3px; - border-bottom-left-radius: 3px; -} -.openerp ul.oe-arrow-list li:last-child span:last-child{ - -webkit-border-top-right-radius: 3px; - -moz-border-radius-topright: 3px; - border-top-right-radius: 3px; - -webkit-border-bottom-right-radius: 3px; - -moz-border-radius-bottomright: 3px; - border-bottom-right-radius: 3px; -} -.openerp .oe_view_editor { - width:100%; - border-collapse : collapse; - margin-left: -12px; - - width: 100%; - background-color : white; - border-spacing: 0; -} -.openerp .oe_view_editor td{ - text-align: center; - white-space: nowrap; - border: 1px solid #D8D8D8; - - cursor: pointer; - font-size: 90%; -} -.openerp .oe_view_editor_field td{ - border: 0px !important; -} - -.openerp .oe_view_editor tr:hover { - background-color: #ecebf2; -} - - -/* Dialog traceback cases */ -.openerp .oe_error_detail{ - display: block; -} -.openerp .oe_error_send{ - display:block; -} -.openerp .oe_fielddiv{ - display:inline-block; - width:100%; -} -.openerp .oe_fielddiv input[type=text],textarea{ - width:100%; -} -/* for Alignment center */ -.openerp .oe_centeralign{ - text-align:center; -} - -.openerp .oe_applications_tiles { - color: #4C4C4C; - text-shadow: #EEE 0 1px 0; - margin: 0 20px; -} - -.openerp .oe_vm_switch { - margin:2px 0 0 0; -} - -.openerp .oe_vm_switch_form, -.openerp .oe_vm_switch_page, -.openerp .oe_vm_switch_tree, -.openerp .oe_vm_switch_list, -.openerp .oe_vm_switch_graph, -.openerp .oe_vm_switch_gantt, -.openerp .oe_vm_switch_calendar, -.openerp .oe_vm_switch_kanban, -.openerp .oe_vm_switch_diagram { - background: url("/web/static/src/img/views-icons-a.png") repeat-x scroll left top transparent; - overflow: hidden; - width: 22px; - height: 21px; - border: none; - background-position: 0px 0px; -} - -.openerp .oe_vm_switch_form span, -.openerp .oe_vm_switch_page span, -.openerp .oe_vm_switch_tree span, -.openerp .oe_vm_switch_list span, -.openerp .oe_vm_switch_graph span, -.openerp .oe_vm_switch_gantt span, -.openerp .oe_vm_switch_calendar span, -.openerp .oe_vm_switch_kanban span, -.openerp .oe_vm_switch_diagram span { - display: none; -} - -.openerp .oe_vm_switch_list { - background-position: 0px 0px; -} -.openerp .oe_vm_switch_list:active, -.openerp .oe_vm_switch_list:hover, -.openerp .oe_vm_switch_list:focus, -.openerp .oe_vm_switch_list[disabled="disabled"] { - background-position: 0px -21px; -} - -.openerp .oe_vm_switch_tree { - background-position: 0px 0px; -} -.openerp .oe_vm_switch_tree:active, -.openerp .oe_vm_switch_tree:hover, -.openerp .oe_vm_switch_tree:focus, -.openerp .oe_vm_switch_tree[disabled="disabled"] { - background-position: 0px -21px; -} - -.openerp .oe_vm_switch_form { - background-position: -22px 0px; -} -.openerp .oe_vm_switch_form:active, -.openerp .oe_vm_switch_form:hover, -.openerp .oe_vm_switch_form:focus, -.openerp .oe_vm_switch_form[disabled="disabled"] { - background-position: -22px -21px; -} - -.openerp .oe_vm_switch_page { - background-position: -22px 0px; -} -.openerp .oe_vm_switch_page:active, -.openerp .oe_vm_switch_page:hover, -.openerp .oe_vm_switch_page:focus, -.openerp .oe_vm_switch_page[disabled="disabled"] { - background-position: -22px -21px; -} -.openerp .oe_vm_switch_graph { - background-position: -44px 0px; -} -.openerp .oe_vm_switch_graph:active, -.openerp .oe_vm_switch_graph:hover, -.openerp .oe_vm_switch_graph:focus, -.openerp .oe_vm_switch_graph[disabled="disabled"] { - background-position: -44px -21px; -} - -.openerp .oe_vm_switch_gantt { - background-position: -66px 0px; -} -.openerp .oe_vm_switch_gantt:active, -.openerp .oe_vm_switch_gantt:hover, -.openerp .oe_vm_switch_gantt:focus, -.openerp .oe_vm_switch_gantt[disabled="disabled"] { - background-position: -66px -21px; -} - -.openerp .oe_vm_switch_calendar { - background-position: -88px 0px; -} -.openerp .oe_vm_switch_calendar:active, -.openerp .oe_vm_switch_calendar:hover, -.openerp .oe_vm_switch_calendar:focus, -.openerp .oe_vm_switch_calendar[disabled="disabled"] { - background-position: -88px -21px; -} -.openerp .oe_vm_switch_kanban { - background-position: -110px 0px; -} -.openerp .oe_vm_switch_kanban:active, -.openerp .oe_vm_switch_kanban:hover, -.openerp .oe_vm_switch_kanban:focus, -.openerp .oe_vm_switch_kanban[disabled="disabled"] { - background-position: -110px -21px; -} - -.openerp .oe_vm_switch_diagram { - background-position: 0px 0px; -} -.openerp .oe_vm_switch_diagram:active, -.openerp .oe_vm_switch_diagram:hover, -.openerp .oe_vm_switch_diagram:focus, -.openerp .oe_vm_switch_diagram[disabled="disabled"] { - background-position: 0px -21px; -} - -/* Buttons */ -.openerp .oe_button:link, -.openerp .oe_button:visited, -.openerp .oe_button { - display: inline-block; - border: 1px solid #ababab; - color: #404040; - font-size: 12px; - padding: 3px 10px; - text-align: center; - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #d8d8d8 none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: none, -webkit-linear-gradient(#efefef, #d8d8d8); - background: none, -moz-linear-gradient(#efefef, #d8d8d8); - background: none, -o-linear-gradient(top, #efefef, #d8d8d8); - background: none, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: -ms-linear-gradient(top, #efefef, #d8d8d8); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#d8d8d8',GradientType=0 ); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -o-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); - -webkit-font-smoothing: antialiased; - outline: none; -} - -.openerp .oe_button:hover { - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #e3e3e3 none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); - background: none, -webkit-linear-gradient(#f6f6f6, #e3e3e3); - background: none, -moz-linear-gradient(#f6f6f6, #e3e3e3); - background: none, -o-linear-gradient(top, #f6f6f6, #e3e3e3); - background: none, -khtml-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); - background: -ms-linear-gradient(top, #f6f6f6, #e3e3e3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#e3e3e3',GradientType=0 ); - cursor: pointer; -} - -.openerp .oe_button:focus { - border: 1px solid #80bfff; - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #e3e3e3, none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); - background: none, -webkit-linear-gradient(#f6f6f6, #e3e3e3); - background: none, -moz-linear-gradient(#f6f6f6, #e3e3e3); - background: none, -o-linear-gradient(top, #f6f6f6, #e3e3e3); - background: none, -khtml-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); - background: -ms-linear-gradient(top, #f6f6f6, #e3e3e3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#e3e3e3',GradientType=0 ); - -moz-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -webkit-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -o-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; - box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; -} - -.openerp .oe_button:active, -.openerp .oe_button.active { - background: #e3e3e3; - background: -moz-linear-gradient(top, #e3e3e3, #f6f6f6) #1b468f; - background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#f6f6f6)) #1b468f; - background: linear-gradient(top, #e3e3e3, #f6f6f6) #1b468f; - background: -ms-linear-gradient(top, #e3e3e3, #f6f6f6); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3', endColorstr='#f6f6f6',GradientType=0 ); - -moz-box-shadow: none, 0 0 0 transparent; - -webkit-box-shadow: none, 0 0 0 transparent; - -o-box-shadow: none, 0 0 0 transparent; - box-shadow: none, 0 0 0 transparent; -} - -.openerp .oe_button.disabled, -.openerp .oe_button:disabled { - background: #efefef !important; - border: 1px solid #d1d1d1 !important; - font-size: 12px; - padding: 3px 10px; - -moz-box-shadow: none !important, 0 0 0 transparent; - -webkit-box-shadow: none !important, 0 0 0 transparent; - -o-box-shadow: none !important, 0 0 0 transparent; - box-shadow: none !important, 0 0 0 transparent; - color: #aaaaaa !important; - cursor: default; - text-shadow: 0 1px 1px white !important; -} - -.openerp select.oe_search-view-filters-management { - font-style: oblique; - color: #999999; -} - -.openerp .oe_search-view-filters-management option, -.openerp .oe_search-view-filters-management optgroup { - font-style: normal; - color: black; -} - -/* Debug stuff */ -.openerp .oe_debug_view_log { - font-size: 95%; -} -.openerp .oe_debug_view_log label { - display: block; - width: 49%; - text-align: right; - float: left; - font-weight: bold; - color: #009; -} -.openerp .oe_debug_view_log span { - display: block; - width: 49%; - float: right; - color: #333; -} - -/* Internet Explorer Fix */ -a img { - border: none; -} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass new file mode 100644 index 00000000000..dcb078e8903 --- /dev/null +++ b/addons/web/static/src/css/base.sass @@ -0,0 +1,3 @@ +// vim:tabstop=4:shiftwidth=4:softtabstop=4 +.openerp2 + // Minh's playground. diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css new file mode 100644 index 00000000000..1fac47d128c --- /dev/null +++ b/addons/web/static/src/css/base_old.css @@ -0,0 +1,2382 @@ +.openerp { + padding: 0; + margin: 0; + height: 100%; + font-size: 80%; + font-family: Ubuntu, Helvetica, sans-serif; +} + +.openerp, .openerp textarea, .openerp input, .openerp select, .openerp option, +.openerp button, .openerp .ui-widget { + font-family: Ubuntu, Helvetica, sans-serif; + font-size:85%; +} + +.openerp .view-manager-main-content { + width: 100%; + padding: 0 8px 8px 8px; +} + +.openerp .oe_form_frame_cell .view-manager-main-content { + padding: 0; +} + +.oe_box { + border: 1px solid #aaf; + padding: 2px; + margin: 2px; +} + +#oe_header h2 { + margin: 2px 0; +} + +#oe_errors pre { + margin: 0; +} + +.openerp .oe-listview .oe-number { + text-align: right !important; +} +.oe-listview-header-columns { + background: #d1d1d1; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #d1d1d1 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#d1d1d1)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#d1d1d1',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#d1d1d1 100%); /* W3C */ +} + +.openerp .oe_hide { + display: none !important; +} + +/* STATES */ +.openerp .on_logged, +.openerp .db_options_row { + display: none; +} + +/* Loading */ +.loading { + cursor: wait; +} +.openerp .loading { + display: none; + z-index: 100; + position: fixed; + top: 0; + right: 50%; + padding: 4px 12px; + background: #A61300; + color: white; + text-align: center; + border: 1px solid #900; + border-top: none; + -moz-border-radius-bottomright: 8px; + -moz-border-radius-bottomleft: 8px; + border-bottom-right-radius: 8px; + border-bottom-left-radius: 8px; +} +.openerp .oe_notification { + z-index: 1050; + display: none; +} +.openerp .oe_notification * { + color: white; +} + +/* Login page */ + +.login { + padding: 0; + margin: 0; + font-family: "Lucida Grande", Helvetica, Verdana, Arial; + background: url("/web/static/src/img/pattern.png") repeat; + color: #eee; + font-size: 14px; + height: 100%; +} + +.login ul, ol { + padding: 0; + margin: 0; +} + +.login li { + list-style-type: none; + padding-bottom: 4px; +} + +.login a { + color: #eee; + text-decoration: none; +} + +.login button { + float: right; + display: inline-block; + cursor: pointer; + padding: 6px 16px; + font-size: 13px; + font-family: "Lucida Grande", Helvetica, Verdana, Arial; + border: 1px solid #222222; + color: white; + margin: 0; + background: #600606; + background: -moz-linear-gradient(#b92020, #600606); + background: -webkit-gradient(linear, left top, left bottom, from(#b92020), to(#600606)); + background: -ms-linear-gradient(top, #b92020, #600606); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b92020', endColorstr='#600606',GradientType=0 ); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(155, 155, 155, 0.4) inset; + -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset; +} + +.login input, .login select { + width: 252px; + font-size: 14px; + font-family: "Lucida Grande", Helvetica, Verdana, Arial; + border: 1px solid #999999; + background: whitesmoke; + -moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.login input { + margin-bottom: 9px; + padding: 5px 6px; +} + +.login select { + padding: 1px; +} + +.login .dbpane { + position: fixed; + top: 0; + right: 8px; + padding: 5px 10px; + color: #eee; + border: solid 1px #333; + background: #1e1e1e; + background: rgba(30,30,30,0.94); + -moz-border-radius: 0 0 8px 8px; + -webkit-border-radius: 0 0 8px 8px; + border-radius: 0 0 8px 8px; +} + +.login .bottom { + position: absolute; + top: 50%; + left: 0; + right: 0; + bottom: 0; + text-shadow: 0 1px 1px #999999; + background: #600606; + background: -moz-linear-gradient(#b41616, #600606); + background: -webkit-gradient(linear, left top, left bottom, from(#b41616), to(#600606)); + background: -ms-linear-gradient(top, #b41616, #600606); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b41616', endColorstr='#600606',GradientType=0 ); +} + +.login .pane { + position: absolute; + top: 50%; + left: 50%; + margin: -160px -166px; + border: solid 1px #333333; + background: #1e1e1e; + background: rgba(30,30,30,0.94); + padding: 22px 32px; + text-align: left; + -moz-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; + -moz-box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); + -webkit-box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); + -box-shadow: 0 0 18px rgba(0, 0, 0, 0.9); +} + +.login .pane h2 { + margin-top: 0; + font-size: 18px; +} + +.login #logo { + position: absolute; + top: -70px; + left: 0; + width: 100%; + margin: 0 auto; + text-align: center; +} + +.login .footer { + position: absolute; + bottom: -40px; + left: 0; + width: 100%; + text-align: center; +} + +.login .footer a { + font-size: 13px; + margin: 0 8px; +} + +.login .footer a:hover { + text-decoration: underline; +} + +.login .openerp { + font-weight: bold; + font-family: serif; + font-size: 16px; +} + +.openerp .login { + text-align: center; +} + +.openerp .login .login_error_message { + display: none; + background-color: #b41616; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); + color: #eee; + font-size: 14px; + padding: 14px 18px; + margin-top: 15px; + text-align: center; +} + +.openerp .login.login_invalid .login_error_message { + display: inline-block; +} + + + +/* Database */ +.login .oe-database-manager { + display: none; + height: 100%; + width: 100%; + background-color: white; +} +.login.database_block .bottom, +.login.database_block .login_error_message, +.login.database_block .pane { + display: none; +} +.login.database_block .oe-database-manager { + display: block; +} + +.login .database { + float: left; + width: 202px; + height: 100%; + background: #666666; +} +.login .oe_db_options { + margin-left: 202px; + color: black; + padding-top: 20px; +} + +.login .database ul { + margin-top: 65px; +} + +ul.db_options li { + padding: 5px 0 10px 5px; + background: #949292; /* Old browsers */ + background: -moz-linear-gradient(top, #949292 30%, #6d6b6b 95%, #282828 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(30%,#949292), color-stop(95%,#6d6b6b), color-stop(100%,#282828)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #949292 30%,#6d6b6b 95%,#282828 100%); /* W3C */ + /* for ie9 */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */ + border: none; + /* overriding jquery ui */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + display: block; + font-weight: bold; + text-transform: uppercase; + margin: 1px; + color: #EEEEEE; + cursor: pointer; + width: 195px; + font-size: 12px; +} + +.db_option_table { + border: 1px solid #5A5858; + padding: 5px; + -moz-border-radius: 10px; +} + +table.db_option_table input.required { + background-color: #D2D2FF !important; +} + +.db_option_table label { + display: block; + text-align: right; +} + +.db_option_table input[type="text"], +.db_option_table input[type="password"], +.db_option_table input[type="file"], +.db_option_table select { + width: 300px; +} + +.option_string { + font-weight: bold; + color: #555; + width: 100%; + text-align: center; + padding: 10px 0; + font-size: large; +} + +label.error { + float: none; + color: red; + padding-left: .5em; + vertical-align: top; +} + +/* Main*/ +.openerp .main_table { + width: 100%; + height: 100%; + background: #f0eeee; +} +.openerp .oe-application { + height: 100%; +} +.openerp .oe-application-container { + width: 100%; + height: 100%; +} + +/* IE Hack - for IE < 9 + * Avoids footer to be placed statically at 100% cutting the middle of the views + * */ +.openerp .oe-application-container { + height: auto\9; + min-height: 100%\9; +} + +/* Menu */ +.openerp .menu { + height: 34px; + background: #cc4e45; /* Old browsers */ + background: -moz-linear-gradient(top, #cc4e45 0%, #b52d20 8%, #7a211a 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cc4e45), color-stop(8%,#b52d20), color-stop(100%,#7a211a)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CC4E45', endColorstr='#7A211A',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* W3C */ +} +.openerp .menu td { + text-align: center; + padding:0; +} +.openerp .menu a { + display:block; + min-width: 60px; + height: 20px; + margin: 3px 2px; + padding: 0 8px; + + background: #bd5e54; /* Old browsers */ + background: -moz-linear-gradient(top, #bd5e54 0%, #90322a 60%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bd5e54), color-stop(60%,#90322a)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BD5E54', endColorstr='#90322A',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #bd5e54 0%,#90322a 60%); /* W3C */ + + border: 1px solid #5E1A14; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + + color: #eee; + text-shadow: #222 0 1px 0; + text-decoration: none; + text-transform: uppercase; + line-height: 20px; + font-weight: bold; + font-size: 75%; + + white-space: nowrap; +} +.openerp .menu a:hover, +.openerp .menu a:focus, +.openerp .menu a.active { + background: #c6c6c6; /* Old browsers */ + background: -moz-linear-gradient(top, #c6c6c6 0%, #5c5c5c 7%, #969595 86%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c6c6c6), color-stop(7%,#5c5c5c), color-stop(86%,#969595)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C6C6C6', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* W3C */ + /* for ie */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5c5c5c', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ + color: #fff; +} +/* Secondary Menu */ +.openerp .secondary_menu .oe_toggle_secondary_menu { + position: absolute; + cursor: pointer; + border-left: 1px solid #282828; + border-bottom: 1px solid #282828; + width: 21px; + height: 21px; + z-index: 10; + background: transparent; + color: white; + text-shadow: 0 1px 0 #333; + text-align: center; + font-size: 18px; + line-height: 18px; + right: 0; +} +.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu { + position: static; + border-left: none; + border-bottom: 1px solid #282828; + width: 21px; + height: 21px; + background: #818181; +} +.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu span.oe_menu_fold { + display: none; +} +.openerp .secondary_menu.oe_unfolded .oe_toggle_secondary_menu span.oe_menu_unfold { + display: none; +} +.openerp .secondary_menu { + width: 200px; + min-width: 200px; + border-right: 1px solid #3C3C3C; + border-bottom: 1px solid #5A5858; + background: #5A5858; + vertical-align: top; + height: 100%; + display: block; + position: relative; + font-size:85%; +} +.openerp .secondary_menu.oe_folded { + width: 20px; + min-width: 20px; + position: static; +} +.openerp .secondary_menu.oe_folded .oe_secondary_menu.active { + position: absolute; + z-index: 100; + border: 4px solid #585858; + border-color: rgba(88, 88, 88, .5); + border-radius: 4px; + min-width: 200px; +} +.openerp .secondary_menu a { + display: block; + padding: 0 5px 2px 5px; + line-height: 20px; + text-decoration: none; + white-space: nowrap; + color: white; + text-shadow: 0 1px 0 #333; +} +.openerp .oe_secondary_submenu { + background: #5A5858; +} +.openerp .secondary_menu a.oe_secondary_menu_item { + background: #949292; /* Old browsers */ + background: -moz-linear-gradient(top, #949292 0%, #6d6b6b 87%, #282828 99%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#949292), color-stop(87%,#6d6b6b), color-stop(99%,#282828)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* W3C */ + /* for ie9 */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */ + white-space: nowrap; + color: white; + text-shadow: 0 1px 0 #333; + +} +.openerp a.oe_secondary_submenu_item { + padding: 0 5px 2px 10px; +} +.openerp a.oe_secondary_submenu_item, +.openerp a.oe_secondary_menu_item { + overflow: hidden; + text-overflow: ellipsis; +} +.openerp a.oe_secondary_submenu_item:hover, +.openerp a.oe_secondary_submenu_item.leaf.active { + display: block; + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #d8d8d8 11%, #afafaf 86%, #333333 91%, #5a5858 96%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(11%,#d8d8d8), color-stop(86%,#afafaf), color-stop(91%,#333333), color-stop(96%,#5a5858)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#5A5858',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* W3C */ + padding: 0 5px 2px 10px; + line-height: 20px; + color: #3f3d3d; + text-decoration: none; + text-shadow: #fff 0 1px 0; +} +.openerp a.oe_secondary_submenu_item.submenu.opened span:before { + content: "\25be"; +} +.openerp a.oe_secondary_submenu_item.submenu span:before { + content: "\25b8"; +} + +/* Header */ +.openerp .header { + height: 65px; + background: url("/web/static/src/img/header-background.png") repeat-x scroll left top transparent; + color: #FFFFFF; + letter-spacing: 0.5px; + text-shadow: 0 1px 0 #333333; +} +.openerp .company_logo_link { + display: block; + float: left; + height: 63px; + width: 200px; + border: 1px solid white; + border-right-color: black; + border-bottom-color: black; + background: #FFFFFF; + background: -moz-linear-gradient(top, #FFFFFF 0%, #CECECE 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CECECE)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CECECE',GradientType=0 ); +} +.openerp .company_logo { + margin-top: 7px; + margin-left: 10px; + display: block; + background: url(/web/static/src/img/logo.png); + width:180px; + height:46px; +} +.openerp .header_title { + float: left; + font-size: 100%; + margin: 0; + padding: 4px 10px; + text-shadow: 0 1px 0 #111111; + font-weight:normal; + line-height:14px; +} +.openerp .header_title small { + color: #ccc; + font-size: 90%; + font-weight: normal; +} +.openerp .header_corner { + float: right; +} +.openerp .header_corner .block { + float: left; + height: 34px; + line-height: 34px; + /*background: url(../images/top-sep-a.png) no-repeat;*/ + border-left: 1px solid #6a6a6a; + background: #828282; + background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 ); +} +.openerp .header_corner .block a { + display: block; + color: white; + text-decoration: none; + padding: 0 10px; +} +.openerp .header_corner .block a:hover { + background: #929292; + background: -moz-linear-gradient(top, #929292 0%, #4D4D4D 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#929292), color-stop(100%,#4D4D4D)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#929292', endColorstr='#4D4D4D',GradientType=0 ); +} +.openerp .header_corner ul.block { + list-style: none; + height: 34px; + margin: 0; + padding: 0 0 0 2px; + line-height: 33px; +} +.openerp .header_corner ul.block li { + float: left; +} +.openerp .header_corner ul.block li a { + padding: 0 5px; + position: relative; + line-height: 32px; +} +.openerp .header_corner ul.block li a img { + vertical-align: middle; +} +.openerp .header_corner ul.block li a small { + position: absolute; + right: 0; + top: 5px; + padding: 1px 4px 2px; + background: rgba(0, 0, 0, 0.75); + border-radius: 7px; + -moz-border-radius: 7px; + -webkit-border-radius: 7px; + line-height: 1em; + font-weight: bold; +} + +.openerp .logout { + font-size:80%; +} + +/* Footer */ +.openerp div.oe_footer { + background: none repeat scroll 0 0 #CCCCCC; + overflow: hidden; + padding: 5px 0; + position: relative; + -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); +} +.openerp div.oe_footer p.oe_footer_powered { + left: 50%; + margin: 0; + padding: 0 15px; + color: #666666; + font-weight: bold; + font-size: 0.8em; + text-align: center; +} +.openerp div.oe_footer p.oe_footer_powered a { + text-decoration: none; + color: #666666; +} + + +/* Main Application */ +.openerp .oe-main-content { + padding: 0; + height: 100%; +} + +.openerp h2.oe_view_title { + font-size: 110%; + font-weight: normal; + margin: 2px 0; + color: #252424; + text-shadow: white 0 1px 0; +} +.openerp div[id^="notebook"] .oe_view_title { + font-size:85%; + padding-bottom:4px; +} + +/* View Manager */ +.openerp .oe_vm_switch { + float: right; +} +.openerp .oe-view-manager-header .oe_view_title { + font-size:150%; + padding:2px 0 0 0; +} + +/* SearchView */ +.openerp .oe_searchview_field > div { + position: relative; + white-space: nowrap; +} +.openerp .oe_searchview_field .oe_input_icon { + top: auto; + bottom: 3px; +} + +.openerp .filter_label, .openerp .filter_icon { + background: #F0F0F0; + border: 1px solid #999; + background: -moz-linear-gradient(top, #F0F0F0 0%, #C0C0C0 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F0F0F0), color-stop(100%,#C0C0C0)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F0F0F0', endColorstr='#C0C0C0',GradientType=0 ); +} +.openerp .filter_label:hover, .openerp .filter_icon:hover { + background: #F0F0F0; + background: -moz-linear-gradient(top, #F0F0F0 0%, #A1A7CE 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F0F0F0), color-stop(100%,#A1A7CE)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F0F0F0', endColorstr='#A1A7CE',GradientType=0 ); +} +.openerp .filter_label:active, .openerp .filter_icon:active { + background: #aaa; + background: -moz-linear-gradient(top, #999999 0%, #EEEEEE 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#999999), color-stop(100%,#EEEEEE)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#999999', endColorstr='#EEEEEE',GradientType=0 ); +} +.openerp .filter_label.enabled, .openerp .filter_icon.enabled { + background: #aaa; + filter: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + -o-box-shadow: none; + box-shadow: none; +} +.openerp .filter_icon { + height: 22px; + padding: 1px 2px 0 2px; + margin: 0; + vertical-align: bottom; +} +.openerp .filter_label { + font-weight: bold; + text-transform: uppercase; + text-shadow: #EEE 0 1px 0; + color: #4C4C4C; + white-space: nowrap; + min-height: 40px; + min-width: 75px; + padding: 2px 4px; + margin: 0; +} +.openerp .filter_label_group { + padding-right: 0.4em; + white-space: nowrap; +} + +.openerp .filter_label_group button { + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; + border-right: none; +} +.openerp .filter_label_group button:first-child { + -webkit-border-top-left-radius: 7px; + -webkit-border-bottom-left-radius: 7px; + -moz-border-radius-topleft: 7px; + -moz-border-radius-bottomleft: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + border-right: none; +} +.openerp .filter_label_group button:last-child { + -webkit-border-top-right-radius: 7px; + -webkit-border-bottom-right-radius: 7px; + -moz-border-radius-topright: 7px; + -moz-border-radius-bottomright: 7px; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + border-right: 1px solid #999; +} +.openerp .filter_label_group button.filter_icon img { + padding: 1px 8px 0 8px; +} +.openerp .filter_label_group button.filter_icon:first-child { + border-left: solid 1px #999; + margin-left: -7px; + -webkit-border-top-left-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 0; + -moz-border-radius-bottomleft: 0; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.openerp .searchview_group_string { + display: block; + color: #7D7979; + font-weight: bold; + padding: 2px 0 2px 10px; + text-decoration: none; +} +.openerp .searchview_group_string:hover { + background-color: #ccc; +} +.openerp .searchview_group.folded .searchview_group_string { + background: url("/web/static/src/img/ui/group-folded.png") no-repeat scroll 0 50%; +} +.openerp .searchview_group.folded .searchview_group_content { + display: none; +} +.openerp .searchview_group.expanded .searchview_group_string { + background: url("/web/static/src/img/ui/group-expanded.png") no-repeat scroll 0 50%; +} +.openerp .searchview_group.expanded .searchview_group_content { + display: block; + padding-bottom:3px; +} + +.openerp .searchview_group_content .oe_label, .openerp .searchview_group_content .oe_label_help { + font-weight: bold; + color: #4c4c4c; +} + +.openerp .oe-searchview-render-line .oe_label, .openerp .oe-searchview-render-line .oe_label_help { + font-weight: bold; + font-size: 80%; + white-space: nowrap; +} + +.openerp .searchview_extended_group { + padding: 3px; + margin: 2px; +} + +.openerp .searchview_extended_group .oe_adv_filters_and { + border-bottom: 1px solid #8E8E8E; + text-align: center; + margin-top: -10px; +} +.openerp .searchview_extended_group .oe_adv_filters_and span { + background: #F0EEEE; + position: relative; + top: 0.5em; + padding: 0 1em 0 1em; + color: #8E8E8E; +} + +.openerp .searchview_extended_group.last_group .oe_adv_filters_and { + display: none; +} + +.openerp .oe_search-view-buttons { + padding: 2px 0 10px 0; + vertical-align:middle; +} +.openerp .oe_search-view-filters-management { + float: right; +} +.openerp .oe_search-view-filters-management, .openerp .oe_search-view-custom-filter-btn { + float:right; +} + +.openerp .searchview_extended_add_proposition span { + font-size: 0.9em; + background: url(/web/static/src/img/icons/gtk-add.png) repeat-y; + padding-left: 18px; +} + +.openerp .searchview_extended_delete_group { + float:right; + display: none; +} + +.openerp .searchview_extended_delete_prop { + text-decoration: none; +} + +.openerp .searchview_extended_delete_group span, +.openerp .searchview_extended_delete_prop span { + font-size: 0.9em; + background: url(/web/static/src/img/icons/gtk-close.png) repeat-y; + padding-left: 18px; +} +/* List */ +.openerp table.oe-listview-content { + clear: right; + width: 100%; + border-spacing: 0; + border: 1px solid silver; +} + +.openerp .oe-listview thead table { + width: 100%; + border: none; +} +.openerp .oe-listview tr.odd { + background-color: #f3f3f3; +} +.openerp .oe-listview tbody tr:hover { + background-color: #ecebf2; +} +.openerp .oe-listview tbody tr:hover { + background-color: #eae9f0; +} +.openerp .oe-listview thead table tr, +.openerp .oe-listview thead table tr:hover { + background: none; +} + +.openerp .oe-listview > table > tbody > tr > td, +.openerp .oe-listview th { + vertical-align: middle; + text-align: left; + padding: 1px 2px; +} + +.openerp .oe-record-delete button, +.openerp button.oe-edit-row-save { + border: none; + height: 12px; + width: 12px; + background: url("/web/static/src/img/iconset-b-remove.png") no-repeat scroll center center transparent; + cursor: pointer; +} +.openerp button.oe-edit-row-save { + background-image: url('/web/static/src/img/icons/save-document.png'); +} + +/* Could use :not selectors if they were supported by MSIE8... */ +.openerp .oe-listview > table > tbody > tr > td { + border-left: 1px solid #dadada; /*currently commenting to test with no vertical lines in list view*/ +} +.openerp .oe-listview tbody td:first-child, +.openerp .oe-listview tbody td.oe-button, +.openerp .oe-listview tbody td.oe-button, +.openerp .oe-listview tbody th.oe-record-selector, +.openerp .oe-listview tbody td.oe-record-delete { + border-left: none; +} + +.openerp .oe-listview td.oe-record-delete { + text-align: right; +} +.openerp .oe-listview th.oe-sortable { + cursor: pointer; + font-size: 75%; + text-transform: uppercase; + padding: 0; + margin: 0; + padding-left: 3px; + color: #333; +} +.openerp .oe-listview th.oe-sortable .ui-icon { + height: 60%; + margin: -6px 0 0; + display: inline; + display: inline-block; + vertical-align: middle; +} + +.openerp .oe-listview > table > tbody > tr > td { + border-bottom: 1px solid #E3E3E3; +} + + +.openerp .oe-listview td.oe-actions { + border-bottom:none; +} + +.openerp .oe-listview .oe-record-selector, .openerp .oe-listview .oe-record-edit-link { + border-bottom: 1px solid #E3E3E3; +} +.openerp .oe-listview .oe-record-edit-link { + cursor: pointer; +} + +.openerp .oe-listview .oe-field-cell { + cursor: pointer; + margin-top: 0; + margin-bottom: 0; + padding-top: 3px; + padding-bottom: 3px; + font-size: 80%; +} +.openerp .oe-listview .oe-field-cell progress { + width: 100%; +} +.openerp .oe-listview .oe-field-cell.oe-button button, +.openerp .oe-listview .oe_form_button button { + margin: 0; + padding: 0; + border: none; + background: none; + width: 16px; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; +} +.openerp .oe-listview .oe-field-cell button:active { + opacity: 0.5; +} +.openerp .oe-listview .oe-field-cell button img { + cursor: pointer; +} +.openerp .oe-listview .oe-field-cell button img:hover { + opacity: 0.75; +} + +.openerp .oe-listview .oe-field-cell .oe-listview-button-disabled img { + opacity: 0.5; +} + +.openerp .oe-listview th.oe-actions { + text-align: left; + white-space: nowrap; +} +.openerp .oe-listview th.oe-list-pager { + text-align: right; + white-space: nowrap; +} +.openerp .oe-list-pager .oe-pager-state { + cursor: pointer; + font-size: 90%; + color: #555; +} + +.openerp .oe_button.oe_button_pager, +.openerp .oe-list-pager > span, +.openerp .oe_form_pager > span { + line-height: 17px; + height: 17px; + cursor: pointer; + color: gray; + font-weight: bold; + vertical-align: middle; +} +.openerp .oe_button.oe_button_pager, +.openerp .oe_button.oe_button_pager:disabled { + padding: 0 3px 0 3px; + margin: 0; + height: 17px; +} +.openerp .oe-listview .oe-group-name { + padding-right: 1em; +} +.openerp .oe-listview .oe-group-name, +.openerp .oe-listview .oe-group-pagination { + white-space: nowrap; +} + +.openerp .oe-listview tfoot td { + padding: 3px 3px 0; +} +.openerp .oe-listview .oe-list-footer { + text-align: center; + white-space: nowrap; + color: #444; + font-size: 85%; +} +.openerp .oe-listview .oe-list-footer span { + margin: 0 1em; +} +.openerp .oe-listview .oe-list-footer progress { + vertical-align:-10% !important; + width: 100%; +} + +/** list rounded corners + + rounded corners are a pain on tables: need to round not only table, but + also on the first and last children of the first and last row + */ +.openerp .oe-listview table.oe-listview-content { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.openerp .oe-listview table.oe-listview-content thead tr:first-child th:first-child { + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; +} +.openerp .oe-listview table.oe-listview-content thead tr:first-child th:last-child { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; +} +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:first-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:first-child, +.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child th:first-child { + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:last-child, +.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:last-child, +.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child td:last-child { + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; +} + +/* Notebook */ +.openerp .oe_form_notebook { + padding: 0; + background: none; + border-width: 0; +} +.openerp .oe_form_notebook .ui-tabs-panel { + padding: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + border-top-right-radius: 4px; +} +.openerp .oe_form_notebook ul.ui-tabs-nav { + padding-left: 0; + background: transparent; + border-width: 0; + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + line-height: 0.8em; + font-size: 95%; + color: #555; +} +.openerp .oe_form_notebook ul.ui-tabs-nav li { + font-weight: bold; +} +.openerp .oe_form_notebook .ui-tabs-panel { + background: #f9f9f9; + border-width: 1px; +} +.openerp .oe_form_notebook .ui-tabs-selected { + background: #f9f9f9; +} +/* Unedit Form */ +.openerp .field_char, +.openerp .field_date, +.openerp .field_float, +.openerp .field_selection, +.openerp a.oe_form_uri { + vertical-align: middle; + padding-top: 3px; + font-size: 90%; + color: #222; +} +.openerp a.oe_form_uri { + color: #9A0404; + line-height: 12px; +} + + + +/* Form */ +.openerp .oe_form_button_save_dirty { + display: none; +} +.openerp .oe_form_dirty > .oe_form_header > .oe_form_buttons > .oe_form_button_save { + color: white; + background: #dc5f59; + background: -moz-linear-gradient(#dc5f59, #b33630); + background: -webkit-gradient(linear, left top, left bottom, from(#dc5f59), to(#b33630)); + background: -webkit-linear-gradient(#dc5f59, #b33630); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; + font-weight: bold; +} +.openerp .oe_form_frame_cell input[type="checkbox"] { + margin-top: 3px; + vertical-align: middle; +} +.openerp .oe_form_frame_cell .input[type="text"] { + padding-bottom: 1px; +} + +.openerp table.oe_frame td { + color: #4c4c4c; +} +.openerp td.oe_form_frame_cell { + padding: 2px; + position: relative; +} +.openerp .oe_frame.oe_forms { + clear: both; +} +.openerp table.oe_frame { + color: #4c4c4c; +} +.openerp fieldset.oe_group_box { + border: 1px solid #AAAAAA; + moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + background: #F9F9F9; + padding: 4px; +} +.openerp fieldset.oe_group_box legend { + font-weight: bold; +} +.openerp td.oe_form_frame_cell { + padding: 2px; + position: relative; +} +.openerp td.oe_form_field_translatable, +.openerp td.oe_form_field_many2one, +.openerp td.oe_form_field_date, +.openerp td.oe_form_field_datetime { + white-space: nowrap; +} +.openerp td.oe_form_field_boolean { + padding-top: 4px; +} +.openerp td.oe_form_frame_cell.oe_form_group { + padding: 0; +} +.openerp .required.error { + border: 1px solid #900; +} +.openerp .oe_form_buttons, .openerp .oe_list_buttons { + float: left; +} +.openerp .oe_form_pager, .openerp .oe_list_pager { + float: right; + font-size: 80%; + color: gray; + font-weight: bold; +} + +.openerp .oe_form_pager { + margin-right: 3px; +} + + +.openerp label.oe_label_help, .openerp label.oe_label, +.openerp .oe_form_paragraph, +.openerp .oe_form_field_statusbar, +.openerp .oe_forms input[type="text"], +.openerp .oe_forms input[type="password"], +.openerp .oe_forms input[type="file"], +.openerp .oe_forms select, +.openerp .oe_forms .oe_button, +.openerp .oe_forms textarea { + font-size: 85%; +} + +.openerp label.oe_label_help, .openerp label.oe_label { + display: block; + color: #4c4c4c; + font-weight: normal; +} +.openerp label.oe_label_help { + cursor: help; +} +.openerp .oe_form_frame_cell .oe_label, .openerp .oe_form_frame_cell .oe_label_help { + font-weight: normal; +} +.openerp #tiptip_content { + font-size: 12px; +} +.openerp .oe_tooltip_string { + color: #FD5; + font-weight: bold; + font-size: 13px; +} +.openerp .oe_tooltip_help { + white-space: pre-wrap; +} +.openerp .oe_tooltip_technical { + padding: 0 0 4px 0; + margin: 5px 0 0 15px; + list-style: circle; +} +.openerp .oe_tooltip_technical_title { + font-weight: bold; +} + +.openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help { + margin: 3px 0 0 3px; + white-space: nowrap; +} +.openerp .oe_forms .searchview_group_content label.oe_label, .openerp .searchview_group_content .oe_forms label.oe_label_help { /* making a distinction between labels in search view and other labels */ + margin: 3px 0 0 3px; +} + +.openerp label.oe_label_help span { + font-size: 80%; + color: darkgreen; + vertical-align:top; + position: relative; + top: -4px; + padding: 0 2px; +} +.openerp .oe_align_left { + text-align: left; +} +.openerp .oe_align_right { + text-align: right; +} +.openerp .oe_align_center { + text-align: center; +} +.openerp .oe_forms .oe_form_paragraph { + margin: 3px 0 0 0; + white-space: normal; +} + +.openerp .oe_forms .oe_form_paragraph.oe_multilines { + white-space: pre; +} + +.openerp .oe_form_field_one2many .oe-actions h3.oe_view_title, +.openerp .oe_form_field_one2many_list .oe-actions h3.oe_view_title{ + display: inline; + margin: 0 0.5em 0 0; +} + +.openerp .oe_forms .oe-listview th.oe-sortable .ui-icon, +.openerp .oe_forms .oe-listview th.oe-sortable .ui-icon { + height: 100%; + margin-top: -9px; +} + +.openerp table.oe_frame .oe-listview-content td { + color: inherit; +} + +/* Uneditable Form View */ +.openerp .oe_form_readonly { + +} +.openerp .oe_form_readonly .oe_form_frame_cell .field_text, +.openerp .oe_form_readonly .field_char, +.openerp .oe_form_readonly .field_int, +.openerp .oe_form_readonly .field_float, +.openerp .oe_form_readonly .field_email, +.openerp .oe_form_readonly .field_date, +.openerp .oe_form_readonly .field_selection, +.openerp .oe_forms_readonly .oe_form_field_many2one { + padding: 3px 2px 2px 2px; + background-color: white; + height: 17px; +} +.openerp .oe_form_readonly .oe_form_frame_cell .field_text { + height: auto; +} +.openerp .oe_form_readonly .field_datetime { + padding: 1px 2px 2px 2px; + background-color: white; + height:19px; +} +.openerp .oe_form_readonly .oe_form_field_many2one div { + background-color:white; + height:18px; + margin-bottom:1px; + padding: 0px 2px 5px 2px; +} + +.openerp .oe_form_readonly .oe_form_field_email div { + background-color: white; + padding: 1px 2px 3px 2px; +} + + +.openerp .oe_form_readonly .oe_form_field_text div.field_text, +.openerp .oe_form_readonly .oe_form_field_text_html div.field_text_html { + white-space: pre-wrap; +} +.openerp .oe_form_readonly .oe_form_frame_cell .field_text { + min-height:100px; +} +/* Inputs */ +.openerp .oe_forms input[type="text"], +.openerp .oe_forms input[type="password"], +.openerp .oe_forms input[type="file"], +.openerp .oe_forms select, +.openerp .oe_forms textarea { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + padding: 0 2px; + margin: 0 2px; + border: 1px solid #999; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: white; + min-width: 90px; + color: #1f1f1f; +} + +.openerp .oe_forms input.field_many2one, +.openerp .oe_forms input.field_binary, +.openerp .oe_forms input.field_binary, +.openerp .oe_forms input.field_email, +.openerp .oe_forms input.field_url { + border-right: none; + -webkit-border-top-right-radius: 0px; + -webkit-border-bottom-right-radius: 0px; + -moz-border-radius-topright: 0px; + -moz-border-radius-bottomright: 0px; + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; +} +.openerp .oe_button.oe_field_button { + -webkit-border-top-left-radius: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-topleft: 0px; + -moz-border-radius-bottomleft: 0px; + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + margin-right:-1px; + height: 22px; +} + +.openerp .oe_form_field_email button img, +.openerp .oe_form_field_url button img { + vertical-align: top; +} +/* vertically recentering filter management select tag */ +.openerp select.oe_search-view-filters-management { + margin-top:2px; +} + +.openerp .oe_forms select{ + padding-top: 2px; +} +.openerp .oe_forms input[readonly], +.openerp .oe_forms select[readonly], +.openerp .oe_forms textarea[readonly], +.openerp .oe_forms input[disabled], +.openerp .oe_forms select[disabled], +.openerp .oe_forms textarea[disabled]{ + background: #E5E5E5 !important; + color: #666; +} +.openerp .oe_forms textarea { + resize:vertical; +} +.openerp .oe_forms input[type="text"], +.openerp .oe_forms input[type="password"], +.openerp .oe_forms input[type="file"], +.openerp .oe_forms select, +.openerp .oe_forms .oe_button { + height: 22px; +} + +.openerp .oe_forms input.field_datetime { + min-width: 11em; +} +.openerp .oe_forms .oe_form_button .oe_button { + color: #4c4c4c; + white-space: nowrap; + min-width: 100%; + width: 100%; +} +@-moz-document url-prefix() { + /* Strange firefox behaviour on width: 100% + white-space: nowrap */ + .openerp .oe_forms .oe_form_button .oe_button { + width: auto; + } +} +/* IE Hack - for IE < 9 + * Avoids buttons overflow + * */ +.openerp .oe_forms .oe_form_button .oe_button { + min-width: auto\9; +} +.openerp .oe_forms .button { + height: 22px; +} +.openerp .oe_forms .oe_button span { + position: relative; + vertical-align: top; +} +.openerp .oe_input_icon { + cursor: pointer; + margin: 3px 0 0 -21px; + vertical-align: top; +} +.openerp .oe_datepicker_container { + display: none; +} +.openerp .oe_datepicker_root { + display: inline-block; +} +.openerp .oe_form_frame_cell .oe_datepicker_root { + width: 100%; +} +.openerp .oe_input_icon_disabled { + position: absolute; + cursor: default; + opacity: 0.5; + filter:alpha(opacity=50); + right: 5px; + top: 3px; +} +.openerp .oe_trad_field.touched { + border: 1px solid green !important; +} + +/* http://www.quirksmode.org/dom/inputfile.html + * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image + */ +.openerp .oe-binary-file-set { + overflow: hidden; + position: relative; +} +.openerp input.oe-binary-file { + z-index: 0; + line-height: 0; + font-size: 50px; + position: absolute; + /* Should be adjusted for all browsers */ + top: -2px; + right: 0; + opacity: 0; + filter: alpha(opacity = 0); + -ms-filter: "alpha(opacity=0)"; + margin: 0; + padding:0; +} + +/* Widgets */ +.openerp .separator { + border: 0 solid #666; +} +.openerp .separator.horizontal { + font-weight: bold; + border-bottom-width: 1px; + margin: 3px 4px 3px 1px; + height: 17px; + font-size: 95%; +} +.openerp .separator.horizontal:empty { + height: 5px; +} +.openerp .oe_form_frame_cell.oe_form_separator_vertical { + border-left: 1px solid #666; +} +.openerp td.required input, .openerp td.required select { + background-color: #D2D2FF !important; +} +.openerp td.invalid input, .openerp td.invalid select, .openerp td.invalid textarea { + background-color: #F66 !important; + border: 1px solid #D00 !important; +} +.openerp div.oe-progressbar span { + position: absolute; + margin-left: 10px; + margin-top: 5px; + font-weight: bold; +} + +/* jQuery UI override */ +.openerp .ui-widget { + font-size: 1em; +} +.openerp .oe_form_field_progressbar .ui-progressbar { + height: 22px; + font-size: 10px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + border: 1px solid #999; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: white; + min-width: 90px; +} +.openerp tbody.ui-widget-content { + margin-bottom: 10px; + border-spacing: 4px; +} +.openerp .ui-widget-header { + background: white none; +} +/* progress bars */ +.openerp .ui-progressbar .ui-widget-header { + background: #cccccc url(/web/static/lib/jquery.ui/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; +} + +/* Sidebar */ +.openerp .view-manager-main-table { + margin: 0; + width:100%; + border-collapse:collapse; + height:100%; +} + +.openerp .view-manager-main-table tbody { + vertical-align: top; +} + +.openerp .oe-view-manager-header { + overflow: auto; + background: url("/web/static/src/img/sep-a.gif") 0 100% repeat-x; + margin:6px 0 6px 2px; +} +.openerp .oe_form_frame_cell .oe-view-manager-header { /* Trick: remove the background when element is in a formular */ + background: none; +} + +.openerp .oe-view-manager-header h2 { + float: left; +} + +.openerp .oe_view_manager_menu_tips blockquote { + display: none; + font-size: 85%; + margin: 0; + background: #fff; + border-bottom: 1px solid #CECBCB; + padding: 1px 10px; + color: #4C4C4C; +} +.openerp .oe_view_manager_menu_tips blockquote p { + margin: 0; + padding: 6px 1px 4px; +} + +.openerp .oe_view_manager_menu_tips blockquote div { + text-align: right; + margin-right:10px; +} + +.openerp .oe_view_manager_menu_tips blockquote div button { + border: none; + background: none; + padding: 0 4px; + margin: 0; + display: inline; + text-decoration: underline; + color: inherit; +} +.openerp .oe-view-manager-logs { + clear: both; + background: #fff; + margin: 0.25em 0; + font-size: 85%; + color: #4C4C4C; + position: relative; + overflow: hidden; +} +.openerp .oe-view-manager-logs ul { + margin: 0; + padding: 0 10px; + list-style: none; +} +.openerp .oe-view-manager-logs li:before { + content: '\2192 '; +} +.openerp .oe-view-manager-logs a { + text-decoration: none; + color: inherit; +} +/* only display first three log items of a folded logs list */ +.openerp .oe-view-manager-logs.oe-folded li:nth-child(n+4) { + display: none; +} +/* display link to more logs if there are more logs to view and the logview is + currently folded */ +.openerp .oe-view-manager-logs a.oe-more-logs { + display: none; +} +.openerp .oe-view-manager-logs.oe-folded.oe-has-more a.oe-more-logs { + display: block; +} +.openerp .oe-view-manager-logs a.oe-remove-everything { + position: absolute; + top: 0; + right: 0; + cursor: pointer; +} + +.openerp .view-manager-main-sidebar { + width: 180px; + padding: 0; + margin: 0; +} + +.openerp .sidebar-main-div { + height: 100%; + border-left: 1px solid #D2CFCF; +} + +.openerp .sidebar-content { + padding: 0; + margin: 0; + width: 180px; + height: 100%; + font-size: 0.9em; +} + +.openerp .closed-sidebar .sidebar-content { + width: 22px; +} + +.openerp .closed-sidebar .sidebar-content { + display: none; +} + +.openerp .sidebar-main-div a { + color: #555; + text-decoration: none; +} + +.openerp .sidebar-main-div a:hover { + color: black; +} + +.openerp .oe-sidebar-attachments-toolbar { + margin: 4px 0 0 4px; +} +.openerp .oe-sidebar-attachments-items { + clear: both; + padding-top: 5px !important; +} +.openerp .oe-sidebar-attachments-items li { + position: relative; + padding: 0 0 3px 10px !important; +} +.openerp .oe-sidebar-attachments-items li:hover { + background: #ddd; +} +.openerp .oe-sidebar-attachments-link { + display: block; + margin-right: 15px; + overflow: hidden; +} +.openerp .oe-sidebar-attachment-delete { + position: absolute; + right: 2px; + top: 1px; + overflow: hidden; + width: 15px; + height: 15px; + padding: 1px; + border-radius: 7px; + -moz-border-radius: 7px; + -webkit-border-radius: 7px; +} +.openerp .oe-sidebar-attachment-delete:hover { + background-color: white; +} + +.openerp .view-manager-main-sidebar h2 { + margin:0; + font-size: 1.15em; + color: #8E8E8E; + text-shadow: white 0 1px 0; + padding-left: 10px; + padding-right: 21px; + height: 21px; + + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #ebe9e9 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ebe9e9)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#EBE9E9',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#ebe9e9 100%); /* W3C */ + + border: 1px solid #D2CFCF; + border-right-width: 0; + border-left-width: 0; +} +.openerp .view-manager-main-sidebar h2 { + border-top-width: 0; +} + +.openerp .view-manager-main-sidebar ul { + list-style-type: none; + margin: 0; + padding: 0; + display: block; +} + +.openerp .view-manager-main-sidebar li { + display: block; + padding: 3px 3px 3px 10px; +} + +.openerp .toggle-sidebar { + cursor: pointer; + border: 1px solid #D2CFCF; + border-top-width: 0; + display: block; + background: url(/web/static/src/img/toggle-a-bg.png); + width: 21px; + height: 21px; + z-index: 10; +} +.openerp .open-sidebar .toggle-sidebar { + margin-left: 158px; + background-position: 21px 0; + position: absolute; +} +.openerp .closed-sidebar .toggle-sidebar { + border-left: none; +} +.openerp li.oe_sidebar_print { + padding-left: 20px; + background: 1px 3px url(/web/static/src/img/icons/gtk-print.png) no-repeat; +} + +.openerp .oe_sidebar_print ul { + padding-left:8px; +} + +.openerp.kitten-mode-activated .main_table { + background: url(http://placekitten.com/g/1500/800) repeat; +} +.openerp.kitten-mode-activated.clark-gable .main_table { + background: url(http://amigrave.com/ClarkGable.jpg); + background-size: 100%; +} + +.openerp.kitten-mode-activated .header { + background: url(http://placekitten.com/g/211/65) repeat; +} + +.openerp.kitten-mode-activated .secondary_menu { + background: url(http://placekitten.com/g/212/100) repeat; +} + +.openerp.kitten-mode-activated .menu { + background: #828282; + background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D)); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 ); +} +.openerp.kitten-mode-activated .menu a { + background: none; +} +.openerp.kitten-mode-activated .menu span { + background: none; +} +.openerp.kitten-mode-activated .sidebar-content li a, +.openerp.kitten-mode-activated .oe-application .view-manager-main-content h2.oe_view_title, +.openerp.kitten-mode-activated .oe-application .view-manager-main-content a.searchview_group_string, +.openerp.kitten-mode-activated .oe-application .view-manager-main-content label { + color: white; +} +.openerp.kitten-mode-activated .menu, +.openerp.kitten-mode-activated .header_corner, +.openerp.kitten-mode-activated .header_title, +.openerp.kitten-mode-activated .secondary_menu div, +.openerp.kitten-mode-activated .oe-application, +.openerp.kitten-mode-activated .oe_footer, +.openerp.kitten-mode-activated .loading, +.openerp.kitten-mode-activated .ui-dialog { + opacity:0.8; + filter:alpha(opacity=80); +} +.openerp.kitten-mode-activated .header .company_logo { + background: url(http://placekitten.com/g/180/46); +} +.openerp.kitten-mode-activated .loading { + background: #828282; + border-color: #828282; +} + +.openerp .oe-m2o-drop-down-button { + margin-left: -24px; +} +.openerp .oe-m2o-drop-down-button img { + margin-bottom: -4px; + cursor: pointer; +} +.openerp .oe-m2o input { + border-right: none; + margin-right: 0px !important; + padding-bottom: 2px !important; +} +.openerp .oe-m2o-disabled-cm { + color: grey; +} +.openerp ul[role="listbox"] li a { + font-size:80%; +} +.parent_top { + vertical-align: text-top; +} + +.openerp .oe-dialog-warning p { + padding-left: 1em; + font-size: 1.2em; + font-weight: bold; +} + +.openerp .dhx_mini_calendar { + -moz-box-shadow: none; + -khtml-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; +} +.openerp .oe-treeview-table { + width: 100%; + background-color : #FFFFFF; + border-spacing: 0; + +} +.openerp .oe-treeview-table tr:hover{ + color: blue; + background-color : #D8D8D8; +} +.treeview-tr, .treeview-td { + cursor: pointer; + vertical-align: top; + text-align: left; + border-bottom: 1px solid #CFCCCC; +} +.openerp .oe-treeview-table .oe-number { + text-align: right !important; +} +.treeview-tr span, .treeview-td span { + font-size: 90%; + font-weight: normal; + white-space: nowrap; + display: block; + } +.treeview-tr.oe-treeview-first { + background: transparent url(/web/static/src/img/expand.gif) 0 50% no-repeat; +} +.oe-open .treeview-tr.oe-treeview-first { + background-image: url(/web/static/src/img/collapse.gif); +} +.treeview-tr.oe-treeview-first span, +.treeview-td.oe-treeview-first span { + margin-left: 16px; +} + +.treeview-header { + vertical-align: top; + background-color : #D8D8D8; + white-space: nowrap; + text-align: left; + padding: 4px 5px; +} +/* Shortcuts*/ +.oe-shortcut-toggle { + height: 20px; + margin-top: 3px; + padding: 0; + width: 24px; + cursor: pointer; + display: block; + background: url(/web/static/src/img/add-shortcut.png) no-repeat center center; + float: left; +} +.oe-shortcut-remove{ + background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center; +} +.oe-shortcuts { + position: absolute; + margin: 0; + padding: 6px 15px; + top: 37px; + left: 197px; + right: 0; + height: 17px; + line-height: 1.2; +} +.oe-shortcuts ul { + display: block; + overflow: hidden; + list-style: none; + white-space: nowrap; + padding: 0; + margin: 0; +} +.oe-shortcuts li { + cursor: pointer; + display: -moz-inline-stack; + display: inline-block; + display: inline; /*IE7 */ + color: #fff; + text-align: center; + border-left: 1px solid #909090; + padding: 0 4px; + font-size: 80%; + font-weight: normal; + vertical-align: top; +} + +.oe-shortcuts li:hover { + background-color: #666; +} +.oe-shortcuts li:first-child { + border-left: none; + padding-left: 0; +} + +ul.oe-arrow-list { + padding-left: 1.1em; + margin: 0; + white-space: nowrap; +} +ul.oe-arrow-list li { + display: inline-block; + margin-left: -1em; +} +ul.oe-arrow-list li span { + vertical-align: top; + display: inline-block; + border: 1em solid #DEDEDE; + line-height:0em; +} +ul.oe-arrow-list .oe-arrow-list-before { + border-left-color: rgba(0,0,0,0); + border-right-width:0; +} +ul.oe-arrow-list .oe-arrow-list-after { + border-color: rgba(0,0,0,0); + border-left-color: #DEDEDE; + border-right-width:0; +} +ul.oe-arrow-list li.oe-arrow-list-selected span { + border-color: #B5B9FF; +} +ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-before { + border-left-color: rgba(0,0,0,0); +} +ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after { + border-color: rgba(0,0,0,0); + border-left-color: #B5B9FF; +} +.openerp ul.oe-arrow-list li:first-child span:first-child{ + -webkit-border-top-left-radius: 3px; + -moz-border-radius-topleft: 3px; + border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + -moz-border-radius-bottomleft: 3px; + border-bottom-left-radius: 3px; +} +.openerp ul.oe-arrow-list li:last-child span:last-child{ + -webkit-border-top-right-radius: 3px; + -moz-border-radius-topright: 3px; + border-top-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + -moz-border-radius-bottomright: 3px; + border-bottom-right-radius: 3px; +} +.openerp .oe_view_editor { + width:100%; + border-collapse : collapse; + margin-left: -12px; + + width: 100%; + background-color : white; + border-spacing: 0; +} +.openerp .oe_view_editor td{ + text-align: center; + white-space: nowrap; + border: 1px solid #D8D8D8; + + cursor: pointer; + font-size: 90%; +} +.openerp .oe_view_editor_field td{ + border: 0px !important; +} + +.openerp .oe_view_editor tr:hover { + background-color: #ecebf2; +} + + +/* Dialog traceback cases */ +.openerp .oe_error_detail{ + display: block; +} +.openerp .oe_error_send{ + display:block; +} +.openerp .oe_fielddiv{ + display:inline-block; + width:100%; +} +.openerp .oe_fielddiv input[type=text],textarea{ + width:100%; +} +/* for Alignment center */ +.openerp .oe_centeralign{ + text-align:center; +} + +.openerp .oe_applications_tiles { + color: #4C4C4C; + text-shadow: #EEE 0 1px 0; + margin: 0 20px; +} + +.openerp .oe_vm_switch { + margin:2px 0 0 0; +} + +.openerp .oe_vm_switch_form, +.openerp .oe_vm_switch_page, +.openerp .oe_vm_switch_tree, +.openerp .oe_vm_switch_list, +.openerp .oe_vm_switch_graph, +.openerp .oe_vm_switch_gantt, +.openerp .oe_vm_switch_calendar, +.openerp .oe_vm_switch_kanban, +.openerp .oe_vm_switch_diagram { + background: url("/web/static/src/img/views-icons-a.png") repeat-x scroll left top transparent; + overflow: hidden; + width: 22px; + height: 21px; + border: none; + background-position: 0px 0px; +} + +.openerp .oe_vm_switch_form span, +.openerp .oe_vm_switch_page span, +.openerp .oe_vm_switch_tree span, +.openerp .oe_vm_switch_list span, +.openerp .oe_vm_switch_graph span, +.openerp .oe_vm_switch_gantt span, +.openerp .oe_vm_switch_calendar span, +.openerp .oe_vm_switch_kanban span, +.openerp .oe_vm_switch_diagram span { + display: none; +} + +.openerp .oe_vm_switch_list { + background-position: 0px 0px; +} +.openerp .oe_vm_switch_list:active, +.openerp .oe_vm_switch_list:hover, +.openerp .oe_vm_switch_list:focus, +.openerp .oe_vm_switch_list[disabled="disabled"] { + background-position: 0px -21px; +} + +.openerp .oe_vm_switch_tree { + background-position: 0px 0px; +} +.openerp .oe_vm_switch_tree:active, +.openerp .oe_vm_switch_tree:hover, +.openerp .oe_vm_switch_tree:focus, +.openerp .oe_vm_switch_tree[disabled="disabled"] { + background-position: 0px -21px; +} + +.openerp .oe_vm_switch_form { + background-position: -22px 0px; +} +.openerp .oe_vm_switch_form:active, +.openerp .oe_vm_switch_form:hover, +.openerp .oe_vm_switch_form:focus, +.openerp .oe_vm_switch_form[disabled="disabled"] { + background-position: -22px -21px; +} + +.openerp .oe_vm_switch_page { + background-position: -22px 0px; +} +.openerp .oe_vm_switch_page:active, +.openerp .oe_vm_switch_page:hover, +.openerp .oe_vm_switch_page:focus, +.openerp .oe_vm_switch_page[disabled="disabled"] { + background-position: -22px -21px; +} +.openerp .oe_vm_switch_graph { + background-position: -44px 0px; +} +.openerp .oe_vm_switch_graph:active, +.openerp .oe_vm_switch_graph:hover, +.openerp .oe_vm_switch_graph:focus, +.openerp .oe_vm_switch_graph[disabled="disabled"] { + background-position: -44px -21px; +} + +.openerp .oe_vm_switch_gantt { + background-position: -66px 0px; +} +.openerp .oe_vm_switch_gantt:active, +.openerp .oe_vm_switch_gantt:hover, +.openerp .oe_vm_switch_gantt:focus, +.openerp .oe_vm_switch_gantt[disabled="disabled"] { + background-position: -66px -21px; +} + +.openerp .oe_vm_switch_calendar { + background-position: -88px 0px; +} +.openerp .oe_vm_switch_calendar:active, +.openerp .oe_vm_switch_calendar:hover, +.openerp .oe_vm_switch_calendar:focus, +.openerp .oe_vm_switch_calendar[disabled="disabled"] { + background-position: -88px -21px; +} +.openerp .oe_vm_switch_kanban { + background-position: -110px 0px; +} +.openerp .oe_vm_switch_kanban:active, +.openerp .oe_vm_switch_kanban:hover, +.openerp .oe_vm_switch_kanban:focus, +.openerp .oe_vm_switch_kanban[disabled="disabled"] { + background-position: -110px -21px; +} + +.openerp .oe_vm_switch_diagram { + background-position: 0px 0px; +} +.openerp .oe_vm_switch_diagram:active, +.openerp .oe_vm_switch_diagram:hover, +.openerp .oe_vm_switch_diagram:focus, +.openerp .oe_vm_switch_diagram[disabled="disabled"] { + background-position: 0px -21px; +} + +/* Buttons */ +.openerp .oe_button:link, +.openerp .oe_button:visited, +.openerp .oe_button { + display: inline-block; + border: 1px solid #ababab; + color: #404040; + font-size: 12px; + padding: 3px 10px; + text-align: center; + -o-background-size: 100% 100%; + -moz-background-size: 100% 100%; + -webkit-background-size: auto auto !important; + background-size: 100% 100%; + background: #d8d8d8 none; + background: none, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); + background: none, -webkit-linear-gradient(#efefef, #d8d8d8); + background: none, -moz-linear-gradient(#efefef, #d8d8d8); + background: none, -o-linear-gradient(top, #efefef, #d8d8d8); + background: none, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); + background: -ms-linear-gradient(top, #efefef, #d8d8d8); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#d8d8d8',GradientType=0 ); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -o-border-radius: 3px; + -ms-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; + -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; + -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); + -webkit-font-smoothing: antialiased; + outline: none; +} + +.openerp .oe_button:hover { + -o-background-size: 100% 100%; + -moz-background-size: 100% 100%; + -webkit-background-size: auto auto !important; + background-size: 100% 100%; + background: #e3e3e3 none; + background: none, -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); + background: none, -webkit-linear-gradient(#f6f6f6, #e3e3e3); + background: none, -moz-linear-gradient(#f6f6f6, #e3e3e3); + background: none, -o-linear-gradient(top, #f6f6f6, #e3e3e3); + background: none, -khtml-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); + background: -ms-linear-gradient(top, #f6f6f6, #e3e3e3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#e3e3e3',GradientType=0 ); + cursor: pointer; +} + +.openerp .oe_button:focus { + border: 1px solid #80bfff; + -o-background-size: 100% 100%; + -moz-background-size: 100% 100%; + -webkit-background-size: auto auto !important; + background-size: 100% 100%; + background: #e3e3e3, none; + background: none, -webkit-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); + background: none, -webkit-linear-gradient(#f6f6f6, #e3e3e3); + background: none, -moz-linear-gradient(#f6f6f6, #e3e3e3); + background: none, -o-linear-gradient(top, #f6f6f6, #e3e3e3); + background: none, -khtml-gradient(linear, left top, left bottom, from(#f6f6f6), to(#e3e3e3)); + background: -ms-linear-gradient(top, #f6f6f6, #e3e3e3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#e3e3e3',GradientType=0 ); + -moz-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; + -webkit-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; + -o-box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; + box-shadow: 0 0 3px #80bfff, 0 1px 1px rgba(255, 255, 255, 0.8) inset; +} + +.openerp .oe_button:active, +.openerp .oe_button.active { + background: #e3e3e3; + background: -moz-linear-gradient(top, #e3e3e3, #f6f6f6) #1b468f; + background: -webkit-gradient(linear, left top, left bottom, from(#e3e3e3), to(#f6f6f6)) #1b468f; + background: linear-gradient(top, #e3e3e3, #f6f6f6) #1b468f; + background: -ms-linear-gradient(top, #e3e3e3, #f6f6f6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3', endColorstr='#f6f6f6',GradientType=0 ); + -moz-box-shadow: none, 0 0 0 transparent; + -webkit-box-shadow: none, 0 0 0 transparent; + -o-box-shadow: none, 0 0 0 transparent; + box-shadow: none, 0 0 0 transparent; +} + +.openerp .oe_button.disabled, +.openerp .oe_button:disabled { + background: #efefef !important; + border: 1px solid #d1d1d1 !important; + font-size: 12px; + padding: 3px 10px; + -moz-box-shadow: none !important, 0 0 0 transparent; + -webkit-box-shadow: none !important, 0 0 0 transparent; + -o-box-shadow: none !important, 0 0 0 transparent; + box-shadow: none !important, 0 0 0 transparent; + color: #aaaaaa !important; + cursor: default; + text-shadow: 0 1px 1px white !important; +} + +.openerp select.oe_search-view-filters-management { + font-style: oblique; + color: #999999; +} + +.openerp .oe_search-view-filters-management option, +.openerp .oe_search-view-filters-management optgroup { + font-style: normal; + color: black; +} + +/* Debug stuff */ +.openerp .oe_debug_view_log { + font-size: 95%; +} +.openerp .oe_debug_view_log label { + display: block; + width: 49%; + text-align: right; + float: left; + font-weight: bold; + color: #009; +} +.openerp .oe_debug_view_log span { + display: block; + width: 49%; + float: right; + color: #333; +} + +/* Internet Explorer Fix */ +a img { + border: none; +} diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 558631c6f13..8997896a57d 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1080,7 +1080,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC this._current_state = null; }, render_element: function() { - this.$element.addClass("openerp"); + this.$element.addClass("openerp openerp2"); }, start: function() { var self = this; -- cgit v1.2.3 From 3baa0d76081f0d5e2d6ebc10296a8efaf656cfbc Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 22 Feb 2012 17:13:24 +0100 Subject: [FIX] Widget: correctly check if rendered template is empty bzr revid: fme@openerp.com-20120222161324-fut6gawp70qff0ev --- addons/web/static/src/js/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 086f7f3b56a..b394570b72d 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1086,7 +1086,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W var rendered = null; if (this.template) rendered = openerp.web.qweb.render(this.template, {widget: this}); - if (rendered) { + if (_.str.trim(rendered)) { var elem = $(rendered); this.$element.replaceWith(elem); this.$element = elem; -- cgit v1.2.3 From 3644361b1f3f429e15efde6e80e1cb26456cdad8 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 23 Feb 2012 14:11:40 +0100 Subject: [IMP] Webclient not OldWidget anymore. Renamed template to 'WebClient' Made a seperate revision because of edi addon dependency bzr revid: fme@openerp.com-20120223131140-2p7uycfs2el6ibei --- addons/web/static/src/js/chrome.js | 12 ++++-------- addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 15d0d0fc633..63587ad59fa 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1065,12 +1065,10 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ } }); -openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebClient */{ +openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClient */{ /** * @constructs openerp.web.WebClient - * @extends openerp.web.OldWidget - * - * @param element_id + * @extends openerp.web.Widget */ init: function(parent) { var self = this; @@ -1079,11 +1077,9 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC this._current_state = null; }, - render_element: function() { - this.$element.addClass("openerp openerp2"); - }, start: function() { var self = this; + this.$element.addClass("openerp openerp2"); if (jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) { this.$element.addClass("kitten-mode-activated"); this.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) { @@ -1123,7 +1119,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC var self = this; this.destroy_content(); this.show_common(); - self.$table = $(QWeb.render("Interface", {})); + self.$table = $(QWeb.render("WebClient", {})); self.$element.append(self.$table); self.header = new openerp.web.Header(self); self.header.on_logout.add(this.proxy('on_logout')); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 98d99f74ef6..3d791fbbbd1 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -17,7 +17,7 @@
- +
'); - } - if (self.options.isClarkGable) { - $new_row.prepend(''); - } // pad in case of groupby _(self.columns).each(function (column) { if (column.meta) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 10779ee5994..98d99f74ef6 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -728,6 +728,8 @@
'); - } - if (self.options.isClarkGable) { - $new_row.prepend(''); - } // pad in case of groupby _(self.columns).each(function (column) { if (column.meta) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 10779ee5994..98d99f74ef6 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -728,6 +728,8 @@
-- cgit v1.2.3 From 865ffbd4cc0a8cd16f3b0e17f7a2b28e6408262b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 23 Feb 2012 14:55:03 +0100 Subject: [BREAK] Prepare main div container for new layout bzr revid: fme@openerp.com-20120223135503-e89bnthvhbv2z58a --- addons/web/static/src/css/base.sass | 46 ++++++++++++++++++++++++++++++++++++- addons/web/static/src/xml/base.xml | 36 +++++++++++++++-------------- 2 files changed, 64 insertions(+), 18 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index dcb078e8903..51e11840bf9 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1,3 +1,47 @@ -// vim:tabstop=4:shiftwidth=4:softtabstop=4 +// Mixins {{{ +@mixin vertical-gradient($startColor: #555, $endColor: #333) + background: $startColor + background: -moz-linear-gradient($startColor, $endColor) + background: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) + background: -webkit-linear-gradient($startColor, $endColor) + +@mixin radial-gradient($gradient) + background-position: center center + background-image: radial-gradient($gradient) + background-image: -moz-radial-gradient($gradient) + background-image: -webkit-radial-gradient(circle, $gradient) + +@mixin radius($radius: 5px) + -moz-border-radius: $radius + -webkit-border-radius: $radius + border-radius: $radius + +@mixin box-shadow($bsval: 0px 1px 4px #777) + -moz-box-shadow: $bsval + -webkit-box-shadow: $bsval + -box-shadow: $bsval + +@mixin transition($transval: (border linear 0.2s, box-shadow linear 0.2s)) + -webkit-transition: $transval + -moz-transition: $transval + -ms-transition: $transval + -o-transition: $transval + transition: $transval + +@mixin opacity($opacity: .5) + filter: alpha(opacity=$opacity * 100) + -khtml-opacity: $opacity + -moz-opacity: $opacity + opacity: $opacity + +@mixin background-clip($clip: padding-box) + -webkit-background-clip: $clip + -moz-background-clip: $clip + background-clip: $clip +// }}} + .openerp2 // Minh's playground. + +// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" +// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 3d791fbbbd1..89e28398bc9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -18,15 +18,24 @@ -
-- cgit v1.2.3 From 50853cbaac022fea60009b49c29bde2bac592c2a Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 23 Feb 2012 14:39:37 +0100 Subject: [FIX] ability to backup databases in case listing databases is forbidden (via --no-database-list on the server) lp bug: https://launchpad.net/bugs/939428 fixed bzr revid: xmo@openerp.com-20120223133937-3115jyzjtbzequbq --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index ba31ec81846..132cc3b5851 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -449,7 +449,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/xml/base.xml b/addons/web/static/src/xml/base.xml index 09ae4457221..1a2f80df8b3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -154,7 +154,7 @@ -
- - - - - - - - - -
+
+
-
+ +
+ +
+
+ @@ -36,16 +45,9 @@
-
- -
+ +
+
-- cgit v1.2.3 From a55e7148e344319c70fb7c9bc7fa41b0d94c06b4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 23 Feb 2012 15:51:57 +0100 Subject: [FIX] correctly set dataset index when selecting a record in list view, so switching to page/form switches to the first selected record, not the first record of the page lp bug: https://launchpad.net/bugs/939314 fixed bzr revid: xmo@openerp.com-20120223145157-rkkwg6pwcr6hh7st --- addons/web/static/src/js/view_list.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index eb13bbd927b..ec8e6a17c87 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -540,19 +540,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}; })); -- cgit v1.2.3 From a90d466ccbb23f8bc00c6fb5bcb1ce86adbdae68 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 23 Feb 2012 16:02:30 +0100 Subject: [ADD] Add styles for new main menu bzr revid: fme@openerp.com-20120223150230-n935rq8bv65a6gbj --- addons/web/static/src/css/base.css | 125 ++++++++++++++++++++++++++++++++++++ addons/web/static/src/css/base.sass | 95 ++++++++++++++++++++++++++- addons/web/static/src/js/chrome.js | 20 +++--- addons/web/static/src/xml/base.xml | 15 ++--- 4 files changed, 235 insertions(+), 20 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index e69de29bb2d..71739e8167d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -0,0 +1,125 @@ +/* line 43, base.sass */ +.openerp2 { + padding: 0; + margin: 0; + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; + color: #4c4c4c; + font-size: 13px; + background: white; + position: relative; +} +/* line 53, base.sass */ +.openerp2 a { + color: #4c4c4c; + text-decoration: none; +} +/* line 59, base.sass */ +.openerp2 .oe_webclient { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} +/* line 68, base.sass */ +.openerp2 .oe_topbar { + width: 100%; + height: 31px; + border-top: solid 1px #d3d3d3; + border-bottom: solid 1px black; + background: #646060; + background: -moz-linear-gradient(#646060, #262626); + background: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); + background: -webkit-linear-gradient(#646060, #262626); +} +/* line 75, base.sass */ +.openerp2 .oe_topbar .oe_topbar_item { + float: left; +} +/* line 77, base.sass */ +.openerp2 .oe_topbar .oe_topbar_item li { + float: left; +} +/* line 79, base.sass */ +.openerp2 .oe_topbar .oe_topbar_item li a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} +/* line 87, base.sass */ +.openerp2 .oe_topbar .oe_topbar_item li a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +/* line 91, base.sass */ +.openerp2 .oe_topbar .oe_topbar_item .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +/* line 97, base.sass */ +.openerp2 .oe_topbar .oe_topbar_avatar { + width: 24px; + height: 24px; + margin: -2px 2px 0 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; +} +/* line 105, base.sass */ +.openerp2 .oe_menu { + float: left; + padding: 0; + margin: 0; +} +/* line 109, base.sass */ +.openerp2 .oe_menu li { + list-style-type: none; + float: left; +} +/* line 112, base.sass */ +.openerp2 .oe_menu a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} +/* line 120, base.sass */ +.openerp2 .oe_menu a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} +/* line 124, base.sass */ +.openerp2 .oe_menu .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; +} + +/* line 133, base.sass */ +.openerp .oe-shortcuts { + position: static; +} +/* line 135, base.sass */ +.openerp #oe_header { + clear: both; +} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 51e11840bf9..090c0ac822f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -41,7 +41,100 @@ // }}} .openerp2 - // Minh's playground. + // Common styles {{{ + padding: 0 + margin: 0 + font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif + color: #4c4c4c + font-size: 13px + background: white + position: relative + + a + color: #4c4c4c + text-decoration: none + // }}} + + // WebClient {{{ + .oe_webclient + position: absolute + top: 0 + bottom: 0 + left: 0 + right: 0 + // }}} + + // Topbar {{{ + .oe_topbar + width: 100% + height: 31px + border-top: solid 1px #d3d3d3 + border-bottom: solid 1px black + @include vertical-gradient(#646060, #262626) + + .oe_topbar_item + float: left + li + float: left + a + display: block + padding: 5px 10px 7px + line-height: 20px + height: 20px + color: #eee + vertical-align: top + text-shadow: 0 1px 1px rgba(0,0,0,0.2) + &:hover + background: #303030 + color: white + @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + .oe_active + background: #303030 + font-weight: bold + color: white + @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + + .oe_topbar_avatar + width: 24px + height: 24px + margin: -2px 2px 0 0 + @include radius(4px) + // }}} + + // Menu {{{ + .oe_menu + float: left + padding: 0 + margin: 0 + li + list-style-type: none + float: left + a + display: block + padding: 5px 10px 7px + line-height: 20px + height: 20px + color: #eee + vertical-align: top + text-shadow: 0 1px 1px rgba(0,0,0,0.2) + &:hover + background: #303030 + color: white + @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + .oe_active + background: #303030 + font-weight: bold + color: white + @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + // }}} + +.openerp + // Transitional overrides for old styles {{{ + .oe-shortcuts + position: static + #oe_header + clear: both + // }}} // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" // vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 63587ad59fa..9d26b39ffad 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -887,7 +887,7 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ on_toggle_fold: function() { this.$secondary_menu.toggleClass('oe_folded').toggleClass('oe_unfolded'); if (this.folded) { - this.$secondary_menu.find('.oe_secondary_menu.active').show(); + this.$secondary_menu.find('.oe_secondary_menu.oe_active').show(); } else { this.$secondary_menu.find('.oe_secondary_menu').hide(); } @@ -903,8 +903,8 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ * @param {Number} menu_id database id of the terminal menu to select */ open_menu: function (menu_id) { - this.$element.add(this.$secondary_menu).find('.active') - .removeClass('active'); + this.$element.add(this.$secondary_menu).find('.oe_active') + .removeClass('oe_active'); this.$secondary_menu.find('> .oe_secondary_menu').hide(); var $primary_menu; @@ -913,7 +913,7 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ if ($secondary_submenu.length) { for(;;) { if ($secondary_submenu.hasClass('leaf')) { - $secondary_submenu.addClass('active'); + $secondary_submenu.addClass('oe_active'); } else if ($secondary_submenu.hasClass('submenu')) { $secondary_submenu.addClass('opened') } @@ -932,9 +932,9 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ if (!$primary_menu.length) { return; } - $primary_menu.addClass('active'); + $primary_menu.addClass('oe_active'); this.$secondary_menu.find( - 'div[data-menu-parent=' + $primary_menu.data('menu') + ']').addClass('active').toggle(!this.folded); + 'div[data-menu-parent=' + $primary_menu.data('menu') + ']').addClass('oe_active').toggle(!this.folded); }, on_menu_click: function(ev, id) { id = id || 0; @@ -964,7 +964,7 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ }, do_menu_click: function($clicked_menu, manual) { var $sub_menu, $main_menu, - active = $clicked_menu.is('.active'), + active = $clicked_menu.is('.oe_active'), sub_menu_visible = false, has_submenu_items = false; @@ -980,8 +980,8 @@ openerp.web.Menu = openerp.web.OldWidget.extend(/** @lends openerp.web.Menu# */ has_submenu_items = !!$sub_menu.children().length; this.$secondary_menu.find('.oe_secondary_menu').hide(); - $('.active', this.$element.add(this.$secondary_menu)).removeClass('active'); - $main_menu.add($clicked_menu).add($sub_menu).addClass('active'); + $('.oe_active', this.$element.add(this.$secondary_menu)).removeClass('oe_active'); + $main_menu.add($clicked_menu).add($sub_menu).addClass('oe_active'); if (has_submenu_items) { if (!(this.folded && manual)) { @@ -1125,7 +1125,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.header.on_logout.add(this.proxy('on_logout')); self.header.on_action.add(this.proxy('on_menu_action')); self.header.appendTo($("#oe_header")); - self.menu = new openerp.web.Menu(self, "oe_menu", "oe_secondary_menu"); + self.menu = new openerp.web.Menu(self, "oe_menu_temporary_id", "oe_secondary_menu"); self.menu.on_action.add(this.proxy('on_menu_action')); self.menu.start(); }, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 89e28398bc9..81d9f5ccd09 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -20,9 +20,9 @@
-
- +
+
- +
+
+
@@ -373,6 +375,7 @@ t-att-data-shortcut-id="shortcut.id" > +
  • @@ -383,10 +386,6 @@
-
- - -
+ -- cgit v1.2.3 From fa510462f4c49d434cd2ed4145eb8c3c99dae0e6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 23 Feb 2012 17:10:41 +0100 Subject: [imp] switched to nivjs bzr revid: nicolas.vanhoren@openerp.com-20120223161041-mymbna11fsp3bo9m --- addons/web/static/src/js/core.js | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index fd0abcb0eb4..69ec98e7350 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -925,40 +925,6 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. } }); -openerp.web.ParentedMixin = { - __parented_mixin: true, - setParent: function(parent) { - if(this.getParent()) { - if (this.getParent().__parented_mixin) { - this.getParent().__parented_children = _.without(this.getParent().getChildren(), this); - } - this.__parented_parent = undefined; - } - this.__parented_parent = parent; - if(parent && parent.__parented_mixin) { - if (!parent.__parented_children) - parent.__parented_children = []; - parent.__parented_children.push(this); - } - }, - getParent: function() { - return this.__parented_parent; - }, - getChildren: function() { - return this.__parented_children ? _.clone(this.__parented_children) : []; - }, - isDestroyed: function() { - return this.__parented_destroyed; - }, - destroy: function() { - _.each(this.getChildren(), function(el) { - el.destroy(); - }); - this.setParent(undefined); - this.__parented_destroyed = true; - }, -}; - /** * Base class for all visual components. Provides a lot of functionalities helpful * for the management of a part of the DOM. @@ -1007,7 +973,7 @@ openerp.web.ParentedMixin = { * * That will kill the widget in a clean way and erase its content from the dom. */ -openerp.web.Widget = openerp.web.CallbackEnabled.extend(openerp.web.ParentedMixin).extend(/** @lends openerp.web.Widget# */{ +openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).extend(/** @lends openerp.web.Widget# */{ /** * The name of the QWeb template that will be used for rendering. Must be * redefined in subclasses or the default render() method can not be used. -- cgit v1.2.3 From b64f4c6875b099aa780c5cfd15bfcacec88c2003 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 23 Feb 2012 18:44:39 +0100 Subject: [ADD] Added dropdown menu. bzr revid: fme@openerp.com-20120223174439-nlyeqjobi230e7xx --- addons/web/static/src/css/base.css | 101 ++++++++++++++++++++++++++++-------- addons/web/static/src/css/base.sass | 65 ++++++++++++++++++++++- addons/web/static/src/js/chrome.js | 77 ++++++++++++++++++++++++++- addons/web/static/src/xml/base.xml | 19 ++++++- 4 files changed, 237 insertions(+), 25 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 71739e8167d..c9774bcfa73 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,3 @@ -/* line 43, base.sass */ .openerp2 { padding: 0; margin: 0; @@ -8,12 +7,9 @@ background: white; position: relative; } -/* line 53, base.sass */ .openerp2 a { - color: #4c4c4c; text-decoration: none; } -/* line 59, base.sass */ .openerp2 .oe_webclient { position: absolute; top: 0; @@ -21,7 +17,6 @@ left: 0; right: 0; } -/* line 68, base.sass */ .openerp2 .oe_topbar { width: 100%; height: 31px; @@ -32,15 +27,9 @@ background: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); background: -webkit-linear-gradient(#646060, #262626); } -/* line 75, base.sass */ -.openerp2 .oe_topbar .oe_topbar_item { - float: left; -} -/* line 77, base.sass */ .openerp2 .oe_topbar .oe_topbar_item li { float: left; } -/* line 79, base.sass */ .openerp2 .oe_topbar .oe_topbar_item li a { display: block; padding: 5px 10px 7px; @@ -50,7 +39,6 @@ vertical-align: top; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } -/* line 87, base.sass */ .openerp2 .oe_topbar .oe_topbar_item li a:hover { background: #303030; color: white; @@ -58,7 +46,6 @@ -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } -/* line 91, base.sass */ .openerp2 .oe_topbar .oe_topbar_item .oe_active { background: #303030; font-weight: bold; @@ -67,7 +54,6 @@ -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } -/* line 97, base.sass */ .openerp2 .oe_topbar .oe_topbar_avatar { width: 24px; height: 24px; @@ -76,18 +62,15 @@ -webkit-border-radius: 4px; border-radius: 4px; } -/* line 105, base.sass */ .openerp2 .oe_menu { float: left; padding: 0; margin: 0; } -/* line 109, base.sass */ .openerp2 .oe_menu li { list-style-type: none; float: left; } -/* line 112, base.sass */ .openerp2 .oe_menu a { display: block; padding: 5px 10px 7px; @@ -97,7 +80,6 @@ vertical-align: top; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } -/* line 120, base.sass */ .openerp2 .oe_menu a:hover { background: #303030; color: white; @@ -105,7 +87,6 @@ -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } -/* line 124, base.sass */ .openerp2 .oe_menu .oe_active { background: #303030; font-weight: bold; @@ -114,12 +95,90 @@ -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } +.openerp2 .oe_dropdown_menu { + float: right; + padding: 0; + margin: 0; +} +.openerp2 .oe_dropdown_menu li { + list-style-type: none; + float: left; +} +.openerp2 .oe_dropdown_menu .oe_dropdown { + position: relative; +} +.openerp2 .oe_dropdown_menu .dropdown-toggle:after { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-top: 8px; + margin-left: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid white; + filter: alpha(opacity=50); + -khtml-opacity: 0.5; + -moz-opacity: 0.5; + opacity: 0.5; +} +.openerp2 .oe_dropdown_menu .oe_dropdown_options { + float: left; + background: #333333; + background: rgba(37, 37, 37, 0.9); + display: none; + position: absolute; + top: 32px; + right: -1px; + border: 0; + z-index: 900; + width: 160px; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + zoom: 1; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; +} +.openerp2 .oe_dropdown_menu .oe_dropdown_options li { + float: none; + display: block; + background-color: none; +} +.openerp2 .oe_dropdown_menu .oe_dropdown_options li a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #eeeeee; +} +.openerp2 .oe_dropdown_menu .oe_dropdown_options li a:hover { + background: #292929; + background: -moz-linear-gradient(#292929, #191919); + background: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background: -webkit-linear-gradient(#292929, #191919); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; +} -/* line 133, base.sass */ .openerp .oe-shortcuts { position: static; } -/* line 135, base.sass */ .openerp #oe_header { clear: both; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 090c0ac822f..ab144a5ceec 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -51,7 +51,6 @@ position: relative a - color: #4c4c4c text-decoration: none // }}} @@ -73,7 +72,6 @@ @include vertical-gradient(#646060, #262626) .oe_topbar_item - float: left li float: left a @@ -128,6 +126,69 @@ @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) // }}} + // DropDown Menu {{{ + .oe_dropdown_menu + float: right + padding: 0 + margin: 0 + li + list-style-type: none + float: left + .oe_dropdown + position: relative + + .dropdown-toggle:after + width: 0 + height: 0 + display: inline-block + content: "&darr" + text-indent: -99999px + vertical-align: top + margin-top: 8px + margin-left: 4px + border-left: 4px solid transparent + border-right: 4px solid transparent + border-top: 4px solid white + @include opacity(0.5) + + .oe_dropdown_options + float: left + background: #333 + background: rgba(37,37,37,0.9) + display: none + position: absolute + top: 32px + right: -1px + border: 0 + z-index: 900 + width: 160px + margin-left: 0 + margin-right: 0 + padding: 6px 0 + zoom: 1 + border-color: #999 + border-color: rgba(0, 0, 0, 0.2) + border-style: solid + border-width: 0 1px 1px + @include radius(0 0 6px 6px) + @include box-shadow(0 1px 4px rgba(0,0,0,0.3)) + @include background-clip() + li + float: none + display: block + background-color: none + a + display: block + padding: 4px 15px + clear: both + font-weight: normal + line-height: 18px + color: #eee + &:hover + @include vertical-gradient(#292929, #191919) + @include box-shadow(none) + // }}} + .openerp // Transitional overrides for old styles {{{ .oe-shortcuts diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 4e648e46856..838fdb4f79f 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -984,7 +984,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ return false; }, do_hide_secondary: function() { - this.$secondary_menu.hide(); + //this.$secondary_menu.hide(); }, do_show_secondary: function($sub_menu, $main_menu) { var self = this; @@ -1008,6 +1008,78 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } }); +openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Header# */{ + template: "DropDownMenu", + /** + * @constructs openerp.web.DropDownMenu + * @extends openerp.web.OldWidget + * + * @param parent + */ + init: function(parent) { + this._super(parent); + }, + start: function() { + var self = this; + this._super.apply(this, arguments); + $('html').bind('click', function() { + self.$element.find('.oe_dropdown_options').hide(); + }); + this.$element.find('.oe_dropdown_toggle').click(function() { + self.$element.find('.oe_dropdown_options').toggle(); + return false; + }); + this.$element.find('.oe_dropdown_options li a').click(function() { + var f = self['on_menu_' + $(this).data('menu')]; + f && f(); + self.$element.find('.oe_dropdown_options').hide(); + return false; + }); + }, + on_menu_logout: function() { + }, + on_menu_settings: function() { + var self = this; + var action_manager = new openerp.web.ActionManager(this); + var dataset = new openerp.web.DataSet (this,'res.users',this.context); + dataset.call ('action_get','',function (result){ + self.rpc('/web/action/load', {action_id:result}, function(result){ + action_manager.do_action(_.extend(result['result'], { + res_id: self.session.uid, + res_model: 'res.users', + flags: { + action_buttons: false, + search_view: false, + sidebar: false, + views_switcher: false, + pager: false + } + })); + }); + }); + this.dialog = new openerp.web.Dialog(this,{ + title: _t("Preferences"), + width: '700px', + buttons: [ + {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, + {text: _t("Change password"), click: function(){ self.change_password(); }}, + {text: _t("Save"), click: function(){ + var inner_viewmanager = action_manager.inner_viewmanager; + inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() + .then(function() { + self.dialog.destroy(); + // needs to refresh interface in case language changed + window.location.reload(); + }); + } + } + ] + }).open(); + action_manager.appendTo(this.dialog); + action_manager.render(this.dialog); + } +}); + openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClient */{ /** * @constructs openerp.web.WebClient @@ -1071,6 +1143,9 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.menu = new openerp.web.Menu(self); self.menu.replace(this.$element.find('.oe_menu_placeholder')); self.menu.on_action.add(this.proxy('on_menu_action')); + self.dropdown_menu = new openerp.web.DropDownMenu(self); + self.dropdown_menu.replace(this.$element.find('.oe_dropdown_menu_placeholder')); + self.dropdown_menu.on_menu_logout.add(this.proxy('on_logout')); }, show_common: function() { var self = this; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 2e78ef83848..9b361f13e8f 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -21,8 +21,9 @@
+
-
+
+
  • Settings
  • +
  • Log out
  • + + + + +
    -- cgit v1.2.3 From 87f65775e00404063104486954eefe2b649e93f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 24 Feb 2012 10:53:10 +0100 Subject: Correct viewport integration, cosmetic changes, node loops bzr revid: fva@openerp.com-20120224095310-r3bdlx09n5eaxrvk --- addons/web/static/src/js/view_form.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6b7acd5a244..d98c597c8a6 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2835,6 +2835,10 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope this.new_object(); } }, + stop: function () { + this.$element.dialog('close'); + this._super(); + }, setup_search_view: function(search_defaults) { var self = this; if (this.searchview) { -- cgit v1.2.3 From a2b98743785dc4290e5b5adfac5892c2e0707fda Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 24 Feb 2012 14:26:39 +0100 Subject: [imp] adapted widget to new lib bzr revid: nicolas.vanhoren@openerp.com-20120224132639-um1aitu3bymnk7wo --- addons/web/static/src/js/core.js | 108 +++------------------------------------ 1 file changed, 7 insertions(+), 101 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 69ec98e7350..9a564c653bb 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -362,7 +362,7 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry } }); -openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.CallbackEnabled# */{ +openerp.web.CallbackEnabledMixin = { /** * @constructs openerp.web.CallbackEnabled * @extends openerp.web.Class @@ -404,7 +404,9 @@ openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.Ca return self[method_name].apply(self, arguments); } } -}); +}; + +openerp.web.CallbackEnabled = openerp.web.Class.extend(_.extend({}, openerp.web.CallbackEnabledMixin)); openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Connection# */{ /** @@ -973,7 +975,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * * That will kill the widget in a clean way and erase its content from the dom. */ -openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).extend(/** @lends openerp.web.Widget# */{ +openerp.web.Widget = niv.Widget.extend(_.extend({}, openerp.web.CallbackEnabledMixin, { /** * The name of the QWeb template that will be used for rendering. Must be * redefined in subclasses or the default render() method can not be used. @@ -981,11 +983,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).exten * @type string */ template: null, - /** - * Tag name when creating a default $element. - * @type string - */ - tag_name: 'div', /** * Constructs the widget and sets its parent if a parent is given. * @@ -1001,88 +998,10 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).exten * for new components this argument should not be provided any more. */ init: function(parent) { + openerp.web.CallbackEnabledMixin.init.call(this); this._super(); this.session = openerp.connection; - - this.$element = $(document.createElement(this.tag_name)); - - this.setParent(parent); - }, - /** - * Destroys the current widget, also destroys all its children before destroying itself. - */ - destroy: function() { - _.each(this.getChildren(), function(el) { - el.destroy(); - }); - if(this.$element != null) { - this.$element.remove(); - } - this._super(); - }, - /** - * Renders the current widget and appends it to the given jQuery object or Widget. - * - * @param target A jQuery object or a Widget instance. - */ - appendTo: function(target) { - var self = this; - return this._render_and_insert(function(t) { - self.$element.appendTo(t); - }, target); - }, - /** - * Renders the current widget and prepends it to the given jQuery object or Widget. - * - * @param target A jQuery object or a Widget instance. - */ - prependTo: function(target) { - var self = this; - return this._render_and_insert(function(t) { - self.$element.prependTo(t); - }, target); }, - /** - * Renders the current widget and inserts it after to the given jQuery object or Widget. - * - * @param target A jQuery object or a Widget instance. - */ - insertAfter: function(target) { - var self = this; - return this._render_and_insert(function(t) { - self.$element.insertAfter(t); - }, target); - }, - /** - * Renders the current widget and inserts it before to the given jQuery object or Widget. - * - * @param target A jQuery object or a Widget instance. - */ - insertBefore: function(target) { - var self = this; - return this._render_and_insert(function(t) { - self.$element.insertBefore(t); - }, target); - }, - /** - * Renders the current widget and replaces the given jQuery object. - * - * @param target A jQuery object or a Widget instance. - */ - replace: function(target) { - return this._render_and_insert(_.bind(function(t) { - this.$element.replaceAll(t); - }, this), target); - }, - _render_and_insert: function(insertion, target) { - this.render_element(); - if (target instanceof openerp.web.Widget) - target = target.$element; - insertion(target); - this.on_inserted(this.$element, this); - return this.start(); - }, - on_inserted: function(element, widget) {}, /** * Renders the element. The default implementation renders the widget using QWeb, * `this.template` must be defined. The context given to QWeb contains the "widget" @@ -1098,18 +1017,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).exten this.$element = elem; } }, - /** - * Method called after rendering. Mostly used to bind actions, perform asynchronous - * calls, etc... - * - * By convention, the method should return a promise to inform the caller when - * this widget has been initialized. - * - * @returns {jQuery.Deferred} - */ - start: function() { - return $.Deferred().done().promise(); - }, /** * Informs the action manager to do an action. This supposes that * the action manager can be found amongst the ancestors of the current widget. @@ -1133,7 +1040,6 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).exten } return false; }, - rpc: function(url, data, success, error) { var def = $.Deferred().then(success, error); var self = this; @@ -1146,7 +1052,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(niv.ParentedMixin).exten }); return def.promise(); } -}); +})); /** * @deprecated use :class:`openerp.web.Widget` -- cgit v1.2.3 From b6f93c8fa600b227ed6266e11c91fc7cecde36fa Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 24 Feb 2012 14:58:59 +0100 Subject: [fix] some bugs providing the web client to work bzr revid: nicolas.vanhoren@openerp.com-20120224135859-w937wgm51328dbk1 --- addons/web/static/src/js/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 9a564c653bb..7b88279cf16 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -999,7 +999,7 @@ openerp.web.Widget = niv.Widget.extend(_.extend({}, openerp.web.CallbackEnabledM */ init: function(parent) { openerp.web.CallbackEnabledMixin.init.call(this); - this._super(); + this._super(parent); this.session = openerp.connection; }, /** -- cgit v1.2.3 From 4ff154c30856f5ed80589015bf0552a3852f0a9f Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 24 Feb 2012 15:51:04 +0100 Subject: [imp] switched openerp's class to lib's class bzr revid: nicolas.vanhoren@openerp.com-20120224145104-iues3wzd4inwywpd --- addons/web/static/src/js/core.js | 104 +-------------------------------------- 1 file changed, 1 insertion(+), 103 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 7b88279cf16..93b9a237bf0 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -10,110 +10,8 @@ if (!console.debug) { } openerp.web.core = function(openerp) { -/** - * John Resig Class with factory improvement - */ -(function() { - var initializing = false, - fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; - // The web Class implementation (does nothing) - /** - * Extended version of John Resig's Class pattern - * - * @class - */ - openerp.web.Class = function(){}; - - /** - * Subclass an existing class - * - * @param {Object} prop class-level properties (class attributes and instance methods) to set on the new class - */ - openerp.web.Class.extend = function(prop) { - var _super = this.prototype; - - // Instantiate a web class (but only create the instance, - // don't run the init constructor) - initializing = true; - var prototype = new this(); - initializing = false; - - // Copy the properties over onto the new prototype - for (var name in prop) { - // Check if we're overwriting an existing function - prototype[name] = typeof prop[name] == "function" && - typeof _super[name] == "function" && - fnTest.test(prop[name]) ? - (function(name, fn) { - return function() { - var tmp = this._super; - - // Add a new ._super() method that is the same - // method but on the super-class - this._super = _super[name]; - - // The method only need to be bound temporarily, so - // we remove it when we're done executing - var ret = fn.apply(this, arguments); - this._super = tmp; - return ret; - }; - })(name, prop[name]) : - prop[name]; - } - - // The dummy class constructor - function Class() { - // All construction is actually done in the init method - if (!initializing && this.init) { - var ret = this.init.apply(this, arguments); - if (ret) { return ret; } - } - return this; - } - Class.include = function (properties) { - for (var name in properties) { - if (typeof properties[name] !== 'function' - || !fnTest.test(properties[name])) { - prototype[name] = properties[name]; - } else if (typeof prototype[name] === 'function' - && prototype.hasOwnProperty(name)) { - prototype[name] = (function (name, fn, previous) { - return function () { - var tmp = this._super; - this._super = previous; - var ret = fn.apply(this, arguments); - this._super = tmp; - return ret; - } - })(name, properties[name], prototype[name]); - } else if (typeof _super[name] === 'function') { - prototype[name] = (function (name, fn) { - return function () { - var tmp = this._super; - this._super = _super[name]; - var ret = fn.apply(this, arguments); - this._super = tmp; - return ret; - } - })(name, properties[name]); - } - } - }; - - // Populate our constructed prototype object - Class.prototype = prototype; - - // Enforce the constructor to be what we expect - Class.constructor = Class; - - // And make this class extendable - Class.extend = arguments.callee; - - return Class; - }; -})(); +openerp.web.Class = niv.Class; openerp.web.callback = function(obj, method) { var callback = function() { -- cgit v1.2.3 From 7969c1f08003382aa9c3102b79ad2b68da6c3301 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Fri, 24 Feb 2012 15:54:33 +0100 Subject: [fix] renammed bind to session_bind bzr revid: nicolas.vanhoren@openerp.com-20120224145433-c5bunu2fuciqj2uc --- addons/web/static/src/js/chrome.js | 4 ++-- addons/web/static/src/js/core.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 060abeefc2c..73ea24b1b31 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1090,7 +1090,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC self.$element.toggleClass('clark-gable'); }); } - this.session.bind().then(function() { + this.session.bind_session().then(function() { if (!self.session.session_is_valid()) { self.show_login(); } @@ -1258,7 +1258,7 @@ openerp.web.embed = function (origin, dbname, login, key, action, options) { var sc = document.getElementsByTagName('script'); currentScript = sc[sc.length-1]; } - openerp.connection.bind(origin).then(function () { + openerp.connection.bind_session(origin).then(function () { openerp.connection.session_authenticate(dbname, login, key, true).then(function () { var client = new openerp.web.EmbeddedClient(action, options); client.insertAfter(currentScript); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 93b9a237bf0..da100c19241 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -322,7 +322,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. this.name = openerp._session_id; this.qweb_mutex = new $.Mutex(); }, - bind: function(origin) { + bind_session: function(origin) { var window_origin = location.protocol+"//"+location.host, self=this; this.origin = origin ? _.str.rtrim(origin,'/') : window_origin; this.prefix = this.origin; -- cgit v1.2.3 From 739f719ad6f26c007deb6b48134734588538bcbe Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 27 Feb 2012 08:37:21 +0100 Subject: [UP] py.parse 0.2 to py.js 0.4 ~ should probably go through a testing phase (checking its result against that of eval_domain_and_context) for a while, but apart from that it's supposed to work. 'stdlib' stuff (datetime.date.today, datetime.timedelta, time.localtime, time.time, time.strftime) still need to be written. Isn't there also a dateutil.relativedeleta somewhere? Anyway that needs to be done and the various evaluation contexts need to be defined, but the valuator itself should mostly work. bzr revid: xmo@openerp.com-20120227073721-nkgeiqacbzch8xev --- addons/web/static/src/js/core.js | 2 +- addons/web/static/src/js/view_list.js | 2 +- addons/web/static/src/js/view_tree.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index f02efc07173..7c2a3876e42 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1237,7 +1237,7 @@ openerp.web.TranslationDataBase = openerp.web.Class.extend(/** @lends openerp.we if (translation_bundle.lang_parameters) { this.parameters = translation_bundle.lang_parameters; this.parameters.grouping = py.eval( - this.parameters.grouping).toJSON(); + this.parameters.grouping); } }, add_module_translation: function(mod) { diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 2394e12eb4d..30654da0c7d 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -158,7 +158,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# var pair = this.colors[i], color = pair[0], expression = pair[1]; - if (py.evaluate(expression, _.extend({bool: py.bool}, context))) { + if (py.evaluate(expression, context).toJSON()) { return 'color: ' + color + ';'; } // TODO: handle evaluation errors diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js index dea53793ffb..1c6694ed930 100644 --- a/addons/web/static/src/js/view_tree.js +++ b/addons/web/static/src/js/view_tree.js @@ -146,7 +146,7 @@ openerp.web.TreeView = openerp.web.View.extend(/** @lends openerp.web.TreeView# var pair = this.colors[i], color = pair[0], expression = pair[1]; - if (py.evaluate(expression, _.extend({bool: py.bool}, context))) { + if (py.evaluate(expression, context).toJSON()) { return 'color: ' + color + ';'; } // TODO: handle evaluation errors -- cgit v1.2.3 From f23a5914cab7ea8039f2b42bc5f279152ed5e31a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 27 Feb 2012 10:34:13 +0100 Subject: [imp] cleaned initialization of mixins bzr revid: nicolas.vanhoren@openerp.com-20120227093413-8qp1vo90500h9lrw --- addons/web/static/src/js/core.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index da100c19241..e4d426ac4a0 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -261,10 +261,6 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry }); openerp.web.CallbackEnabledMixin = { - /** - * @constructs openerp.web.CallbackEnabled - * @extends openerp.web.Class - */ init: function() { // Transform on_* method into openerp.web.callbacks for (var name in this) { @@ -304,7 +300,12 @@ openerp.web.CallbackEnabledMixin = { } }; -openerp.web.CallbackEnabled = openerp.web.Class.extend(_.extend({}, openerp.web.CallbackEnabledMixin)); +openerp.web.CallbackEnabled = openerp.web.Class.extend(_.extend({}, niv.GetterSetterMixin, openerp.web.CallbackEnabledMixin, { + init: function() { + niv.GetterSetterMixin.init.call(this); + openerp.web.CallbackEnabledMixin.init.call(this); + } +})); openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Connection# */{ /** -- cgit v1.2.3 From 080c9ed7fd7e782a3d2ae41747f0a80204ce2d5e Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 27 Feb 2012 11:37:15 +0100 Subject: [imp] renammed niv to nova bzr revid: nicolas.vanhoren@openerp.com-20120227103715-ez6m5bth0spbuupk --- addons/web/static/src/js/core.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index e4d426ac4a0..bdc8059ff63 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -11,7 +11,7 @@ if (!console.debug) { openerp.web.core = function(openerp) { -openerp.web.Class = niv.Class; +openerp.web.Class = nova.Class; openerp.web.callback = function(obj, method) { var callback = function() { @@ -300,9 +300,9 @@ openerp.web.CallbackEnabledMixin = { } }; -openerp.web.CallbackEnabled = openerp.web.Class.extend(_.extend({}, niv.GetterSetterMixin, openerp.web.CallbackEnabledMixin, { +openerp.web.CallbackEnabled = openerp.web.Class.extend(_.extend({}, nova.GetterSetterMixin, openerp.web.CallbackEnabledMixin, { init: function() { - niv.GetterSetterMixin.init.call(this); + nova.GetterSetterMixin.init.call(this); openerp.web.CallbackEnabledMixin.init.call(this); } })); @@ -874,7 +874,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. * * That will kill the widget in a clean way and erase its content from the dom. */ -openerp.web.Widget = niv.Widget.extend(_.extend({}, openerp.web.CallbackEnabledMixin, { +openerp.web.Widget = nova.Widget.extend(_.extend({}, openerp.web.CallbackEnabledMixin, { /** * The name of the QWeb template that will be used for rendering. Must be * redefined in subclasses or the default render() method can not be used. @@ -897,8 +897,8 @@ openerp.web.Widget = niv.Widget.extend(_.extend({}, openerp.web.CallbackEnabledM * for new components this argument should not be provided any more. */ init: function(parent) { - openerp.web.CallbackEnabledMixin.init.call(this); this._super(parent); + openerp.web.CallbackEnabledMixin.init.call(this); this.session = openerp.connection; }, /** -- cgit v1.2.3 From aca64bb558ebe2b617620eb62678107dccce971a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 27 Feb 2012 13:49:58 +0100 Subject: [imp] removed useless function bzr revid: nicolas.vanhoren@openerp.com-20120227124958-ehlps91290hrwo9o --- addons/web/static/src/js/core.js | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index bdc8059ff63..6ff8f86dcc3 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -72,31 +72,6 @@ openerp.web.callback = function(obj, method) { }); }; -/** - * Generates an inherited class that replaces all the methods by null methods (methods - * that does nothing and always return undefined). - * - * @param {Class} claz - * @param {Object} add Additional functions to override. - * @return {Class} - */ -openerp.web.generate_null_object_class = function(claz, add) { - var newer = {}; - var copy_proto = function(prototype) { - for (var name in prototype) { - if(typeof prototype[name] == "function") { - newer[name] = function() {}; - } - } - if (prototype.prototype) - copy_proto(prototype.prototype); - }; - copy_proto(claz.prototype); - newer.init = openerp.web.Widget.prototype.init; - var tmpclass = claz.extend(newer); - return tmpclass.extend(add || {}); -}; - /** * web error for lookup failure * -- cgit v1.2.3 From e91dee1e97d5b7f371ee2ab86c77d4067d6e4af9 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 27 Feb 2012 14:45:31 +0100 Subject: [ADD] Added shortcut to dropdown menu. Completely removed old Header bzr revid: fme@openerp.com-20120227134531-uf646x2w13zqsslz --- addons/web/static/src/css/base.css | 11 +- addons/web/static/src/css/base.sass | 7 +- addons/web/static/src/css/base_old.css | 107 -------- addons/web/static/src/img/header-about.png | Bin 442 -> 0 bytes addons/web/static/src/img/header-background.png | Bin 149 -> 0 bytes addons/web/static/src/img/header-help.png | Bin 454 -> 0 bytes addons/web/static/src/img/header-home.png | Bin 452 -> 0 bytes addons/web/static/src/img/header-preferences.png | Bin 420 -> 0 bytes addons/web/static/src/img/header-requests.png | Bin 353 -> 0 bytes addons/web/static/src/img/topbar-avatar.png | Bin 0 -> 846 bytes addons/web/static/src/js/chrome.js | 318 +++++++++-------------- addons/web/static/src/xml/base.xml | 52 +--- 12 files changed, 144 insertions(+), 351 deletions(-) delete mode 100644 addons/web/static/src/img/header-about.png delete mode 100644 addons/web/static/src/img/header-background.png delete mode 100644 addons/web/static/src/img/header-help.png delete mode 100644 addons/web/static/src/img/header-home.png delete mode 100644 addons/web/static/src/img/header-preferences.png delete mode 100644 addons/web/static/src/img/header-requests.png create mode 100644 addons/web/static/src/img/topbar-avatar.png (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c9774bcfa73..c038b396554 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -62,6 +62,9 @@ -webkit-border-radius: 4px; border-radius: 4px; } +.openerp2 .oe_topbar .oe_topbar_avatar { + vertical-align: top; +} .openerp2 .oe_menu { float: left; padding: 0; @@ -134,7 +137,6 @@ right: -1px; border: 0; z-index: 900; - width: 160px; margin-left: 0; margin-right: 0; padding: 6px 0; @@ -175,10 +177,3 @@ -webkit-box-shadow: none; -box-shadow: none; } - -.openerp .oe-shortcuts { - position: static; -} -.openerp #oe_header { - clear: both; -} diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index ab144a5ceec..c2a66db333e 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -97,6 +97,8 @@ height: 24px margin: -2px 2px 0 0 @include radius(4px) + .oe_topbar_avatar + vertical-align: top // }}} // Menu {{{ @@ -161,7 +163,6 @@ right: -1px border: 0 z-index: 900 - width: 160px margin-left: 0 margin-right: 0 padding: 6px 0 @@ -191,10 +192,6 @@ .openerp // Transitional overrides for old styles {{{ - .oe-shortcuts - position: static - #oe_header - clear: both // }}} // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 1fac47d128c..9b5bdb2e15b 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -27,9 +27,6 @@ margin: 2px; } -#oe_header h2 { - margin: 2px 0; -} #oe_errors pre { margin: 0; @@ -566,110 +563,6 @@ label.error { content: "\25b8"; } -/* Header */ -.openerp .header { - height: 65px; - background: url("/web/static/src/img/header-background.png") repeat-x scroll left top transparent; - color: #FFFFFF; - letter-spacing: 0.5px; - text-shadow: 0 1px 0 #333333; -} -.openerp .company_logo_link { - display: block; - float: left; - height: 63px; - width: 200px; - border: 1px solid white; - border-right-color: black; - border-bottom-color: black; - background: #FFFFFF; - background: -moz-linear-gradient(top, #FFFFFF 0%, #CECECE 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#CECECE)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#CECECE',GradientType=0 ); -} -.openerp .company_logo { - margin-top: 7px; - margin-left: 10px; - display: block; - background: url(/web/static/src/img/logo.png); - width:180px; - height:46px; -} -.openerp .header_title { - float: left; - font-size: 100%; - margin: 0; - padding: 4px 10px; - text-shadow: 0 1px 0 #111111; - font-weight:normal; - line-height:14px; -} -.openerp .header_title small { - color: #ccc; - font-size: 90%; - font-weight: normal; -} -.openerp .header_corner { - float: right; -} -.openerp .header_corner .block { - float: left; - height: 34px; - line-height: 34px; - /*background: url(../images/top-sep-a.png) no-repeat;*/ - border-left: 1px solid #6a6a6a; - background: #828282; - background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#828282), color-stop(100%,#4D4D4D)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#828282', endColorstr='#4D4D4D',GradientType=0 ); -} -.openerp .header_corner .block a { - display: block; - color: white; - text-decoration: none; - padding: 0 10px; -} -.openerp .header_corner .block a:hover { - background: #929292; - background: -moz-linear-gradient(top, #929292 0%, #4D4D4D 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#929292), color-stop(100%,#4D4D4D)); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#929292', endColorstr='#4D4D4D',GradientType=0 ); -} -.openerp .header_corner ul.block { - list-style: none; - height: 34px; - margin: 0; - padding: 0 0 0 2px; - line-height: 33px; -} -.openerp .header_corner ul.block li { - float: left; -} -.openerp .header_corner ul.block li a { - padding: 0 5px; - position: relative; - line-height: 32px; -} -.openerp .header_corner ul.block li a img { - vertical-align: middle; -} -.openerp .header_corner ul.block li a small { - position: absolute; - right: 0; - top: 5px; - padding: 1px 4px 2px; - background: rgba(0, 0, 0, 0.75); - border-radius: 7px; - -moz-border-radius: 7px; - -webkit-border-radius: 7px; - line-height: 1em; - font-weight: bold; -} - -.openerp .logout { - font-size:80%; -} - /* Footer */ .openerp div.oe_footer { background: none repeat scroll 0 0 #CCCCCC; diff --git a/addons/web/static/src/img/header-about.png b/addons/web/static/src/img/header-about.png deleted file mode 100644 index b53e9a86ebe..00000000000 Binary files a/addons/web/static/src/img/header-about.png and /dev/null differ diff --git a/addons/web/static/src/img/header-background.png b/addons/web/static/src/img/header-background.png deleted file mode 100644 index 774b3954124..00000000000 Binary files a/addons/web/static/src/img/header-background.png and /dev/null differ diff --git a/addons/web/static/src/img/header-help.png b/addons/web/static/src/img/header-help.png deleted file mode 100644 index 19e9906fdef..00000000000 Binary files a/addons/web/static/src/img/header-help.png and /dev/null differ diff --git a/addons/web/static/src/img/header-home.png b/addons/web/static/src/img/header-home.png deleted file mode 100644 index fd96742d15a..00000000000 Binary files a/addons/web/static/src/img/header-home.png and /dev/null differ diff --git a/addons/web/static/src/img/header-preferences.png b/addons/web/static/src/img/header-preferences.png deleted file mode 100644 index 6c978b49f55..00000000000 Binary files a/addons/web/static/src/img/header-preferences.png and /dev/null differ diff --git a/addons/web/static/src/img/header-requests.png b/addons/web/static/src/img/header-requests.png deleted file mode 100644 index 6577e7e6448..00000000000 Binary files a/addons/web/static/src/img/header-requests.png and /dev/null differ diff --git a/addons/web/static/src/img/topbar-avatar.png b/addons/web/static/src/img/topbar-avatar.png new file mode 100644 index 00000000000..a2c70ea7d49 Binary files /dev/null and b/addons/web/static/src/img/topbar-avatar.png differ diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 838fdb4f79f..ff474528814 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -666,186 +666,6 @@ openerp.web.Login = openerp.web.OldWidget.extend(/** @lends openerp.web.Login# } }); -openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header# */{ - template: "Header", - /** - * @constructs openerp.web.Header - * @extends openerp.web.OldWidget - * - * @param parent - */ - init: function(parent) { - this._super(parent); - this.qs = "?" + jQuery.param.querystring(); - this.$content = $(); - this.update_promise = $.Deferred().resolve(); - }, - start: function() { - this._super(); - }, - do_update: function () { - var self = this; - var fct = function() { - self.$content.remove(); - if (!self.session.uid) - return; - var func = new openerp.web.Model("res.users").get_func("read"); - return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { - self.$content = $(QWeb.render("Header-content", {widget: self, user: res})); - self.$content.appendTo(self.$element); - self.$element.find(".logout").click(self.on_logout); - self.$element.find("a.preferences").click(self.on_preferences); - self.$element.find(".about").click(self.on_about); - return self.shortcut_load(); - }); - }; - this.update_promise = this.update_promise.pipe(fct, fct); - }, - on_about: function() { - var self = this; - self.rpc("/web/webclient/version_info", {}).then(function(res) { - var $help = $(QWeb.render("About-Page", {version_info: res})); - $help.find('a.oe_activate_debug_mode').click(function (e) { - e.preventDefault(); - window.location = $.param.querystring( - window.location.href, 'debug'); - }); - openerp.web.dialog($help, {autoOpen: true, - modal: true, width: 960, title: _t("About")}); - }); - }, - shortcut_load :function(){ - var self = this, - sc = self.session.shortcuts, - shortcuts_ds = new openerp.web.DataSet(this, 'ir.ui.view_sc'); - // TODO: better way to communicate between sections. - // sc.bindings, because jquery does not bind/trigger on arrays... - if (!sc.binding) { - sc.binding = {}; - $(sc.binding).bind({ - 'add': function (e, attrs) { - shortcuts_ds.create(attrs, function (out) { - $('
  • ', { - 'data-shortcut-id':out.result, - 'data-id': attrs.res_id - }).text(attrs.name) - .appendTo(self.$element.find('.oe-shortcuts ul')); - attrs.id = out.result; - sc.push(attrs); - }); - }, - 'remove-current': function () { - var menu_id = self.session.active_id; - var $shortcut = self.$element - .find('.oe-shortcuts li[data-id=' + menu_id + ']'); - var shortcut_id = $shortcut.data('shortcut-id'); - $shortcut.remove(); - shortcuts_ds.unlink([shortcut_id]); - var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id}); - sc.splice(0, sc.length); - sc.push.apply(sc, sc_new); - } - }); - } - return this.rpc('/web/session/sc_list', {}, function(shortcuts) { - sc.splice(0, sc.length); - sc.push.apply(sc, shortcuts); - - self.$element.find('.oe-shortcuts') - .html(QWeb.render('Shortcuts', {'shortcuts': shortcuts})) - .undelegate('li', 'click') - - .delegate('li', 'click', function(e) { - e.stopPropagation(); - var id = $(this).data('id'); - self.session.active_id = id; - self.rpc('/web/menu/action', {'menu_id':id}, function(ir_menu_data) { - if (ir_menu_data.action.length){ - self.on_action(ir_menu_data.action[0][2]); - } - }); - }); - }); - }, - - on_action: function(action) { - }, - on_preferences: function(){ - var self = this; - var action_manager = new openerp.web.ActionManager(this); - var dataset = new openerp.web.DataSet (this,'res.users',this.context); - dataset.call ('action_get','',function (result){ - self.rpc('/web/action/load', {action_id:result}, function(result){ - action_manager.do_action(_.extend(result['result'], { - res_id: self.session.uid, - res_model: 'res.users', - flags: { - action_buttons: false, - search_view: false, - sidebar: false, - views_switcher: false, - pager: false - } - })); - }); - }); - this.dialog = new openerp.web.Dialog(this,{ - title: _t("Preferences"), - width: '700px', - buttons: [ - {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, - {text: _t("Change password"), click: function(){ self.change_password(); }}, - {text: _t("Save"), click: function(){ - var inner_viewmanager = action_manager.inner_viewmanager; - inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save() - .then(function() { - self.dialog.destroy(); - // needs to refresh interface in case language changed - window.location.reload(); - }); - } - } - ] - }).open(); - action_manager.appendTo(this.dialog); - action_manager.render(this.dialog); - }, - - change_password :function() { - var self = this; - this.dialog = new openerp.web.Dialog(this, { - title: _t("Change Password"), - width : 'auto' - }).open(); - this.dialog.$element.html(QWeb.render("Change_Pwd", self)); - this.dialog.$element.find("form[name=change_password_form]").validate({ - submitHandler: function (form) { - self.rpc("/web/session/change_password",{ - 'fields': $(form).serializeArray() - }, function(result) { - if (result.error) { - self.display_error(result); - return; - } else { - openerp.webclient.on_logout(); - } - }); - } - }); - }, - display_error: function (error) { - return openerp.web.dialog($('
    '), { - modal: true, - title: error.title, - buttons: [ - {text: _("Ok"), click: function() { $(this).dialog("close"); }} - ] - }).html(error.error); - }, - on_logout: function() { - } -}); - openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ /** * @constructs openerp.web.Menu @@ -1008,16 +828,17 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } }); -openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Header# */{ +openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.DropDownMenu# */{ template: "DropDownMenu", /** * @constructs openerp.web.DropDownMenu - * @extends openerp.web.OldWidget + * @extends openerp.web.Widget * * @param parent */ init: function(parent) { this._super(parent); + this.update_promise = $.Deferred().resolve(); }, start: function() { var self = this; @@ -1029,13 +850,108 @@ openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Hea self.$element.find('.oe_dropdown_options').toggle(); return false; }); - this.$element.find('.oe_dropdown_options li a').click(function() { + this.$element.on('click', '.oe_dropdown_options li a[data-menu]', function() { var f = self['on_menu_' + $(this).data('menu')]; - f && f(); + f && f($(this)); self.$element.find('.oe_dropdown_options').hide(); return false; }); }, + change_password :function() { + var self = this; + this.dialog = new openerp.web.Dialog(this, { + title: _t("Change Password"), + width : 'auto' + }).open(); + this.dialog.$element.html(QWeb.render("Change_Pwd", self)); + this.dialog.$element.find("form[name=change_password_form]").validate({ + submitHandler: function (form) { + self.rpc("/web/session/change_password",{ + 'fields': $(form).serializeArray() + }, function(result) { + if (result.error) { + self.display_error(result); + return; + } else { + openerp.webclient.on_logout(); + } + }); + } + }); + }, + display_error: function (error) { + return openerp.web.dialog($('
    '), { + modal: true, + title: error.title, + buttons: [ + {text: _("Ok"), click: function() { $(this).dialog("close"); }} + ] + }).html(error.error); + }, + do_update: function () { + var self = this; + var fct = function() { + var $avatar = self.$element.find('.oe_topbar_avatar'); + $avatar.attr('src', $avatar.data('default-src')); + if (!self.session.uid) + return; + var func = new openerp.web.Model("res.users").get_func("read"); + return func(self.session.uid, ["name", "company_id"]).pipe(function(res) { + // TODO: Only show company if multicompany in use + self.$element.find('.oe_topbar_name').text(res.name + '/' + res.company_id[1]); + return self.shortcut_load(); + }); + }; + this.update_promise = this.update_promise.pipe(fct, fct); + }, + on_action: function() { + }, + shortcut_load :function(){ + var self = this, + sc = self.session.shortcuts, + shortcuts_ds = new openerp.web.DataSet(this, 'ir.ui.view_sc'); + self.$element.find('.oe_dropdown_options a[data-menu=shortcut]').each(function() { + $(this).parent().remove(); + }); + // TODO: better way to communicate between sections. + // sc.bindings, because jquery does not bind/trigger on arrays... + if (!sc.binding) { + sc.binding = {}; + $(sc.binding).bind({ + 'add': function (e, attrs) { + shortcuts_ds.create(attrs, function (out) { + var shortcut = QWeb.render('DropDownMenu.shortcut', { + shortcuts : [{ + name : attrs.name, + id : out.result, + res_id : attrs.res_id + }] + }); + $(shortcut).appendTo(self.$element.find('.oe_dropdown_options')); + attrs.id = out.result; + sc.push(attrs); + }); + }, + 'remove-current': function () { + var menu_id = self.session.active_id; + var $shortcut = self.$element.find('.oe_dropdown_options li a[data-id=' + menu_id + ']'); + var shortcut_id = $shortcut.data('shortcut-id'); + $shortcut.remove(); + shortcuts_ds.unlink([shortcut_id]); + var sc_new = _.reject(sc, function(shortcut){ return shortcut_id === shortcut.id}); + sc.splice(0, sc.length); + sc.push.apply(sc, sc_new); + } + }); + } + return this.rpc('/web/session/sc_list', {}, function(shortcuts) { + sc.splice(0, sc.length); + sc.push.apply(sc, shortcuts); + + $(QWeb.render('DropDownMenu.shortcut', {'shortcuts': shortcuts})) + .appendTo(self.$element.find('.oe_dropdown_options')); + }); + }, on_menu_logout: function() { }, on_menu_settings: function() { @@ -1077,6 +993,29 @@ openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Hea }).open(); action_manager.appendTo(this.dialog); action_manager.render(this.dialog); + }, + on_menu_about: function() { + var self = this; + self.rpc("/web/webclient/version_info", {}).then(function(res) { + var $help = $(QWeb.render("About-Page", {version_info: res})); + $help.find('a.oe_activate_debug_mode').click(function (e) { + e.preventDefault(); + window.location = $.param.querystring( + window.location.href, 'debug'); + }); + openerp.web.dialog($help, {autoOpen: true, + modal: true, width: 960, title: _t("About")}); + }); + }, + on_menu_shortcut: function($link) { + var self = this, + id = $link.data('id'); + self.session.active_id = id; + self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) { + if (ir_menu_data.action.length){ + self.on_action(ir_menu_data.action[0][2]); + } + }); } }); @@ -1089,7 +1028,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie var self = this; this._super(parent); openerp.webclient = this; - + this.querystring = '?' + jQuery.param.querystring(); this._current_state = null; }, start: function() { @@ -1108,8 +1047,8 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }); this.session.on_session_valid.add(function() { self.show_application(); - - self.header.do_update(); + + self.dropdown_menu.do_update(); self.menu.do_reload(); if(self.action_manager) self.action_manager.destroy(); @@ -1136,16 +1075,13 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this.show_common(); self.$table = $(QWeb.render("WebClient", {})); self.$element.append(self.$table); - self.header = new openerp.web.Header(self); - self.header.on_logout.add(this.proxy('on_logout')); - self.header.on_action.add(this.proxy('on_menu_action')); - self.header.appendTo($("#oe_header")); self.menu = new openerp.web.Menu(self); self.menu.replace(this.$element.find('.oe_menu_placeholder')); self.menu.on_action.add(this.proxy('on_menu_action')); self.dropdown_menu = new openerp.web.DropDownMenu(self); self.dropdown_menu.replace(this.$element.find('.oe_dropdown_menu_placeholder')); self.dropdown_menu.on_menu_logout.add(this.proxy('on_logout')); + self.dropdown_menu.on_action.add(this.proxy('on_menu_action')); }, show_common: function() { var self = this; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 9b361f13e8f..29618c90bdc 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -23,7 +23,6 @@
    -
  • Settings
  • Log out
  • +

  • +
  • About OpenERP
  • +

  • + +
  • + + + +
  • +
    -- cgit v1.2.3 From ad681179d0e2b8ee95c085b2131cd9a7e426eb40 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 27 Feb 2012 14:59:11 +0100 Subject: [CHG] Menu doesn't fold by default bzr revid: fme@openerp.com-20120227135911-9l0csum251wvkfv8 --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index ff474528814..56acb939b7d 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -791,7 +791,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ if ($clicked_menu.is('.submenu')) { $sub_menu.find('.submenu.opened').each(function() { if (!$(this).next().has($clicked_menu).length && !$(this).is($clicked_menu)) { - $(this).removeClass('opened').next().hide(); + $(this).removeClass('opened'); } }); $clicked_menu.toggleClass('opened').next().toggle(); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 29618c90bdc..c9c3bb65857 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -364,7 +364,7 @@ t-att-data-menu="menu.children.length ? undefined : menu.id"> -
    +
    oe_secondary_submenu_item -- cgit v1.2.3 From 481baac8a3d592440c4263cb7a12435e1914125c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 27 Feb 2012 15:01:36 +0100 Subject: [CHG] Do not toggle opened class on submenu (should be part of last commit) bzr revid: fme@openerp.com-20120227140136-k4g3kiots78ef4iv --- addons/web/static/src/js/chrome.js | 5 ----- 1 file changed, 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 56acb939b7d..9b8ef61fc3a 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -789,11 +789,6 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ if ($main_menu != $clicked_menu) { if ($clicked_menu.is('.submenu')) { - $sub_menu.find('.submenu.opened').each(function() { - if (!$(this).next().has($clicked_menu).length && !$(this).is($clicked_menu)) { - $(this).removeClass('opened'); - } - }); $clicked_menu.toggleClass('opened').next().toggle(); } else if ($clicked_menu.is('.leaf')) { return true; -- cgit v1.2.3 From 2b2ae48ea9538731a70d16e7b8618ed894d78464 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 27 Feb 2012 16:27:39 +0100 Subject: [FIX] progressbar fields display in group headers also, weird computed progress bars (e.g. aggregates) with way too many digits lp bug: https://launchpad.net/bugs/941316 fixed bzr revid: xmo@openerp.com-20120227152739-3pmu3dtqrbzx1x3m --- addons/web/static/src/js/formats.js | 2 +- addons/web/static/src/js/view_list.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') 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( '<%-value%>%', { - value: row_data[column.id].value + value: _.str.sprintf("%.0f", row_data[column.id].value) }); } diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index ec8e6a17c87..d2e421b2fde 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1257,9 +1257,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]}; $('
    ') - .html(openerp.web.format_value(value, column)) + .html(openerp.web.format_cell( + r, column, {process_modifiers: false})) .appendTo($row); } else { $row.append(''); -- cgit v1.2.3 From 6bda7286e3a41af83a3a1f9e6857e6765c903f37 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 27 Feb 2012 18:14:40 +0100 Subject: [FIX] Fix binary upload button styling bzr revid: fme@openerp.com-20120227171440-1o7w1jrv5rl2b4ov --- addons/web/static/src/css/base.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2a27e61eb3d..e8916db5a3b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1542,11 +1542,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)"; -- cgit v1.2.3 From 4b74a35c76b3a042d893976bc6cf2e63b653af05 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 28 Feb 2012 11:12:00 +0100 Subject: [FIX] list paginator's 'last page' button: not all state was transferred between datasets during paginator configuration lp bug: https://launchpad.net/bugs/939614 fixed bzr revid: xmo@openerp.com-20120228101200-atisgrb2fb0eqi1g --- addons/web/static/src/js/view_list.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index d2e421b2fde..c44b62d08f2 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(), -- cgit v1.2.3 From 2d03b80c7dcb5d65973a0ea383df72416dbb66ac Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 28 Feb 2012 14:41:21 +0100 Subject: [IMP] New menus bzr revid: fme@openerp.com-20120228134121-bxs33qrpevrfkctp --- addons/web/static/src/css/base.css | 106 +++++++++++++++++++ addons/web/static/src/css/base.sass | 92 +++++++++++++++++ addons/web/static/src/css/base_old.css | 183 --------------------------------- addons/web/static/src/js/chrome.js | 117 +++++++-------------- addons/web/static/src/xml/base.xml | 55 +++++----- 5 files changed, 259 insertions(+), 294 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c038b396554..59ae0011dce 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -17,6 +17,13 @@ left: 0; right: 0; } +.openerp2 .oe_webclient .oe_application { + position: absolute; + top: 32px; + bottom: 0; + left: 206px; + right: 0; +} .openerp2 .oe_topbar { width: 100%; height: 31px; @@ -65,6 +72,20 @@ .openerp2 .oe_topbar .oe_topbar_avatar { vertical-align: top; } +.openerp2 .oe_leftbar { + width: 205px; + height: 100%; + background: #f0eeee; + border-right: 1px solid #afafb6; + overflow: auto; + text-shadow: 0 1px 1px white; +} +.openerp2 .oe_leftbar .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; +} .openerp2 .oe_menu { float: left; padding: 0; @@ -98,6 +119,91 @@ -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } +.openerp2 .oe_secondary_menu_section { + font-weight: bold; + margin-left: 8px; + color: #8a89ba; +} +.openerp2 .oe_secondary_submenu { + padding: 2px 0 8px 0; + margin: 0; + width: 100%; + display: inline-block; +} +.openerp2 .oe_secondary_submenu li { + position: relative; + padding: 1px 0 1px 16px; + list-style-type: none; +} +.openerp2 .oe_secondary_submenu li a { + display: block; + color: #4c4c4c; + padding: 2px 4px 2px 0; +} +.openerp2 .oe_secondary_submenu li .oe_menu_label { + position: absolute; + top: 1px; + right: 1px; + font-size: 10px; + background: #8a89ba; + color: white; + padding: 2px 4px; + margin: 1px 6px 0 0; + border: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); +} +.openerp2 .oe_secondary_submenu .oe_active { + background: #8a89ba; + border-top: 1px solid lightGray; + border-bottom: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); +} +.openerp2 .oe_secondary_submenu .oe_active a { + color: white; +} +.openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { + background: #eeeeee; + color: #8a89ba; + text-shadow: 0 1px 1px white; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); +} +.openerp2 .oe_secondary_submenu .oe_menu_toggler:before { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-left: -8px; + margin-top: 4px; + margin-right: 4px; + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + border-left: 4px solid #4c4c4c; + filter: alpha(opacity=50); + -khtml-opacity: 0.5; + -moz-opacity: 0.5; + opacity: 0.5; +} +.openerp2 .oe_secondary_submenu .oe_menu_opened:before { + margin-top: 6px; + margin-left: -12px; + margin-right: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #4c4c4c; +} .openerp2 .oe_dropdown_menu { float: right; padding: 0; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c2a66db333e..c1df1b61226 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1,3 +1,8 @@ +// Variables {{{ +$colour4: #8a89ba +//$colour4: #d14836 +// }}} + // Mixins {{{ @mixin vertical-gradient($startColor: #555, $endColor: #333) background: $startColor @@ -61,6 +66,13 @@ bottom: 0 left: 0 right: 0 + + .oe_application + position: absolute + top: 32px + bottom: 0 + left: 206px + right: 0 // }}} // Topbar {{{ @@ -101,6 +113,22 @@ vertical-align: top // }}} + // Leftbar {{{ + .oe_leftbar + width: 205px + height: 100% + background: #f0eeee + border-right: 1px solid #afafb6 + overflow: auto + text-shadow: 0 1px 1px white + + .oe_footer + position: absolute + width: 205px + text-align: center + bottom: 8px + // }}} + // Menu {{{ .oe_menu float: left @@ -126,6 +154,70 @@ font-weight: bold color: white @include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset) + .oe_secondary_menu_section + font-weight: bold + margin-left: 8px + color: $colour4 + .oe_secondary_submenu + padding: 2px 0 8px 0 + margin: 0 + width: 100% + display: inline-block + li + position: relative + padding: 1px 0 1px 16px + list-style-type: none + a + display: block + color: #4c4c4c + padding: 2px 4px 2px 0 + .oe_menu_label + position: absolute + top: 1px + right: 1px + font-size: 10px + background: $colour4 + color: white + padding: 2px 4px + margin: 1px 6px 0 0 + border: 1px solid lightGray + text-shadow: 0 1px 1px rgba(0,0,0,0.2) + @include radius(4px) + @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2)) + .oe_active + background: $colour4 + border-top: 1px solid lightGray + border-bottom: 1px solid lightGray + text-shadow: 0 1px 1px rgba(0,0,0,0.2) + @include box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.2)) + a + color: white + .oe_menu_label + background: #eee + color: $colour4 + text-shadow: 0 1px 1px white + @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2)) + .oe_menu_toggler:before + width: 0 + height: 0 + display: inline-block + content: "&darr" + text-indent: -99999px + vertical-align: top + margin-left: -8px + margin-top: 4px + margin-right: 4px + border-top: 4px solid transparent + border-bottom: 4px solid transparent + border-left: 4px solid #4c4c4c + @include opacity(0.5) + .oe_menu_opened:before + margin-top: 6px + margin-left: -12px + margin-right: 4px + border-left: 4px solid transparent + border-right: 4px solid transparent + border-top: 4px solid #4c4c4c // }}} // DropDown Menu {{{ diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 9b5bdb2e15b..082a18a922e 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -385,184 +385,6 @@ label.error { min-height: 100%\9; } -/* Menu */ -.openerp .menu { - height: 34px; - background: #cc4e45; /* Old browsers */ - background: -moz-linear-gradient(top, #cc4e45 0%, #b52d20 8%, #7a211a 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cc4e45), color-stop(8%,#b52d20), color-stop(100%,#7a211a)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CC4E45', endColorstr='#7A211A',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #cc4e45 0%,#b52d20 8%,#7a211a 100%); /* W3C */ -} -.openerp .menu td { - text-align: center; - padding:0; -} -.openerp .menu a { - display:block; - min-width: 60px; - height: 20px; - margin: 3px 2px; - padding: 0 8px; - - background: #bd5e54; /* Old browsers */ - background: -moz-linear-gradient(top, #bd5e54 0%, #90322a 60%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#bd5e54), color-stop(60%,#90322a)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #bd5e54 0%,#90322a 60%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BD5E54', endColorstr='#90322A',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #bd5e54 0%,#90322a 60%); /* W3C */ - - border: 1px solid #5E1A14; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - - color: #eee; - text-shadow: #222 0 1px 0; - text-decoration: none; - text-transform: uppercase; - line-height: 20px; - font-weight: bold; - font-size: 75%; - - white-space: nowrap; -} -.openerp .menu a:hover, -.openerp .menu a:focus, -.openerp .menu a.active { - background: #c6c6c6; /* Old browsers */ - background: -moz-linear-gradient(top, #c6c6c6 0%, #5c5c5c 7%, #969595 86%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#c6c6c6), color-stop(7%,#5c5c5c), color-stop(86%,#969595)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C6C6C6', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #c6c6c6 0%,#5c5c5c 7%,#969595 86%); /* W3C */ - /* for ie */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5c5c5c', endColorstr='#969595',GradientType=0 ); /* IE6-9 */ - color: #fff; -} -/* Secondary Menu */ -.openerp .secondary_menu .oe_toggle_secondary_menu { - position: absolute; - cursor: pointer; - border-left: 1px solid #282828; - border-bottom: 1px solid #282828; - width: 21px; - height: 21px; - z-index: 10; - background: transparent; - color: white; - text-shadow: 0 1px 0 #333; - text-align: center; - font-size: 18px; - line-height: 18px; - right: 0; -} -.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu { - position: static; - border-left: none; - border-bottom: 1px solid #282828; - width: 21px; - height: 21px; - background: #818181; -} -.openerp .secondary_menu.oe_folded .oe_toggle_secondary_menu span.oe_menu_fold { - display: none; -} -.openerp .secondary_menu.oe_unfolded .oe_toggle_secondary_menu span.oe_menu_unfold { - display: none; -} -.openerp .secondary_menu { - width: 200px; - min-width: 200px; - border-right: 1px solid #3C3C3C; - border-bottom: 1px solid #5A5858; - background: #5A5858; - vertical-align: top; - height: 100%; - display: block; - position: relative; - font-size:85%; -} -.openerp .secondary_menu.oe_folded { - width: 20px; - min-width: 20px; - position: static; -} -.openerp .secondary_menu.oe_folded .oe_secondary_menu.active { - position: absolute; - z-index: 100; - border: 4px solid #585858; - border-color: rgba(88, 88, 88, .5); - border-radius: 4px; - min-width: 200px; -} -.openerp .secondary_menu a { - display: block; - padding: 0 5px 2px 5px; - line-height: 20px; - text-decoration: none; - white-space: nowrap; - color: white; - text-shadow: 0 1px 0 #333; -} -.openerp .oe_secondary_submenu { - background: #5A5858; -} -.openerp .secondary_menu a.oe_secondary_menu_item { - background: #949292; /* Old browsers */ - background: -moz-linear-gradient(top, #949292 0%, #6d6b6b 87%, #282828 99%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#949292), color-stop(87%,#6d6b6b), color-stop(99%,#282828)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#282828',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #949292 0%,#6d6b6b 87%,#282828 99%); /* W3C */ - /* for ie9 */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#949292', endColorstr='#5B5A5A',GradientType=0 ); /* IE6-9 */ - white-space: nowrap; - color: white; - text-shadow: 0 1px 0 #333; - -} -.openerp a.oe_secondary_submenu_item { - padding: 0 5px 2px 10px; -} -.openerp a.oe_secondary_submenu_item, -.openerp a.oe_secondary_menu_item { - overflow: hidden; - text-overflow: ellipsis; -} -.openerp a.oe_secondary_submenu_item:hover, -.openerp a.oe_secondary_submenu_item.leaf.active { - display: block; - background: #ffffff; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #d8d8d8 11%, #afafaf 86%, #333333 91%, #5a5858 96%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(11%,#d8d8d8), color-stop(86%,#afafaf), color-stop(91%,#333333), color-stop(96%,#5a5858)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* Opera11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* IE10+ */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#5A5858',GradientType=0 ); /* IE6-9 */ - background: linear-gradient(top, #ffffff 0%,#d8d8d8 11%,#afafaf 86%,#333333 91%,#5a5858 96%); /* W3C */ - padding: 0 5px 2px 10px; - line-height: 20px; - color: #3f3d3d; - text-decoration: none; - text-shadow: #fff 0 1px 0; -} -.openerp a.oe_secondary_submenu_item.submenu.opened span:before { - content: "\25be"; -} -.openerp a.oe_secondary_submenu_item.submenu span:before { - content: "\25b8"; -} - /* Footer */ .openerp div.oe_footer { background: none repeat scroll 0 0 #CCCCCC; @@ -1744,10 +1566,6 @@ label.error { background: url(http://placekitten.com/g/211/65) repeat; } -.openerp.kitten-mode-activated .secondary_menu { - background: url(http://placekitten.com/g/212/100) repeat; -} - .openerp.kitten-mode-activated .menu { background: #828282; background: -moz-linear-gradient(top, #828282 0%, #4D4D4D 100%); @@ -1769,7 +1587,6 @@ label.error { .openerp.kitten-mode-activated .menu, .openerp.kitten-mode-activated .header_corner, .openerp.kitten-mode-activated .header_title, -.openerp.kitten-mode-activated .secondary_menu div, .openerp.kitten-mode-activated .oe-application, .openerp.kitten-mode-activated .oe_footer, .openerp.kitten-mode-activated .loading, diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 9b8ef61fc3a..29751eba313 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -685,12 +685,14 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ on_loaded: function(data) { this.data = data; this.render_element(); - if (!this.$secondary_menu && this.getParent()) { + if (!this.$secondary_menus && this.getParent()) { // TODO: create Widget openerp.web.SubMenu - this.$secondary_menu = this.getParent().$element.find('.oe_secondary_menu'); + this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); + this.$element.add(this.$secondary_menus).on('click', 'a[data-menu]', this.on_menu_click); } - this.$secondary_menu.html(QWeb.render("Menu.secondary", { widget : this })); - this.$element.add(this.$secondary_menu).find("a").click(this.on_menu_click); + this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); + // Hide second level submenus + this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); }, /** * Opens a given menu by id, as if a user had browsed to that menu by hand @@ -698,39 +700,36 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ * * @param {Number} menu_id database id of the terminal menu to select */ - open_menu: function (menu_id) { - this.$element.add(this.$secondary_menu).find('.oe_active') - .removeClass('oe_active'); - this.$secondary_menu.find('> .oe_secondary_menu').hide(); + open_menu: function (id) { + var $clicked_menu, $sub_menu, $main_menu; + $clicked_menu = this.$element.add(this.$secondary_menus).find('a[data-menu=' + id + ']'); - var $primary_menu; - var $secondary_submenu = this.$secondary_menu.find( - 'a[data-menu=' + menu_id +']'); - if ($secondary_submenu.length) { - for(;;) { - if ($secondary_submenu.hasClass('leaf')) { - $secondary_submenu.addClass('oe_active'); - } else if ($secondary_submenu.hasClass('submenu')) { - $secondary_submenu.addClass('opened') - } - var $parent = $secondary_submenu.parent().show(); - if ($parent.hasClass('oe_secondary_menu')) { - var primary_id = $parent.data('menu-parent'); - $primary_menu = this.$element.find( - 'a[data-menu=' + primary_id + ']'); - break; - } - $secondary_submenu = $parent.prev(); - } + if (this.$secondary_menus.has($clicked_menu).length) { + $sub_menu = $clicked_menu.parents('.oe_secondary_menu'); + $main_menu = this.$element.find('a[data-menu=' + $sub_menu.data('menu-parent') + ']'); } else { - $primary_menu = this.$element.find('a[data-menu=' + menu_id + ']'); + $sub_menu = this.$secondary_menus.find('.oe_secondary_menu[data-menu-parent=' + $clicked_menu.attr('data-menu') + ']'); + $main_menu = $clicked_menu; } - if (!$primary_menu.length) { - return; + + // Activate current main menu + this.$element.find('.oe_active').removeClass('oe_active'); + $main_menu.addClass('oe_active'); + + // Show current sub menu + this.$secondary_menus.find('.oe_secondary_menu').hide(); + $sub_menu.show(); + + // Activate current menu item and show parents + this.$secondary_menus.find('.oe_active').removeClass('oe_active'); + if ($main_menu !== $clicked_menu) { + $clicked_menu.parents().show(); + if ($clicked_menu.is('.oe_menu_toggler')) { + $clicked_menu.toggleClass('oe_menu_opened').siblings('.oe_secondary_submenu:first').toggle(); + } else { + $clicked_menu.parent().addClass('oe_active'); + } } - $primary_menu.addClass('oe_active'); - this.$secondary_menu.find( - 'div[data-menu-parent=' + $primary_menu.data('menu') + ']').addClass('oe_active'); }, on_menu_click: function(ev, id) { id = id || 0; @@ -741,14 +740,15 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ manual = true; $clicked_menu = this.$element.find('a[data-menu=' + id + ']'); if (!$clicked_menu.length) { - $clicked_menu = this.$secondary_menu.find('a[data-menu=' + id + ']'); + $clicked_menu = this.$secondary_menus.find('a[data-menu=' + id + ']'); } } else { $clicked_menu = $(ev.currentTarget); id = $clicked_menu.data('menu'); } - if (this.do_menu_click($clicked_menu, manual) && id) { + if (id) { + this.open_menu(id); this.current_menu = id; this.session.active_id = id; this.rpc('/web/menu/action', {'menu_id': id}, this.on_menu_action_loaded); @@ -758,52 +758,9 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } return false; }, - do_menu_click: function($clicked_menu, manual) { - var $sub_menu, $main_menu, - active = $clicked_menu.is('.oe_active'), - sub_menu_visible = false, - has_submenu_items = false; - - if (this.$secondary_menu.has($clicked_menu).length) { - $sub_menu = $clicked_menu.parents('.oe_secondary_menu'); - $main_menu = this.$element.find('a[data-menu=' + $sub_menu.data('menu-parent') + ']'); - } else { - $sub_menu = this.$secondary_menu.find('.oe_secondary_menu[data-menu-parent=' + $clicked_menu.attr('data-menu') + ']'); - $main_menu = $clicked_menu; - } - - sub_menu_visible = $sub_menu.is(':visible'); - has_submenu_items = !!$sub_menu.children().length; - this.$secondary_menu.find('.oe_secondary_menu').hide(); - - $('.oe_active', this.$element.add(this.$secondary_menu)).removeClass('oe_active'); - $main_menu.add($clicked_menu).add($sub_menu).addClass('oe_active'); - - if (has_submenu_items) { - if (!manual) { - this.do_show_secondary($sub_menu, $main_menu); - } else { - this.do_show_secondary(); - } - } - - if ($main_menu != $clicked_menu) { - if ($clicked_menu.is('.submenu')) { - $clicked_menu.toggleClass('opened').next().toggle(); - } else if ($clicked_menu.is('.leaf')) { - return true; - } - } else { - return true; - } - return false; - }, - do_hide_secondary: function() { - //this.$secondary_menu.hide(); - }, do_show_secondary: function($sub_menu, $main_menu) { var self = this; - this.$secondary_menu.show(); + this.$secondary_menus.show(); if (!arguments.length) { return; } @@ -1048,7 +1005,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie if(self.action_manager) self.action_manager.destroy(); self.action_manager = new openerp.web.ActionManager(self); - self.action_manager.appendTo($("#oe_app")); + self.action_manager.appendTo(self.$element.find('.oe_application')); self.bind_hashchange(); var version_label = _t("OpenERP - Unsupported/Community Version"); if (!self.session.openerp_entreprise) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index c9c3bb65857..66c6b316393 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -24,30 +24,16 @@
    +
    -
    - - - - - - -
    -
    -
    -
    -
    -
    -
    +
    @@ -351,25 +337,32 @@ - - - - + +
      +
    • + + + +
    • +
    +
    + +
    + -
    - - oe_secondary_submenu_item - - -
    -- cgit v1.2.3 From 32cd30b7f5f87ae1e8684070ef89f1c1a0ded9e5 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 28 Feb 2012 15:26:41 +0100 Subject: [ADD] Added new logo and footer bzr revid: fme@openerp.com-20120228142641-p4qsssmutq30r0z3 --- addons/web/static/src/css/base.css | 29 ++++++++++++++++++++++++++++- addons/web/static/src/css/base.sass | 24 +++++++++++++++++++++++- addons/web/static/src/xml/base.xml | 7 +++---- 3 files changed, 54 insertions(+), 6 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 59ae0011dce..c36e8c61a2b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -86,6 +86,33 @@ text-align: center; bottom: 8px; } +.openerp2 a.oe_logo { + display: block; + text-align: center; + height: 70px; + line-height: 70px; +} +.openerp2 a.oe_logo img { + height: 40px; + width: 157px; + margin: 14px 0; +} +.openerp2 .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; +} +.openerp2 .oe_footer a { + font-weight: 800; + font-family: serif; + font-size: 16px; + color: black; +} +.openerp2 .oe_footer a span { + color: #c81010; + font-style: italic; +} .openerp2 .oe_menu { float: left; padding: 0; @@ -216,7 +243,7 @@ .openerp2 .oe_dropdown_menu .oe_dropdown { position: relative; } -.openerp2 .oe_dropdown_menu .dropdown-toggle:after { +.openerp2 .oe_dropdown_menu .oe_dropdown_toggle:after { width: 0; height: 0; display: inline-block; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c1df1b61226..f62841896bd 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -127,6 +127,28 @@ $colour4: #8a89ba width: 205px text-align: center bottom: 8px + a.oe_logo + display: block + text-align: center + height: 70px + line-height: 70px + img + height: 40px + width: 157px + margin: 14px 0 + .oe_footer + position: absolute + width: 205px + text-align: center + bottom: 8px + a + font-weight: 800 + font-family: serif + font-size: 16px + color: black + span + color: #c81010 + font-style: italic // }}} // Menu {{{ @@ -231,7 +253,7 @@ $colour4: #8a89ba .oe_dropdown position: relative - .dropdown-toggle:after + .oe_dropdown_toggle:after width: 0 height: 0 display: inline-block diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 66c6b316393..d2d30c5d580 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -24,14 +24,13 @@
    + +
    -
    -- cgit v1.2.3 From 74efca03cc290173484dea4c8d78d74e2d7a3c7a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 28 Feb 2012 15:40:24 +0100 Subject: [fix] minor problem in m2o lp bug: https://launchpad.net/bugs/923898 fixed bzr revid: nicolas.vanhoren@openerp.com-20120228144024-ihavt9si03lorzsu --- addons/web/static/src/js/view_form.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 17b9849cd42..bee5016f0be 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1938,9 +1938,13 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ $cmenu.append(QWeb.render("FieldMany2One.context_menu", {widget: self})); var bindings = {}; bindings[self.cm_id + "_search"] = function() { + if (self.readonly) + return; self._search_create_popup("search"); }; bindings[self.cm_id + "_create"] = function() { + if (self.readonly) + return; self._search_create_popup("form"); }; bindings[self.cm_id + "_open"] = function() { -- cgit v1.2.3 From 9cad7deeedd6931857e081f2bac85e5e898a3f85 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 28 Feb 2012 15:41:11 +0100 Subject: [fix] minor problem in m2o lp bug: https://launchpad.net/bugs/923898 fixed bzr revid: nicolas.vanhoren@openerp.com-20120228144111-co9nl24o466zuzsb --- addons/web/static/src/js/view_form.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6b7acd5a244..5bbdefff520 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1911,9 +1911,13 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ $cmenu.append(QWeb.render("FieldMany2One.context_menu", {widget: self})); var bindings = {}; bindings[self.cm_id + "_search"] = function() { + if (self.readonly) + return; self._search_create_popup("search"); }; bindings[self.cm_id + "_create"] = function() { + if (self.readonly) + return; self._search_create_popup("form"); }; bindings[self.cm_id + "_open"] = function() { -- cgit v1.2.3 From 3806bb042ac477a50353c745edac08bac82bd8e4 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 28 Feb 2012 15:55:55 +0100 Subject: [REM] Removed old footer styles bzr revid: fme@openerp.com-20120228145555-e69lvw1761o0jnn4 --- addons/web/static/src/css/base_old.css | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base_old.css b/addons/web/static/src/css/base_old.css index 082a18a922e..50bc20a0f0f 100644 --- a/addons/web/static/src/css/base_old.css +++ b/addons/web/static/src/css/base_old.css @@ -385,30 +385,6 @@ label.error { min-height: 100%\9; } -/* Footer */ -.openerp div.oe_footer { - background: none repeat scroll 0 0 #CCCCCC; - overflow: hidden; - padding: 5px 0; - position: relative; - -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); - -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.4); -} -.openerp div.oe_footer p.oe_footer_powered { - left: 50%; - margin: 0; - padding: 0 15px; - color: #666666; - font-weight: bold; - font-size: 0.8em; - text-align: center; -} -.openerp div.oe_footer p.oe_footer_powered a { - text-decoration: none; - color: #666666; -} - /* Main Application */ .openerp .oe-main-content { -- cgit v1.2.3 From 2da29835334266a278e030411d1a3539fc7d11e2 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 29 Feb 2012 12:04:28 +0100 Subject: [imp] renammed tag_name bzr revid: nicolas.vanhoren@openerp.com-20120229110428-es0fof2fxxa5qzd5 --- addons/web/static/src/js/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 93e2b06c1f6..bbfac551c5d 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -937,7 +937,7 @@ openerp.web.OldWidget = openerp.web.Widget.extend({ this.element_id = element_id; this.element_id = this.element_id || _.uniqueId('widget-'); var tmp = document.getElementById(this.element_id); - this.$element = tmp ? $(tmp) : $(document.createElement(this.tag_name)); + this.$element = tmp ? $(tmp) : $(document.createElement(this.tagName)); }, render_element: function() { var rendered = this.render(); -- cgit v1.2.3 From 7eb12aee74633e4f240b0373eae476788c14ecba Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 29 Feb 2012 12:07:44 +0100 Subject: [imp] renammed render_element bzr revid: nicolas.vanhoren@openerp.com-20120229110744-0m55gqlme6s225jv --- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/core.js | 4 ++-- addons/web/static/src/js/view_form.js | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index de3275f3230..c019d59e7e1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -864,7 +864,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ }, on_loaded: function(data) { this.data = data; - this.render_element(); + this.renderElement(); if (!this.$secondary_menu && this.getParent()) { // TODO: create Widget openerp.web.SubMenu this.$secondary_menu = this.getParent().$element.find('.oe_secondary_menu'); diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index bbfac551c5d..fe2ca1beb4f 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -881,7 +881,7 @@ openerp.web.Widget = nova.Widget.extend(_.extend({}, openerp.web.CallbackEnabled * `this.template` must be defined. The context given to QWeb contains the "widget" * key that references `this`. */ - render_element: function() { + renderElement: function() { var rendered = null; if (this.template) rendered = openerp.web.qweb.render(this.template, {widget: this}); @@ -939,7 +939,7 @@ openerp.web.OldWidget = openerp.web.Widget.extend({ var tmp = document.getElementById(this.element_id); this.$element = tmp ? $(tmp) : $(document.createElement(this.tagName)); }, - render_element: function() { + renderElement: function() { var rendered = this.render(); if (rendered) { var elem = $(rendered); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 17b9849cd42..78626f69d8a 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -936,7 +936,7 @@ openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.fo update_dom: function() { this.$element.toggle(!this.invisible); }, - render_element: function() { + renderElement: function() { this.$element.html(QWeb.render(this.form_template, { "widget": this })); }, do_attach_tooltip: function(widget, trigger, options) { @@ -1030,13 +1030,13 @@ openerp.web.form.WidgetFrame = openerp.web.form.Widget.extend({ } this.set_row_cells_with(this.table[this.table.length - 1]); }, - render_element: function() { + renderElement: function() { this._super(); var self = this; _.each(this.table, function(row) { _.each(row, function(td) { td.$element = self.$element.find('.' + td.element_class); - td.render_element(); + td.renderElement(); }); }); }, @@ -1140,12 +1140,12 @@ openerp.web.form.WidgetNotebook = openerp.web.form.Widget.extend({ } } }, - render_element: function() { + renderElement: function() { this._super(); var self = this; _.each(this.pages, function(page) { page.$element = self.$element.find('.' + page.element_class); - page.render_element(); + page.renderElement(); }); }, start: function() { @@ -1335,7 +1335,7 @@ openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({ this.nowrap = true; } }, - render_element: function() { + renderElement: function() { var rendered; if (this['for'] && this.type !== 'label') { rendered = QWeb.render(this.form_template, {widget: this['for']}); @@ -2819,7 +2819,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope }, read_function: null}); this.initial_ids = this.options.initial_ids; this.created_elements = []; - this.render_element(); + this.renderElement(); openerp.web.form.dialog(this.$element, { close: function() { self.check_exit(); @@ -3028,7 +3028,7 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp this.row_id = row_id; this.context = context || {}; this.options = _.defaults(options || {}, {"auto_write": true}); - this.render_element(); + this.renderElement(); openerp.web.dialog(this.$element, { title: options.title || '', modal: true, @@ -3150,10 +3150,10 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ start: function() { this._super(); this.selection.$element = $(".oe_form_view_reference_selection", this.$element); - this.selection.render_element(); + this.selection.renderElement(); this.selection.start(); this.m2o.$element = $(".oe_form_view_reference_m2o", this.$element); - this.m2o.render_element(); + this.m2o.renderElement(); this.m2o.start(); }, is_valid: function() { @@ -3400,7 +3400,7 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({ }); openerp.web.form.WidgetHtml = openerp.web.form.Widget.extend({ - render_element: function () { + renderElement: function () { var $root = $('
    '); this.render_children(this, $root); var rendered = $root.html(); -- cgit v1.2.3 From 2f2c246fac6bcef23687e7623e8addc9b92a8998 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 29 Feb 2012 14:02:35 +0100 Subject: [IMP] Improve menus. Works when client is reloaded bzr revid: fme@openerp.com-20120229130235-bx8ptrz4xah1aqct --- addons/web/static/src/js/chrome.js | 28 ++++++++++++++++------------ addons/web/static/src/js/views.js | 3 +++ addons/web/static/src/xml/base.xml | 8 ++++---- 3 files changed, 23 insertions(+), 16 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index ae3a7143d9d..1589ede75c1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -674,6 +674,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ * @param parent */ template: 'Menu', + init: function() { + this._super.apply(this, arguments); + this.has_been_loaded = $.Deferred(); + }, do_reload: function() { var self = this; return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () { @@ -693,12 +697,13 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); // Hide second level submenus this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); + this.has_been_loaded.resolve(); }, /** * Opens a given menu by id, as if a user had browsed to that menu by hand * except does not trigger any event on the way * - * @param {Number} menu_id database id of the terminal menu to select + * @param {Number} id database id of the terminal menu to select */ open_menu: function (id) { var $clicked_menu, $sub_menu, $main_menu; @@ -731,6 +736,12 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } } }, + open_action: function (id) { + var menu_id, $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']'); + if (menu_id = $menu.data('menu')) { + this.open_menu(menu_id); + } + }, on_menu_click: function(ev, id) { id = id || 0; var $clicked_menu, manual = false; @@ -751,7 +762,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this.open_menu(id); this.current_menu = id; this.session.active_id = id; - this.rpc('/web/menu/action', {'menu_id': id}, this.on_menu_action_loaded); + var action_id = $clicked_menu.data('action-id'); + if (action_id) { + this.on_action(action_id); + } } if (ev) { ev.stopPropagation(); @@ -766,16 +780,6 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } $sub_menu.show(); }, - on_menu_action_loaded: function(data) { - var self = this; - if (data.action.length) { - var action = data.action[0][2]; - action.from_menu = true; - self.on_action(action); - } else { - self.on_action({type: 'null_action'}); - } - }, on_action: function(action) { } }); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 08886ddfbe3..82f6d63b9f1 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -65,6 +65,9 @@ session.web.ActionManager = session.web.OldWidget.extend({ if (run_action) { this.null_action(); action_loaded = this.do_action(state.action_id); + session.webclient.menu.has_been_loaded.then(function() { + session.webclient.menu.open_action(state.action_id); + }); } } else if (state.model && state.id) { // TODO handle context & domain ? diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index d2d30c5d580..d1dbf9845c9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -327,9 +327,7 @@ @@ -359,7 +357,9 @@ + t-att-data-menu="menu.id" + t-att-data-action-model="menu.action ? menu.action.split(',')[0] : ''" + t-att-data-action-id="menu.action ? menu.action.split(',')[1] : ''"> -- cgit v1.2.3 From aacfe84d5d9aade37c48157bdc81100ae3595965 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 29 Feb 2012 14:18:26 +0100 Subject: [fix] small problem in client actions bzr revid: nicolas.vanhoren@openerp.com-20120229131826-uofegm4lmsn83r06 --- addons/web/static/src/js/views.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 82f6d63b9f1..503ec360013 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -183,7 +183,7 @@ session.web.ActionManager = session.web.OldWidget.extend({ this.content_stop(); this.dialog_stop(); var ClientWidget = session.web.client_actions.get_object(action.tag); - (this.client_widget = new ClientWidget(this, action.params)).appendTo(this); + (this.client_widget = new ClientWidget(this, action.params)).appendTo(this.$element); }, ir_actions_report_xml: function(action, on_closed) { var self = this; -- cgit v1.2.3 From c7809cafe795e2e29f5e1605691028f2c0159860 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 29 Feb 2012 15:15:27 +0100 Subject: [IMP] Renamed DropDownMenu to UserMenu bzr revid: fme@openerp.com-20120229141527-tuhkt0isveefy2kp --- addons/web/static/src/css/base.css | 16 ++++++++-------- addons/web/static/src/css/base.sass | 4 ++-- addons/web/static/src/js/chrome.js | 20 ++++++++++---------- addons/web/static/src/xml/base.xml | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c36e8c61a2b..ccfc4568513 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -231,19 +231,19 @@ border-right: 4px solid transparent; border-top: 4px solid #4c4c4c; } -.openerp2 .oe_dropdown_menu { +.openerp2 .oe_user_menu { float: right; padding: 0; margin: 0; } -.openerp2 .oe_dropdown_menu li { +.openerp2 .oe_user_menu li { list-style-type: none; float: left; } -.openerp2 .oe_dropdown_menu .oe_dropdown { +.openerp2 .oe_user_menu .oe_dropdown { position: relative; } -.openerp2 .oe_dropdown_menu .oe_dropdown_toggle:after { +.openerp2 .oe_user_menu .oe_dropdown_toggle:after { width: 0; height: 0; display: inline-block; @@ -260,7 +260,7 @@ -moz-opacity: 0.5; opacity: 0.5; } -.openerp2 .oe_dropdown_menu .oe_dropdown_options { +.openerp2 .oe_user_menu .oe_dropdown_options { float: left; background: #333333; background: rgba(37, 37, 37, 0.9); @@ -288,12 +288,12 @@ -moz-background-clip: padding-box; background-clip: padding-box; } -.openerp2 .oe_dropdown_menu .oe_dropdown_options li { +.openerp2 .oe_user_menu .oe_dropdown_options li { float: none; display: block; background-color: none; } -.openerp2 .oe_dropdown_menu .oe_dropdown_options li a { +.openerp2 .oe_user_menu .oe_dropdown_options li a { display: block; padding: 4px 15px; clear: both; @@ -301,7 +301,7 @@ line-height: 18px; color: #eeeeee; } -.openerp2 .oe_dropdown_menu .oe_dropdown_options li a:hover { +.openerp2 .oe_user_menu .oe_dropdown_options li a:hover { background: #292929; background: -moz-linear-gradient(#292929, #191919); background: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f62841896bd..10c6a1ad038 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -242,8 +242,8 @@ $colour4: #8a89ba border-top: 4px solid #4c4c4c // }}} - // DropDown Menu {{{ - .oe_dropdown_menu + // UserMenu {{{ + .oe_user_menu float: right padding: 0 margin: 0 diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1589ede75c1..4b958f5caf0 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -784,10 +784,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ } }); -openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.DropDownMenu# */{ - template: "DropDownMenu", +openerp.web.UserMenu = openerp.web.Widget.extend(/** @lends openerp.web.UserMenu# */{ + template: "UserMenu", /** - * @constructs openerp.web.DropDownMenu + * @constructs openerp.web.UserMenu * @extends openerp.web.Widget * * @param parent @@ -876,7 +876,7 @@ openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Dro $(sc.binding).bind({ 'add': function (e, attrs) { shortcuts_ds.create(attrs, function (out) { - var shortcut = QWeb.render('DropDownMenu.shortcut', { + var shortcut = QWeb.render('UserMenu.shortcut', { shortcuts : [{ name : attrs.name, id : out.result, @@ -904,7 +904,7 @@ openerp.web.DropDownMenu = openerp.web.Widget.extend(/** @lends openerp.web.Dro sc.splice(0, sc.length); sc.push.apply(sc, shortcuts); - $(QWeb.render('DropDownMenu.shortcut', {'shortcuts': shortcuts})) + $(QWeb.render('UserMenu.shortcut', {'shortcuts': shortcuts})) .appendTo(self.$element.find('.oe_dropdown_options')); }); }, @@ -1004,7 +1004,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie this.session.on_session_valid.add(function() { self.show_application(); - self.dropdown_menu.do_update(); + self.user_menu.do_update(); self.menu.do_reload(); if(self.action_manager) self.action_manager.destroy(); @@ -1034,10 +1034,10 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.menu = new openerp.web.Menu(self); self.menu.replace(this.$element.find('.oe_menu_placeholder')); self.menu.on_action.add(this.proxy('on_menu_action')); - self.dropdown_menu = new openerp.web.DropDownMenu(self); - self.dropdown_menu.replace(this.$element.find('.oe_dropdown_menu_placeholder')); - self.dropdown_menu.on_menu_logout.add(this.proxy('on_logout')); - self.dropdown_menu.on_action.add(this.proxy('on_menu_action')); + self.user_menu = new openerp.web.UserMenu(self); + self.user_menu.replace(this.$element.find('.oe_user_menu_placeholder')); + self.user_menu.on_menu_logout.add(this.proxy('on_logout')); + self.user_menu.on_action.add(this.proxy('on_menu_action')); }, show_common: function() { var self = this; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index d1dbf9845c9..7b5643ec8f9 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -21,7 +21,7 @@
    -
    +
    @@ -364,8 +364,8 @@ - -
      + + - +
    • -- cgit v1.2.3 From 71c94be053fe84cdde22da8e7bf016d825665151 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 29 Feb 2012 16:55:26 +0100 Subject: [ADD] Added systray zone in webclient bzr revid: fme@openerp.com-20120229155526-14gpto9k1qtcl1m8 --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 2 ++ addons/web/static/src/xml/base.xml | 1 + 3 files changed, 6 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index ccfc4568513..fa4ceae540a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -34,6 +34,9 @@ background: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); background: -webkit-linear-gradient(#646060, #262626); } +.openerp2 .oe_topbar .oe_systray { + float: right; +} .openerp2 .oe_topbar .oe_topbar_item li { float: left; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 10c6a1ad038..19fed7c1fe5 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -83,6 +83,8 @@ $colour4: #8a89ba border-bottom: solid 1px black @include vertical-gradient(#646060, #262626) + .oe_systray + float: right .oe_topbar_item li float: left diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7b5643ec8f9..08887e5b837 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -22,6 +22,7 @@
      +
      -- cgit v1.2.3 From f32e1dacbb8fb2c927d39cce7533239b4a938d19 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 29 Feb 2012 17:22:47 +0100 Subject: [ADD] Add menuClicked event to Menu bzr revid: fme@openerp.com-20120229162247-m765betv577y4a2i --- addons/web/static/src/js/chrome.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 4b958f5caf0..58820efd15c 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -758,6 +758,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ id = $clicked_menu.data('menu'); } + this.trigger('menuClicked', id, $clicked_menu); + if (id) { this.open_menu(id); this.current_menu = id; -- cgit v1.2.3 From f48d255e1c23d29fe667cf3ea4a1ce3e16434f78 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 29 Feb 2012 18:51:35 +0100 Subject: [ADD] Add styling to Systray bzr revid: fme@openerp.com-20120229175135-op7lllco1nzdr2z1 --- addons/web/static/src/css/base.css | 4 ++++ addons/web/static/src/css/base.sass | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index fa4ceae540a..b81dea89050 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -37,6 +37,10 @@ .openerp2 .oe_topbar .oe_systray { float: right; } +.openerp2 .oe_topbar .oe_systray > div { + float: left; + padding: 0 4px 0 4px; +} .openerp2 .oe_topbar .oe_topbar_item li { float: left; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 19fed7c1fe5..cfb8178de12 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -85,6 +85,10 @@ $colour4: #8a89ba .oe_systray float: right + .oe_systray > div + float: left + padding: 0 4px 0 4px + .oe_topbar_item li float: left -- cgit v1.2.3 From bedb2d9596010f226c81c65b831795d7e1536acc Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 1 Mar 2012 10:58:07 +0100 Subject: [IMP] Added Systray tooltips bzr revid: fme@openerp.com-20120301095807-w8xi6b36adf1ky1z --- addons/web/static/src/js/chrome.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 58820efd15c..3b0e30382aa 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1019,6 +1019,9 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie document.title = version_label; } }); + this.$element.on('mouseenter', '.oe_systray > div:not([data-tipsy=true])', function() { + $(this).attr('data-tipsy', 'true').tipsy().trigger('mouseenter'); + }); }, show_login: function() { var self = this; -- cgit v1.2.3 From 7e5feece185205a187d57539d97d5b0279cf4c68 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 1 Mar 2012 14:00:08 +0100 Subject: [ADD] eval tests for eval_domain_and_context bzr revid: xmo@openerp.com-20120301130008-dijd6r49js1227by --- addons/web/static/src/js/core.js | 105 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index fe2ca1beb4f..679b193e121 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -321,6 +321,108 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. this.active_id = null; return this.session_init(); }, + test_eval: function (source, expected) { + try { + var ctx = this.test_eval_contexts(source.contexts); + if (!_.isEqual(ctx, expected.context)) { + console.group('Local context does not match remote'); + console.warn('source', source.contexts); + console.warn('local', ctx); + console.warn('remote', expected.context); + console.groupEnd(); + } + } catch (e) { + console.error( + 'Failed to evaluate contexts', source.contexts, ':', e); + } + + try { + var dom = this.test_eval_domains(source.domains); + if (!_.isEqual(dom, expected.domain)) { + console.group('Local domain does not match remote'); + console.warn('source', source.domains); + console.warn('local', dom); + console.warn('remote', expected.domain); + console.groupEnd(); + } + } catch (e) { + console.error( + 'Failed to evaluate domains', source.domains, ':', e); + } + + try { + var groups = this.test_eval_groupby(source.group_by_seq); + if (!_.isEqual(groups, expected.group_by)) { + console.group('Local groupby does not match remote'); + console.warn('source', source.group_by_seq); + console.warn('local', groups); + console.warn('remote', expected.group_by); + console.groupEnd(); + } + } catch (e) {} + }, + test_eval_contexts: function (contexts) { + var result_context = _.extend({}, this.user_context), + self = this; + _(contexts).each(function (ctx) { + switch(ctx.__ref) { + case 'context': + _.extend(py.eval(ctx.__debug)); + break; + case 'compound_context': + _.extend(self.test_eval_contexts(ctx.__contexts)); + break; + default: + _.extend(result_context, ctx); + } + }); + return result_context; + }, + test_eval_domains: function (domains) { + var result_domain = [], self = this; + _(domains).each(function (dom) { + switch(dom.__ref) { + case 'domain': + result_domain.push.apply( + result_domain, py.eval(dom.__debug)); + break; + case 'compound_domain': + result_domain.push.apply( + result_domain, self.test_eval_contexts(dom.__contexts)); + break; + default: + result_domain.push.apply( + result_domain, dom); + } + }); + return result_domain; + }, + test_eval_groupby: function (contexts) { + var result_group = [], self = this; + _(contexts).each(function (ctx) { + var group; + switch(ctx.__ref) { + case 'context': + group = py.eval(ctx.__debug).group_by; + break; + case 'compound_context': + group = self.test_eval_contexts(ctx.__contexts).group_by; + break; + default: + group = ctx.group_by + } + if (!group) { return; } + if (typeof group === 'string') { + result_group.push(group); + } else if (group instanceof Array) { + result_group.push.apply(result_group, group); + } else { + throw new Error('Got invalid groupby {{' + + JSON.stringify(group) + '}}'); + } + }); + return result_group; + }, /** * Executes an RPC call, registering the provided callbacks. * @@ -358,6 +460,9 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. function (response, textStatus, jqXHR) { self.on_rpc_response(); if (!response.error) { + if (url.url === '/web/session/eval_domain_and_context') { + self.test_eval(params, response.result); + } deferred.resolve(response["result"], textStatus, jqXHR); } else if (response.error.data.type === "session_invalid") { self.uid = false; -- cgit v1.2.3 From 12358af73bc0df054881258d690c91536e92b368 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 1 Mar 2012 14:59:00 +0100 Subject: [IMP] add basic evaluation context to asserter (for domains, so time and datetime are available). Doesn't really work because kwargs not supported by py.js (see bug #3), so Sales > Reporting > Opportunities analysis does not work Also current implementation of datetime and time.strftime very incomplete bzr revid: xmo@openerp.com-20120301135900-w4aucd5boi9yzmod --- addons/web/static/src/js/core.js | 50 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 679b193e121..ca53bce9c59 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -321,6 +321,47 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. this.active_id = null; return this.session_init(); }, + test_eval_get_context: function () { + var datetime = new py.object(); + var date = datetime.date = new py.type(function date(y, m, d) { + this._year = y; + this._month = m; + this._day = d; + }, py.object, { + strftime: function (format) { + var f = format.toJSON(), self = this; + return new py.str(f.replace(/%([A-Za-z])/g, function (m, c) { + switch (c) { + case 'Y': return self._year; + case 'm': return _.str.sprintf('%02d', self._month); + case 'd': return _.str.sprintf('%02d', self._day); + } + throw new Error('ValueError: No known conversion for ' + m); + })); + } + }); + date.__getattribute__ = function (name) { + if (name === 'today') { + return date.today; + } + throw new Error("AttributeError: object 'date' has no attribute '" + name +"'"); + }; + date.today = new py.def(function () { + var d = new Date(); + return new date(d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate()); + }); + + var time = new py.object(); + time.strftime = new py.def(function (format) { + return date.today.__call__().strftime(format); + }); + + return { + uid: new py.float(this.uid), + datetime: datetime, + time: time + }; + }, test_eval: function (source, expected) { try { var ctx = this.test_eval_contexts(source.contexts); @@ -337,7 +378,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. } try { - var dom = this.test_eval_domains(source.domains); + var dom = this.test_eval_domains(source.domains, this.test_eval_get_context()); if (!_.isEqual(dom, expected.domain)) { console.group('Local domain does not match remote'); console.warn('source', source.domains); @@ -378,17 +419,18 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. }); return result_context; }, - test_eval_domains: function (domains) { + test_eval_domains: function (domains, eval_context) { var result_domain = [], self = this; _(domains).each(function (dom) { switch(dom.__ref) { case 'domain': result_domain.push.apply( - result_domain, py.eval(dom.__debug)); + result_domain, py.eval(dom.__debug, eval_context)); break; case 'compound_domain': result_domain.push.apply( - result_domain, self.test_eval_contexts(dom.__contexts)); + result_domain, self.test_eval_domains( + dom.__domains, eval_context)); break; default: result_domain.push.apply( -- cgit v1.2.3 From f8a93bc2848eba516213142f4f730a1feda5a39e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 5 Mar 2012 09:55:32 +0100 Subject: [FIX] update py.js for operators &al, implement basic crummy version of relativedelta bzr revid: xmo@openerp.com-20120305085532-0vcz6j0m985gjuz1 --- addons/web/static/src/js/core.js | 128 +++++++++++++++++++++++++++++++++++---- 1 file changed, 117 insertions(+), 11 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index ca53bce9c59..ead33822926 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -322,19 +322,34 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. return this.session_init(); }, test_eval_get_context: function () { + var asJS = function (arg) { + if (arg instanceof py.object) { + return arg.toJSON(); + } + return arg; + }; + var datetime = new py.object(); + datetime.datetime = new py.type(function datetime() { + throw new Error('datetime.datetime not implemented'); + }); var date = datetime.date = new py.type(function date(y, m, d) { - this._year = y; - this._month = m; - this._day = d; + if (y instanceof Array) { + d = y[2]; + m = y[1]; + y = y[0]; + } + this.year = asJS(y); + this.month = asJS(m); + this.day = asJS(d); }, py.object, { - strftime: function (format) { - var f = format.toJSON(), self = this; + strftime: function (args) { + var f = asJS(args[0]), self = this; return new py.str(f.replace(/%([A-Za-z])/g, function (m, c) { switch (c) { - case 'Y': return self._year; - case 'm': return _.str.sprintf('%02d', self._month); - case 'd': return _.str.sprintf('%02d', self._day); + case 'Y': return self.year; + case 'm': return _.str.sprintf('%02d', self.month); + case 'd': return _.str.sprintf('%02d', self.day); } throw new Error('ValueError: No known conversion for ' + m); })); @@ -350,16 +365,107 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. var d = new Date(); return new date(d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate()); }); + datetime.time = new py.type(function time() { + throw new Error('datetime.time not implemented'); + }); var time = new py.object(); - time.strftime = new py.def(function (format) { - return date.today.__call__().strftime(format); + time.strftime = new py.def(function (args) { + return date.today.__call__().strftime(args); + }); + + var relativedelta = new py.type(function relativedelta(args, kwargs) { + if (!_.isEmpty(args)) { + throw new Error('Extraction of relative deltas from existing datetimes not supported'); + } + this.ops = kwargs; + }, py.object, { + __add__: function (other) { + if (!(other instanceof datetime.date)) { + return py.NotImplemented; + } + // TODO: test this whole mess + var year = asJS(this.ops.year) || asJS(other.year); + if (asJS(this.ops.years)) { + year += asJS(this.ops.years); + } + + var month = asJS(this.ops.month) || asJS(other.month); + if (asJS(this.ops.months)) { + month += asJS(this.ops.months); + // FIXME: no divmod in JS? + while (month < 1) { + year -= 1; + month += 12; + } + while (month > 12) { + year += 1; + month -= 12; + } + } + + var lastMonthDay = new Date(year, month, 0).getDate(); + var day = asJS(this.ops.day) || asJS(other.day); + if (day > lastMonthDay) { day = lastMonthDay; } + var days_offset = ((asJS(this.ops.weeks) || 0) * 7) + (asJS(this.ops.days) || 0); + if (days_offset) { + day = new Date(year, month-1, day + days_offset).getDate(); + } + // TODO: leapdays? + // TODO: hours, minutes, seconds? Not used in XML domains + // TODO: weekday? + return new datetime.date(year, month, day); + }, + __radd__: function (other) { + return this.__add__(other); + }, + + __sub__: function (other) { + if (!(other instanceof datetime.date)) { + return py.NotImplemented; + } + // TODO: test this whole mess + var year = asJS(this.ops.year) || asJS(other.year); + if (asJS(this.ops.years)) { + year -= asJS(this.ops.years); + } + + var month = asJS(this.ops.month) || asJS(other.month); + if (asJS(this.ops.months)) { + month -= asJS(this.ops.months); + // FIXME: no divmod in JS? + while (month < 1) { + year -= 1; + month += 12; + } + while (month > 12) { + year += 1; + month -= 12; + } + } + + var lastMonthDay = new Date(year, month, 0).getDate(); + var day = asJS(this.ops.day) || asJS(other.day); + if (day > lastMonthDay) { day = lastMonthDay; } + var days_offset = ((asJS(this.ops.weeks) || 0) * 7) + (asJS(this.ops.days) || 0); + if (days_offset) { + day = new Date(year, month-1, day - days_offset).getDate(); + } + // TODO: leapdays? + // TODO: hours, minutes, seconds? Not used in XML domains + // TODO: weekday? + return new datetime.date(year, month, day); + }, + __rsub__: function (other) { + return this.__sub__(other); + } }); return { uid: new py.float(this.uid), datetime: datetime, - time: time + time: time, + relativedelta: relativedelta }; }, test_eval: function (source, expected) { -- cgit v1.2.3 From 0e177c250596bec870bc65e180832be04b48ad3e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 5 Mar 2012 16:10:17 +0100 Subject: [FIX] content display of URI fields when no value is provided lp bug: https://launchpad.net/bugs/942958 fixed bzr revid: xmo@openerp.com-20120305151017-k98vlcq72hldwnev --- addons/web/static/src/js/view_page.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index 3b436841579..ceddf3cc5ee 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -96,6 +96,10 @@ openerp.web.page = function (openerp) { return value; }, set_value: function (value) { + if (!value) { + this.$element.find('a').text('').attr('href', '#'); + return; + } this.$element.find('a') .attr('href', this.scheme + ':' + value) .text(this.format_value(value)); @@ -106,6 +110,10 @@ openerp.web.page = function (openerp) { }); openerp.web.page.FieldUrlReadonly = openerp.web.page.FieldURIReadonly.extend({ set_value: function (value) { + if (!value) { + this.$element.find('a').text('').attr('href', '#'); + return; + } var s = /(\w+):(.+)/.exec(value); if (!s) { value = "http://" + value; -- cgit v1.2.3 From 28f1ded961c2b2f598a1b0a2a55f5bccb2eeafc7 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Mar 2012 18:16:56 +0100 Subject: [FIX] @default_focus not honored in embedded form views lp bug: https://launchpad.net/bugs/944080 fixed bzr revid: fme@openerp.com-20120305171656-yz1jjoin17hh8ast --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6a45bae5abd..6ae693dcd2e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -205,7 +205,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# if (self.sidebar) { self.sidebar.attachments.do_update(); } - if (self.default_focus_field && !self.embedded_view) { + if (self.default_focus_field) { self.default_focus_field.focus(); } if (record.id) { -- cgit v1.2.3 From eb2338c575a47d721ba018cca349ff76aadee038 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Mar 2012 18:20:21 +0100 Subject: [FIX] @default_focus not honored in embedded form views lp bug: https://launchpad.net/bugs/944080 fixed bzr revid: fme@openerp.com-20120305172021-wwmen156hb38yppc --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 70b66b897eb..d4a090eafcc 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -211,7 +211,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# if (self.sidebar) { self.sidebar.attachments.do_update(); } - if (self.default_focus_field && !self.embedded_view) { + if (self.default_focus_field) { self.default_focus_field.focus(); } if (record.id) { -- cgit v1.2.3 From 542948ee6af7cf02e2e0df8ff5c320057179f66a Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Mar 2012 18:34:19 +0100 Subject: [FIX] List view "Group" label should be translatable lp bug: https://launchpad.net/bugs/943973 fixed bzr revid: fme@openerp.com-20120305173419-ksme8ckweu98b82r --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index c44b62d08f2..aa4d3963db1 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -363,7 +363,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# _(this.fields_view.arch.children).map(field_to_column)); if (grouped) { this.columns.unshift({ - id: '_group', tag: '', string: "Group", meta: true, + id: '_group', tag: '', string: _t("Group"), meta: true, modifiers_for: function () { return {}; } }, { id: '_count', tag: '', string: '#', meta: true, -- cgit v1.2.3 From effd8e2ca3a053a258831d5ac53676d00ee948e8 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Mar 2012 19:45:16 +0100 Subject: [FIX] "Group" label in list view should be translatable lp bug: https://launchpad.net/bugs/943973 fixed bzr revid: fme@openerp.com-20120305184516-6j7ftdnflw6mrb0p --- addons/web/static/src/js/view_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 30a0018b6e1..e8fff450c6e 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -363,7 +363,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# _(this.fields_view.arch.children).map(field_to_column)); if (grouped) { this.columns.unshift({ - id: '_group', tag: '', string: "Group", meta: true, + id: '_group', tag: '', string: _t("Group"), meta: true, modifiers_for: function () { return {}; } }, { id: '_count', tag: '', string: '#', meta: true, -- cgit v1.2.3 From 542a6e9a671c59f73b93c022d0072fdba4dbe6b5 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 5 Mar 2012 20:58:00 +0100 Subject: [FIX] @digits not honored by form view. field#digits not honored by page view. lp bug: https://launchpad.net/bugs/943273 fixed bzr revid: fme@openerp.com-20120305195800-uoiu74ee1rfm4tex --- addons/web/static/src/js/view_form.js | 7 +------ addons/web/static/src/js/view_page.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6ae693dcd2e..335a4e39d72 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1526,16 +1526,11 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({ init: function (view, node) { this._super(view, node); if (node.attrs.digits) { - this.parse_digits(node.attrs.digits); + this.digits = py.eval(node.attrs.digits).toJSON(); } else { this.digits = view.fields_view.fields[node.attrs.name].digits; } }, - parse_digits: function (digits_attr) { - // could use a Python parser instead. - var match = /^\s*[\(\[](\d+),\s*(\d+)/.exec(digits_attr); - return [parseInt(match[1], 10), parseInt(match[2], 10)]; - }, set_value: function(value) { if (value === false || value === undefined) { // As in GTK client, floats default to 0 diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index ceddf3cc5ee..b34fd0e358b 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -89,6 +89,16 @@ openerp.web.page = function (openerp) { return show_value; } }); + openerp.web.page.FieldFloatReadonly = openerp.web.page.FieldCharReadonly.extend({ + init: function (view, node) { + this._super(view, node); + if (node.attrs.digits) { + this.digits = py.eval(node.attrs.digits).toJSON(); + } else { + this.digits = view.fields_view.fields[node.attrs.name].digits; + } + } + }); openerp.web.page.FieldURIReadonly = openerp.web.page.FieldCharReadonly.extend({ template: 'FieldURI.readonly', scheme: null, @@ -269,7 +279,7 @@ openerp.web.page = function (openerp) { 'one2many_list' : 'openerp.web.page.FieldOne2ManyReadonly', 'reference': 'openerp.web.page.FieldReferenceReadonly', 'boolean': 'openerp.web.page.FieldBooleanReadonly', - 'float': 'openerp.web.page.FieldCharReadonly', + 'float': 'openerp.web.page.FieldFloatReadonly', 'integer': 'openerp.web.page.FieldCharReadonly', 'float_time': 'openerp.web.page.FieldCharReadonly', 'binary': 'openerp.web.page.FieldBinaryFileReadonly', -- cgit v1.2.3 From 43ab27d7bb6c06f06a19917af24d567716a946ed Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 6 Mar 2012 12:02:12 +0100 Subject: [FIX] Menu not working anymore after the installation of a module lp bug: https://launchpad.net/bugs/944113 fixed bzr revid: fme@openerp.com-20120306110212-9qd1r0q5t0zwnnt0 --- addons/web/static/src/js/chrome.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 1d465df1cc5..20750f07a4e 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -678,6 +678,11 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ this._super.apply(this, arguments); this.has_been_loaded = $.Deferred(); }, + start: function() { + this._super.apply(this, arguments); + this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); + this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click); + }, do_reload: function() { var self = this; return this.rpc("/web/menu/load", {}, this.on_loaded).then(function () { @@ -689,11 +694,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ on_loaded: function(data) { this.data = data; this.renderElement(); - if (!this.$secondary_menus && this.getParent()) { - // TODO: create Widget openerp.web.SubMenu - this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container'); - this.$element.add(this.$secondary_menus).on('click', 'a[data-menu]', this.on_menu_click); - } + this.$element.on('click', 'a[data-menu]', this.on_menu_click); this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this })); // Hide second level submenus this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide(); -- cgit v1.2.3 From 34b03bd24d8db9dcd36477b7e1076ae9b180870b Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 6 Mar 2012 21:59:55 +0100 Subject: [FIX] Can't add to dashboard a view that includes a 'group_by' lp bug: https://launchpad.net/bugs/948097 fixed bzr revid: fme@openerp.com-20120306205955-zqgtbgtz1gtix4w9 --- addons/web/static/src/js/views.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 56997190bc1..a9979ebf099 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -408,6 +408,9 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V var groupby = results.group_by.length ? results.group_by : action_context.group_by; + if (_.isString(groupby)) { + groupby = [groupby]; + } controller.do_search(results.domain, results.context, groupby || []); }); }, -- cgit v1.2.3 From 98341230a78fe9798b55d3a4173b17a00d8d9a0f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Mar 2012 08:46:41 +0100 Subject: [FIX] context evaluation: accumulation of literal and compound context data into evaluated context bzr revid: xmo@openerp.com-20120307074641-pm5wl9t3cb4l9s64 --- addons/web/static/src/js/core.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 6e44394c8a2..6f9773a676e 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -514,10 +514,11 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. _(contexts).each(function (ctx) { switch(ctx.__ref) { case 'context': - _.extend(py.eval(ctx.__debug)); + _.extend(result_context, py.eval(ctx.__debug)); break; case 'compound_context': - _.extend(self.test_eval_contexts(ctx.__contexts)); + _.extend( + result_context, self.test_eval_contexts(ctx.__contexts)); break; default: _.extend(result_context, ctx); -- cgit v1.2.3 From dbcac346d66012b9615ff2697ebb60dcea245d02 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Mar 2012 10:12:54 +0100 Subject: [IMP] simplify opacity mixin, add missing variants to vertical and radial gradients bzr revid: xmo@openerp.com-20120307091254-x9kg0ua1twbjmxp9 --- addons/web/static/src/css/base.css | 26 ++++++++++++++------------ addons/web/static/src/css/base.sass | 19 +++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index b81dea89050..52dcc46ec15 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -29,10 +29,13 @@ height: 31px; border-top: solid 1px #d3d3d3; border-bottom: solid 1px black; - background: #646060; - background: -moz-linear-gradient(#646060, #262626); - background: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); - background: -webkit-linear-gradient(#646060, #262626); + background-color: #646060; + background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); + background-image: -webkit-linear-gradient(top, #646060, #262626); + background-image: -moz-linear-gradient(top, #646060, #262626); + background-image: -ms-linear-gradient(top, #646060, #262626); + background-image: -o-linear-gradient(top, #646060, #262626); + background-image: linear-gradient(to bottom, #646060, #262626); } .openerp2 .oe_topbar .oe_systray { float: right; @@ -226,8 +229,6 @@ border-bottom: 4px solid transparent; border-left: 4px solid #4c4c4c; filter: alpha(opacity=50); - -khtml-opacity: 0.5; - -moz-opacity: 0.5; opacity: 0.5; } .openerp2 .oe_secondary_submenu .oe_menu_opened:before { @@ -263,8 +264,6 @@ border-right: 4px solid transparent; border-top: 4px solid white; filter: alpha(opacity=50); - -khtml-opacity: 0.5; - -moz-opacity: 0.5; opacity: 0.5; } .openerp2 .oe_user_menu .oe_dropdown_options { @@ -309,10 +308,13 @@ color: #eeeeee; } .openerp2 .oe_user_menu .oe_dropdown_options li a:hover { - background: #292929; - background: -moz-linear-gradient(#292929, #191919); - background: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); - background: -webkit-linear-gradient(#292929, #191919); + background-color: #292929; + background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); -moz-box-shadow: none; -webkit-box-shadow: none; -box-shadow: none; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cfb8178de12..92b8101f2b7 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -5,16 +5,21 @@ $colour4: #8a89ba // Mixins {{{ @mixin vertical-gradient($startColor: #555, $endColor: #333) - background: $startColor - background: -moz-linear-gradient($startColor, $endColor) - background: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) - background: -webkit-linear-gradient($startColor, $endColor) + background-color: $startColor + background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */ + background-image: -webkit-linear-gradient(top, $startColor, $endColor) /* Chrome 10+, Saf5.1+, iOS 5+ */ + background-image: -moz-linear-gradient(top, $startColor, $endColor) /* FF3.6 */ + background-image: -ms-linear-gradient(top, $startColor, $endColor) /* IE10 */ + background-image: -o-linear-gradient(top, $startColor, $endColor) /* Opera 11.10+ */ + background-image: linear-gradient(to bottom, $startColor, $endColor) + @mixin radial-gradient($gradient) background-position: center center - background-image: radial-gradient($gradient) - background-image: -moz-radial-gradient($gradient) background-image: -webkit-radial-gradient(circle, $gradient) + background-image: -moz-radial-gradient($gradient) + background-image: -ms-radial-gradient($gradient) + background-image: radial-gradient($gradient) @mixin radius($radius: 5px) -moz-border-radius: $radius @@ -35,8 +40,6 @@ $colour4: #8a89ba @mixin opacity($opacity: .5) filter: alpha(opacity=$opacity * 100) - -khtml-opacity: $opacity - -moz-opacity: $opacity opacity: $opacity @mixin background-clip($clip: padding-box) -- cgit v1.2.3 From cdd72c0fe65616d7bdf7a376cb29ed11bd2420d7 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 7 Mar 2012 10:57:00 +0100 Subject: [FIX] Make progress bar (format.js) more tolerant with falsy floats bzr revid: fme@openerp.com-20120307095700-i5msqipgij4v36fl --- addons/web/static/src/js/formats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 90d95f70ec5..c29df56bb30 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( '<%-value%>%', { - value: _.str.sprintf("%.0f", row_data[column.id].value) + value: _.str.sprintf("%.0f", row_data[column.id].value || 0) }); } -- cgit v1.2.3 From 80ebf90a7c411342cc280cb2824f117fad15bb55 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Mar 2012 10:57:32 +0100 Subject: [IMP] debug messages of test evaluator bzr revid: xmo@openerp.com-20120307095732-ckfuowa43i7dkapg --- addons/web/static/src/js/core.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 6f9773a676e..f464bded13b 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -468,45 +468,57 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. relativedelta: relativedelta }; }, + /** + * FIXME: Huge testing hack, especially the evaluation context, rewrite + test for real before switching + */ test_eval: function (source, expected) { try { var ctx = this.test_eval_contexts(source.contexts); if (!_.isEqual(ctx, expected.context)) { - console.group('Local context does not match remote'); + console.group('Local context does not match remote, nothing is broken but please report to R&D (xmo)'); console.warn('source', source.contexts); console.warn('local', ctx); console.warn('remote', expected.context); console.groupEnd(); } } catch (e) { - console.error( - 'Failed to evaluate contexts', source.contexts, ':', e); + console.group('Failed to evaluate contexts, nothing is broken but please report to R&D (xmo)'); + console.error(e); + console.log('source', source.contexts); + console.groupEnd(); } try { var dom = this.test_eval_domains(source.domains, this.test_eval_get_context()); if (!_.isEqual(dom, expected.domain)) { - console.group('Local domain does not match remote'); + console.group('Local domain does not match remote, nothing is broken but please report to R&D (xmo)'); console.warn('source', source.domains); console.warn('local', dom); console.warn('remote', expected.domain); console.groupEnd(); } } catch (e) { - console.error( - 'Failed to evaluate domains', source.domains, ':', e); + console.group('Failed to evaluate domains, nothing is broken but please report to R&D (xmo)'); + console.error(e); + console.log('source', source.domains); + console.groupEnd(); } try { var groups = this.test_eval_groupby(source.group_by_seq); if (!_.isEqual(groups, expected.group_by)) { - console.group('Local groupby does not match remote'); + console.group('Local groupby does not match remote, nothing is broken but please report to R&D (xmo)'); console.warn('source', source.group_by_seq); console.warn('local', groups); console.warn('remote', expected.group_by); console.groupEnd(); } - } catch (e) {} + } catch (e) { + console.group('Failed to evaluate groupby, nothing is broken but please report to R&D (xmo)'); + console.error(e); + console.log('source', source.group_by_seq); + console.groupEnd(); + } }, test_eval_contexts: function (contexts) { var result_context = _.extend({}, this.user_context), -- cgit v1.2.3 From 0df6b1bad7f4d12495a5c95cdbf7e3491e452a96 Mon Sep 17 00:00:00 2001 From: msh-openerp Date: Wed, 7 Mar 2012 15:49:35 +0530 Subject: [FIX]Fixed the issue of statusbar which shows technical name in listview if one gives widget=statusbar in listview field. bzr revid: msh@tinyerp.com-20120307101935-mw4vyjjra6e9uy1v --- addons/web/static/src/js/formats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 90d95f70ec5..7a3b1db1614 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -148,7 +148,7 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { if (typeof(value) == "string") value = openerp.web.auto_str_to_date(value); return value.toString(normalize_format(l10n.time_format)); - case 'selection': + case 'selection': case 'statusbar': // Each choice is [value, label] if(_.isArray(value)) { value = value[0] -- cgit v1.2.3 From bfb9896ddd49e29eb43a80ab0b668beef4536e32 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 7 Mar 2012 11:46:32 +0100 Subject: [FIX] database/create replaced by blocking database/create_database (so we can use a multi-workers OpenERP server; otherwise polling on the server would hit different workers resulting in errors). bzr revid: vmt@openerp.com-20120307104632-w6cs6nxf04ltcpf1 --- addons/web/static/src/js/chrome.js | 51 ++++++-------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 132cc3b5851..4115bd12fea 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -344,44 +344,6 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab }); return result; }, - /** - * Waits until the new database is done creating, then unblocks the UI and - * logs the user in as admin - * - * @param {Number} db_creation_id identifier for the db-creation operation, used to fetch the current installation progress - * @param {Object} info info fields for this database creation - * @param {String} info.db name of the database being created - * @param {String} info.password super-admin password for the database - */ - wait_for_newdb: function (db_creation_id, info) { - var self = this; - self.rpc('/web/database/progress', { - id: db_creation_id, - password: info.password - }, function (result) { - var progress = result[0]; - // I'd display a progress bar, but turns out the progress status - // the server report kind-of blows goats: it's at 0 for ~75% of - // the installation, then jumps to 75%, then jumps down to either - // 0 or ~40%, then back up to 75%, then terminates. Let's keep that - // mess hidden behind a not-very-useful but not overly weird - // message instead. - if (progress < 1) { - setTimeout(function () { - self.wait_for_newdb(db_creation_id, info); - }, 500); - return; - } - - var admin = result[1][0]; - setTimeout(function () { - self.widget_parent.do_login( - info.db, admin.login, admin.password); - self.stop(); - self.unblockUI(); - }); - }); - }, /** * Blocks UI and replaces $.unblockUI by a noop to prevent third parties * from unblocking the UI @@ -422,7 +384,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab submitHandler: function (form) { var fields = $(form).serializeArray(); self.blockUI(); - self.rpc("/web/database/create", {'fields': fields}, function(result) { + self.rpc("/web/database/create_database", {'fields': fields}, function(result) { if (result.error) { self.unblockUI(); self.display_error(result); @@ -433,11 +395,14 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab self.db_list.sort(); self.widget_parent.set_db_list(self.db_list); } + var form_obj = self.to_object(fields); - self.wait_for_newdb(result, { - password: form_obj['super_admin_pwd'], - db: form_obj['db_name'] - }); + self.widget_parent.do_login( + form_obj['db_name'], + 'admin', + form_obj['create_admin_pwd']); + self.stop(); + self.unblockUI(); }); } }); -- cgit v1.2.3 From 9a646fce10f3a918fce7766d672024019255c1ed Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 7 Mar 2012 13:03:23 +0100 Subject: [ADD] permanent loading of saved filters When selecting a saved filter, its data is now saved inside the searchview's state, and re-used any time there's a search performed (until the filter is replaced or the search view is cleared). Some cleanup of the support code for loading filters (SearchView.get_filters) also had to be performed in order not to fill contexts with (potentially incorrect) crap in case the filter is re-saved. lp bug: https://launchpad.net/bugs/948219 fixed bzr revid: xmo@openerp.com-20120307120323-pub0yuwjqk1r3y0p --- addons/web/static/src/js/search.js | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 2809b3792de..8ffb0bdb7c4 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -32,6 +32,8 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea this.hidden = !!hidden; this.headless = this.hidden && !this.has_defaults; + this.filter_data = {}; + this.ready = $.Deferred(); }, start: function() { @@ -271,7 +273,12 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea group_by instanceof Array ? group_by : group_by.split(','), function (el) { return { group_by: el }; }); } - this.on_search([filter.domain], [filter.context], groupbys); + this.filter_data = { + domains: [filter.domain], + contexts: [filter.context], + groupbys: groupbys + }; + this.do_search(); }, this)); } else { select.val(''); @@ -339,9 +346,6 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea if (this.headless && !this.has_defaults) { return this.on_search([], [], []); } - // reset filters management - var select = this.$element.find(".oe_search-view-filters-management"); - select.val("_filters"); if (e && e.preventDefault) { e.preventDefault(); } @@ -385,6 +389,16 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea .map(function (filter) { return filter.get_context();}) .compact() .value(); + + if (this.filter_data.contexts) { + contexts = this.filter_data.contexts.concat(contexts) + } + if (this.filter_data.domains) { + domains = this.filter_data.domains.concat(domains); + } + if (this.filter_data.groupbys) { + groupbys = this.filter_data.groupbys.concat(groupbys); + } return {domains: domains, contexts: contexts, errors: errors, groupbys: groupbys}; }, /** @@ -423,6 +437,9 @@ openerp.web.SearchView = openerp.web.OldWidget.extend(/** @lends openerp.web.Sea * @param {Boolean} [reload_view=true] */ do_clear: function (reload_view) { + this.filter_data = {}; + this.$element.find(".oe_search-view-filters-management").val(''); + this.$element.find('.filter_label, .filter_icon').removeClass('enabled'); this.enabled_filters.splice(0); var string = $('a.searchview_group_string'); -- cgit v1.2.3 From 8c65ef53b93e6e1a8bdc8082b6d3706443875fc5 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 7 Mar 2012 16:05:00 +0100 Subject: [imp] minor feature in the web client class to set the content to full screen bzr revid: nicolas.vanhoren@openerp.com-20120307150500-o8kkxp4ohrtzjq69 --- addons/web/static/src/js/chrome.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 20750f07a4e..cd3ff72ff6a 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1127,6 +1127,12 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie self.menu.on_menu_click(null, action.menu_id); }); } + }, + set_content_full_screen: function(fullscreen) { + if (fullscreen) + this.$element.addClass("oe_content_full_screen"); + else + this.$element.removeClass("oe_content_full_screen"); } }); -- cgit v1.2.3 From 659ab1ff3b85c0035e8c4b23852973a0ee331888 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 7 Mar 2012 16:55:29 +0100 Subject: [imp] changed detail in full screen feature bzr revid: nicolas.vanhoren@openerp.com-20120307155529-t83uabjx0ocm8mjq --- addons/web/static/src/js/chrome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index cd3ff72ff6a..829610f2988 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1130,9 +1130,9 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie }, set_content_full_screen: function(fullscreen) { if (fullscreen) - this.$element.addClass("oe_content_full_screen"); + $(".oe_webclient", this.$element).addClass("oe_content_full_screen"); else - this.$element.removeClass("oe_content_full_screen"); + $(".oe_webclient", this.$element).removeClass("oe_content_full_screen"); } }); -- cgit v1.2.3 From b06d76c51f69c0c3352de53bf78390027321bcaa Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Wed, 7 Mar 2012 17:05:12 +0100 Subject: Added CSS for fullscreen mode (eg. for the point of sale) bzr revid: mit@openerp.com-20120307160512-fziwyn40i45dgxap --- addons/web/static/src/css/base.css | 590 +++++++++++++++++------------------- addons/web/static/src/css/base.sass | 9 + 2 files changed, 285 insertions(+), 314 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 52dcc46ec15..dab8e6070af 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -5,317 +5,279 @@ color: #4c4c4c; font-size: 13px; background: white; - position: relative; -} -.openerp2 a { - text-decoration: none; -} -.openerp2 .oe_webclient { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; -} -.openerp2 .oe_webclient .oe_application { - position: absolute; - top: 32px; - bottom: 0; - left: 206px; - right: 0; -} -.openerp2 .oe_topbar { - width: 100%; - height: 31px; - border-top: solid 1px #d3d3d3; - border-bottom: solid 1px black; - background-color: #646060; - background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); - background-image: -webkit-linear-gradient(top, #646060, #262626); - background-image: -moz-linear-gradient(top, #646060, #262626); - background-image: -ms-linear-gradient(top, #646060, #262626); - background-image: -o-linear-gradient(top, #646060, #262626); - background-image: linear-gradient(to bottom, #646060, #262626); -} -.openerp2 .oe_topbar .oe_systray { - float: right; -} -.openerp2 .oe_topbar .oe_systray > div { - float: left; - padding: 0 4px 0 4px; -} -.openerp2 .oe_topbar .oe_topbar_item li { - float: left; -} -.openerp2 .oe_topbar .oe_topbar_item li a { - display: block; - padding: 5px 10px 7px; - line-height: 20px; - height: 20px; - color: #eeeeee; - vertical-align: top; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -} -.openerp2 .oe_topbar .oe_topbar_item li a:hover { - background: #303030; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -} -.openerp2 .oe_topbar .oe_topbar_item .oe_active { - background: #303030; - font-weight: bold; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -} -.openerp2 .oe_topbar .oe_topbar_avatar { - width: 24px; - height: 24px; - margin: -2px 2px 0 0; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} -.openerp2 .oe_topbar .oe_topbar_avatar { - vertical-align: top; -} -.openerp2 .oe_leftbar { - width: 205px; - height: 100%; - background: #f0eeee; - border-right: 1px solid #afafb6; - overflow: auto; - text-shadow: 0 1px 1px white; -} -.openerp2 .oe_leftbar .oe_footer { - position: absolute; - width: 205px; - text-align: center; - bottom: 8px; -} -.openerp2 a.oe_logo { - display: block; - text-align: center; - height: 70px; - line-height: 70px; -} -.openerp2 a.oe_logo img { - height: 40px; - width: 157px; - margin: 14px 0; -} -.openerp2 .oe_footer { - position: absolute; - width: 205px; - text-align: center; - bottom: 8px; -} -.openerp2 .oe_footer a { - font-weight: 800; - font-family: serif; - font-size: 16px; - color: black; -} -.openerp2 .oe_footer a span { - color: #c81010; - font-style: italic; -} -.openerp2 .oe_menu { - float: left; - padding: 0; - margin: 0; -} -.openerp2 .oe_menu li { - list-style-type: none; - float: left; -} -.openerp2 .oe_menu a { - display: block; - padding: 5px 10px 7px; - line-height: 20px; - height: 20px; - color: #eeeeee; - vertical-align: top; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -} -.openerp2 .oe_menu a:hover { - background: #303030; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -} -.openerp2 .oe_menu .oe_active { - background: #303030; - font-weight: bold; - color: white; - -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; - -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; -} -.openerp2 .oe_secondary_menu_section { - font-weight: bold; - margin-left: 8px; - color: #8a89ba; -} -.openerp2 .oe_secondary_submenu { - padding: 2px 0 8px 0; - margin: 0; - width: 100%; - display: inline-block; -} -.openerp2 .oe_secondary_submenu li { - position: relative; - padding: 1px 0 1px 16px; - list-style-type: none; -} -.openerp2 .oe_secondary_submenu li a { - display: block; - color: #4c4c4c; - padding: 2px 4px 2px 0; -} -.openerp2 .oe_secondary_submenu li .oe_menu_label { - position: absolute; - top: 1px; - right: 1px; - font-size: 10px; - background: #8a89ba; - color: white; - padding: 2px 4px; - margin: 1px 6px 0 0; - border: 1px solid lightGray; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -} -.openerp2 .oe_secondary_submenu .oe_active { - background: #8a89ba; - border-top: 1px solid lightGray; - border-bottom: 1px solid lightGray; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); -} -.openerp2 .oe_secondary_submenu .oe_active a { - color: white; -} -.openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { - background: #eeeeee; - color: #8a89ba; - text-shadow: 0 1px 1px white; - -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -} -.openerp2 .oe_secondary_submenu .oe_menu_toggler:before { - width: 0; - height: 0; - display: inline-block; - content: "&darr"; - text-indent: -99999px; - vertical-align: top; - margin-left: -8px; - margin-top: 4px; - margin-right: 4px; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid #4c4c4c; - filter: alpha(opacity=50); - opacity: 0.5; -} -.openerp2 .oe_secondary_submenu .oe_menu_opened:before { - margin-top: 6px; - margin-left: -12px; - margin-right: 4px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid #4c4c4c; -} -.openerp2 .oe_user_menu { - float: right; - padding: 0; - margin: 0; -} -.openerp2 .oe_user_menu li { - list-style-type: none; - float: left; -} -.openerp2 .oe_user_menu .oe_dropdown { - position: relative; -} -.openerp2 .oe_user_menu .oe_dropdown_toggle:after { - width: 0; - height: 0; - display: inline-block; - content: "&darr"; - text-indent: -99999px; - vertical-align: top; - margin-top: 8px; - margin-left: 4px; - border-left: 4px solid transparent; - border-right: 4px solid transparent; - border-top: 4px solid white; - filter: alpha(opacity=50); - opacity: 0.5; -} -.openerp2 .oe_user_menu .oe_dropdown_options { - float: left; - background: #333333; - background: rgba(37, 37, 37, 0.9); - display: none; - position: absolute; - top: 32px; - right: -1px; - border: 0; - z-index: 900; - margin-left: 0; - margin-right: 0; - padding: 6px 0; - zoom: 1; - border-color: #999999; - border-color: rgba(0, 0, 0, 0.2); - border-style: solid; - border-width: 0 1px 1px; - -moz-border-radius: 0 0 6px 6px; - -webkit-border-radius: 0 0 6px 6px; - border-radius: 0 0 6px 6px; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-background-clip: padding-box; - -moz-background-clip: padding-box; - background-clip: padding-box; -} -.openerp2 .oe_user_menu .oe_dropdown_options li { - float: none; - display: block; - background-color: none; -} -.openerp2 .oe_user_menu .oe_dropdown_options li a { - display: block; - padding: 4px 15px; - clear: both; - font-weight: normal; - line-height: 18px; - color: #eeeeee; -} -.openerp2 .oe_user_menu .oe_dropdown_options li a:hover { - background-color: #292929; - background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); - background-image: -webkit-linear-gradient(top, #292929, #191919); - background-image: -moz-linear-gradient(top, #292929, #191919); - background-image: -ms-linear-gradient(top, #292929, #191919); - background-image: -o-linear-gradient(top, #292929, #191919); - background-image: linear-gradient(to bottom, #292929, #191919); - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; -} + position: relative; } + .openerp2 a { + text-decoration: none; } + .openerp2 .oe_webclient { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; } + .openerp2 .oe_webclient .oe_application { + position: absolute; + top: 32px; + bottom: 0; + left: 206px; + right: 0; } + .openerp2 .oe_content_full_screen .oe_application { + top: 0; + left: 0; } + .openerp2 .oe_content_full_screen .topbar, .openerp2 .oe_content_full_screen .leftbar { + display: none; } + .openerp2 .oe_topbar { + width: 100%; + height: 31px; + border-top: solid 1px #d3d3d3; + border-bottom: solid 1px black; + background-color: #646060; + background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626)); + background-image: -webkit-linear-gradient(top, #646060, #262626); + background-image: -moz-linear-gradient(top, #646060, #262626); + background-image: -ms-linear-gradient(top, #646060, #262626); + background-image: -o-linear-gradient(top, #646060, #262626); + background-image: linear-gradient(to bottom, #646060, #262626); } + .openerp2 .oe_topbar .oe_systray { + float: right; } + .openerp2 .oe_topbar .oe_systray > div { + float: left; + padding: 0 4px 0 4px; } + .openerp2 .oe_topbar .oe_topbar_item li { + float: left; } + .openerp2 .oe_topbar .oe_topbar_item li a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } + .openerp2 .oe_topbar .oe_topbar_item li a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + .openerp2 .oe_topbar .oe_topbar_item .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + .openerp2 .oe_topbar .oe_topbar_avatar { + width: 24px; + height: 24px; + margin: -2px 2px 0 0; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; } + .openerp2 .oe_topbar .oe_topbar_avatar { + vertical-align: top; } + .openerp2 .oe_leftbar { + width: 205px; + height: 100%; + background: #f0eeee; + border-right: 1px solid #afafb6; + overflow: auto; + text-shadow: 0 1px 1px white; } + .openerp2 .oe_leftbar .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; } + .openerp2 a.oe_logo { + display: block; + text-align: center; + height: 70px; + line-height: 70px; } + .openerp2 a.oe_logo img { + height: 40px; + width: 157px; + margin: 14px 0; } + .openerp2 .oe_footer { + position: absolute; + width: 205px; + text-align: center; + bottom: 8px; } + .openerp2 .oe_footer a { + font-weight: 800; + font-family: serif; + font-size: 16px; + color: black; } + .openerp2 .oe_footer a span { + color: #c81010; + font-style: italic; } + .openerp2 .oe_menu { + float: left; + padding: 0; + margin: 0; } + .openerp2 .oe_menu li { + list-style-type: none; + float: left; } + .openerp2 .oe_menu a { + display: block; + padding: 5px 10px 7px; + line-height: 20px; + height: 20px; + color: #eeeeee; + vertical-align: top; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } + .openerp2 .oe_menu a:hover { + background: #303030; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + .openerp2 .oe_menu .oe_active { + background: #303030; + font-weight: bold; + color: white; + -moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; + -box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset; } + .openerp2 .oe_secondary_menu_section { + font-weight: bold; + margin-left: 8px; + color: #8a89ba; } + .openerp2 .oe_secondary_submenu { + padding: 2px 0 8px 0; + margin: 0; + width: 100%; + display: inline-block; } + .openerp2 .oe_secondary_submenu li { + position: relative; + padding: 1px 0 1px 16px; + list-style-type: none; } + .openerp2 .oe_secondary_submenu li a { + display: block; + color: #4c4c4c; + padding: 2px 4px 2px 0; } + .openerp2 .oe_secondary_submenu li .oe_menu_label { + position: absolute; + top: 1px; + right: 1px; + font-size: 10px; + background: #8a89ba; + color: white; + padding: 2px 4px; + margin: 1px 6px 0 0; + border: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } + .openerp2 .oe_secondary_submenu .oe_active { + background: #8a89ba; + border-top: 1px solid lightGray; + border-bottom: 1px solid lightGray; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2); } + .openerp2 .oe_secondary_submenu .oe_active a { + color: white; } + .openerp2 .oe_secondary_submenu .oe_active .oe_menu_label { + background: #eeeeee; + color: #8a89ba; + text-shadow: 0 1px 1px white; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); + -box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); } + .openerp2 .oe_secondary_submenu .oe_menu_toggler:before { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-left: -8px; + margin-top: 4px; + margin-right: 4px; + border-top: 4px solid transparent; + border-bottom: 4px solid transparent; + border-left: 4px solid #4c4c4c; + filter: alpha(opacity=50); + opacity: 0.5; } + .openerp2 .oe_secondary_submenu .oe_menu_opened:before { + margin-top: 6px; + margin-left: -12px; + margin-right: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid #4c4c4c; } + .openerp2 .oe_user_menu { + float: right; + padding: 0; + margin: 0; } + .openerp2 .oe_user_menu li { + list-style-type: none; + float: left; } + .openerp2 .oe_user_menu .oe_dropdown { + position: relative; } + .openerp2 .oe_user_menu .oe_dropdown_toggle:after { + width: 0; + height: 0; + display: inline-block; + content: "&darr"; + text-indent: -99999px; + vertical-align: top; + margin-top: 8px; + margin-left: 4px; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 4px solid white; + filter: alpha(opacity=50); + opacity: 0.5; } + .openerp2 .oe_user_menu .oe_dropdown_options { + float: left; + background: #333333; + background: rgba(37, 37, 37, 0.9); + display: none; + position: absolute; + top: 32px; + right: -1px; + border: 0; + z-index: 900; + margin-left: 0; + margin-right: 0; + padding: 6px 0; + zoom: 1; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + border-style: solid; + border-width: 0 1px 1px; + -moz-border-radius: 0 0 6px 6px; + -webkit-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; } + .openerp2 .oe_user_menu .oe_dropdown_options li { + float: none; + display: block; + background-color: none; } + .openerp2 .oe_user_menu .oe_dropdown_options li a { + display: block; + padding: 4px 15px; + clear: both; + font-weight: normal; + line-height: 18px; + color: #eeeeee; } + .openerp2 .oe_user_menu .oe_dropdown_options li a:hover { + background-color: #292929; + background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); + background-image: -webkit-linear-gradient(top, #292929, #191919); + background-image: -moz-linear-gradient(top, #292929, #191919); + background-image: -ms-linear-gradient(top, #292929, #191919); + background-image: -o-linear-gradient(top, #292929, #191919); + background-image: linear-gradient(to bottom, #292929, #191919); + -moz-box-shadow: none; + -webkit-box-shadow: none; + -box-shadow: none; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 92b8101f2b7..56a735c98fd 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -78,6 +78,15 @@ $colour4: #8a89ba right: 0 // }}} + // Fullscreen mode {{{ + .oe_content_full_screen + .oe_application + top: 0 + left: 0 + .topbar, .leftbar + display: none + // }} + // Topbar {{{ .oe_topbar width: 100% -- cgit v1.2.3 From 66e1ce8606643eb0490584356f2d7b60cfffd3e6 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 8 Mar 2012 11:21:51 +0100 Subject: [FIX] Missing date.js CultureInfo's am/pm descriptor causes wrong dates to be sent to server without user's knowledge lp bug: https://launchpad.net/bugs/938497 fixed bzr revid: fme@openerp.com-20120308102151-eyr71rzk345f6xji --- addons/web/static/src/js/core.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index 106d2b86dc9..49840e5aba8 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -744,6 +744,14 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp. var file_list = ["/web/static/lib/datejs/globalization/" + lang.replace("_", "-") + ".js"]; return self.rpc('/web/webclient/jslist', {mods: to_load}).pipe(function(files) { return self.do_load_js(file_list.concat(files)); + }).then(function () { + if (!Date.CultureInfo.pmDesignator) { + // If no am/pm designator is specified but the openerp + // datetime format uses %i, date.js won't be able to + // correctly format a date. See bug#938497. + Date.CultureInfo.amDesignator = 'AM'; + Date.CultureInfo.pmDesignator = 'PM'; + } }); })) } -- cgit v1.2.3 From 284e19c29e3338670e95045c316cf9612ff39334 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 8 Mar 2012 15:06:36 +0100 Subject: [FIX] BinaryImage field: check if value is bin_size or not bzr revid: fme@openerp.com-20120308140636-qk2ekrmqlqpaa7uo --- addons/web/static/src/js/view_form.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index d4a090eafcc..4866d88dd15 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3314,10 +3314,17 @@ openerp.web.form.FieldBinaryImage = openerp.web.form.FieldBinary.extend({ this.$element.find('.oe-binary').toggle(!this.readonly); }, set_value: function(value) { + console.log(value) this._super.apply(this, arguments); this.set_image_maxwidth(); - var url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' + - this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + '&t=' + (new Date().getTime()); + + var url; + if (value && value.substr(0, 10).indexOf(' ') == -1) { + url = 'data:image/png;base64,' + this.value; + } else { + url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' + + this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + '&t=' + (new Date().getTime()); + } this.$image.attr('src', url); }, set_image_maxwidth: function() { -- cgit v1.2.3 From ec8c17161c4412bd3402d80454e78cc60d3dbb8e Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 12 Mar 2012 16:37:43 +0100 Subject: [REM] Removed forgotten console.log bzr revid: fme@openerp.com-20120312153743-i6qi3fzmondezrdh --- addons/web/static/src/js/view_form.js | 1 - 1 file changed, 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 4866d88dd15..a5af970c5ef 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3314,7 +3314,6 @@ openerp.web.form.FieldBinaryImage = openerp.web.form.FieldBinary.extend({ this.$element.find('.oe-binary').toggle(!this.readonly); }, set_value: function(value) { - console.log(value) this._super.apply(this, arguments); this.set_image_maxwidth(); -- cgit v1.2.3 From 89061adc7d8b6af9632cda42ea96dbabad050807 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 13 Mar 2012 16:37:07 +0100 Subject: [imp] possible problem with debug & qweb bzr revid: nicolas.vanhoren@openerp.com-20120313153707-zi6kdlbxz72dit7l --- addons/web/static/src/js/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index f464bded13b..a962d205c1c 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1300,7 +1300,7 @@ openerp.web._lt = function (s) { return {toString: function () { return openerp.web._t(s); }} }; openerp.web.qweb = new QWeb2.Engine(); -openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1); +openerp.web.qweb.debug = ($.deparam($.param.querystring()).debug != undefined); openerp.web.qweb.default_dict = { '_' : _, '_t' : openerp.web._t -- cgit v1.2.3 From 4e7796cfeea94e3225fed1c9b99f4f25afe6cd6a Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Tue, 13 Mar 2012 17:37:19 +0100 Subject: [imp] added some stuff to manage interfaces bzr revid: nicolas.vanhoren@openerp.com-20120313163719-ez4n7ca4qxus0m9t --- addons/web/static/src/js/core.js | 17 +++++++++++ addons/web/static/src/js/view_form.js | 53 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/core.js b/addons/web/static/src/js/core.js index a962d205c1c..650939c843c 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -1335,6 +1335,23 @@ openerp.web.qweb.preprocess_node = function() { } }; +/** + * A small utility function to check if a class implements correctly an interface, assuming that + * interface is simply specified using a dictionary containing methods and attributes with the + * correct type. It only performs the check when in debug mode and the only effect of an invalid + * check is messages in the console. + */ +openerp.web.check_interface = function(_class, _interface) { + if (! openerp.web.check_interface.debug) + return; + for (var member in _interface) { + if ( (typeof _class.prototype[member] != typeof _interface[member]) ) { + console.error("class failed to implement interface member '" + member + "'"); + } + } +} +openerp.web.check_interface.debug = ($.deparam($.param.querystring()).debug != undefined); + /** Jquery extentions */ $.Mutex = (function() { function Mutex() { diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a5af970c5ef..3ecc35d677f 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1359,6 +1359,58 @@ openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({ } }); +/** + * Interface to be implemented by fields. + * + * Novajs Attributes: + * - ... + * + * Novajs Events: + * - ... + * + */ +openerp.web.form.FieldInterface = { + /** + * Called by the form view to indicate the value of the field. + * + * set_value() may return an object that can be passed to $.when() that represents the moment when + * the field has finished all operations necessary before the user can effectively use the widget. + * + * Multiple calls to set_value() can occur at any time and must be handled correctly by the implementation, + * regardless of any asynchronous operation currently running and the status of any promise that a + * previous call to set_value() could have returned. + * + * set_value() must be able, at any moment, to handle the syntax returned by the "read" method of the + * osv class in the OpenERP server as well as the syntax used by the set_value() (see below). It must + * also be able to handle any other format commonly used in the _defaults key on the models in the addons + * as well as any format commonly returned in a on_change. It must be able to autodetect those formats as + * no information is ever given to know which format is used. + */ + set_value: function(value) {}, + /** + * Get the current value of the widget. + * + * Must always return a syntaxically correct value to be passed to the "write" method of the osv class in + * the OpenERP server, although it is not assumed to respect the constraints applied to the field. + * For example if the field is marqued as "required", a call to get_value() can return false. + * + * get_value() can also be called *before* a call to set_value() and, in that case, is supposed to + * return a defaut value according to the type of field. + * + * This method is always assumed to perform synchronously, it can not return a promise. + * + * If there was no user interaction to modify the value of the field, it is always assumed that + * get_value() return the same semantic value than the one passed in the last call to set_value(), + * altough the syntax can be different. This can be the case for type of fields that have a different + * syntax for "read" and "write" (example: m2o: set_value([0, "Administrator"]), get_value() => 0). + */ + get_value: function() {}, +}; + +/** + * Abstract class for classes implementing FieldInterface. Should be renamed to AbstractField some + * day. + */ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.form.Field# */{ /** * @constructs openerp.web.form.Field @@ -2237,6 +2289,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ this.$input.prop('readonly', this.readonly); } }); +openerp.web.check_interface(openerp.web.form.FieldMany2One, openerp.web.form.FieldInterface); /* # Values: (0, 0, { fields }) create -- cgit v1.2.3 From 6a38a66d50154d5da6062a10dfe541771c3610ef Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 14 Mar 2012 12:10:14 +0100 Subject: [FIX] BufferedDataSet: avoid randomizing results when there are no sort_fields Array.sort is not necessarily stable, and sorting an array with an unstable sort will cause a randomization of the original order, which should have been preserved. See also: - http://ecma262-5.com/ELS5_Section_15.htm#Section_15.4.4.11 - http://code.google.com/p/v8/issues/detail?id=90 lp bug: https://launchpad.net/bugs/928389 fixed bzr revid: odo@openerp.com-20120314111014-1igxhrynu5557di5 --- addons/web/static/src/js/data.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 8e200951eaa..d9cfc5c4002 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -741,18 +741,25 @@ openerp.web.BufferedDataSet = openerp.web.DataSetStatic.extend({ : (v1 > v2) ? 1 : 0; }; - records.sort(function (a, b) { - return _.reduce(sort_fields, function (acc, field) { - if (acc) { return acc; } - - var sign = 1; - if (field[0] === '-') { - sign = -1; - field = field.slice(1); - } - return sign * compare(a[field], b[field]); - }, 0); - }); + // Array.sort is not necessarily stable. We must be careful with this because + // sorting an array where all items are considered equal is a worst-case that + // will randomize the array with an unstable sort! Therefore we must avoid + // sorting if there are no sort_fields (i.e. all items are considered equal) + // See also: http://ecma262-5.com/ELS5_Section_15.htm#Section_15.4.4.11 + // http://code.google.com/p/v8/issues/detail?id=90 + if (sort_fields.length) { + records.sort(function (a, b) { + return _.reduce(sort_fields, function (acc, field) { + if (acc) { return acc; } + var sign = 1; + if (field[0] === '-') { + sign = -1; + field = field.slice(1); + } + return sign * compare(a[field], b[field]); + }, 0); + }); + } completion.resolve(records); }; if(to_get.length > 0) { -- cgit v1.2.3 From 08b4442e081a2ce7abb209ea7b2a70a781879699 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 20 Mar 2012 11:56:01 +0100 Subject: [FIX] align image widget (same behavior as 6.0) bzr revid: chs@openerp.com-20120320105601-gpp0315e8637zpsw --- addons/web/static/src/xml/base.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1a2f80df8b3..a0643105055 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1128,7 +1128,7 @@
      - +