From 7a9ca47e214d662360e8e5f3a00bb21a10e375d2 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Tue, 18 Jun 2013 17:31:54 +0530 Subject: [FIX]Fixed the issue of save selected fields list in export. bzr revid: msh@openerp.com-20130618120154-o0cj17snpn00mh38 --- addons/web/static/src/js/data_export.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index fb5e391effd..31a750e787e 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -101,6 +101,7 @@ instance.web.DataExport = instance.web.Dialog.extend({ if (select_exp.val()) { self.exports.unlink([parseInt(select_exp.val(), 10)]); select_exp.remove(); + self.$el.find("#fields_list option").remove(); if (self.$el.find('#saved_export_list option').length <= 1) { self.$el.find('#ExistsExportList').hide(); } @@ -148,18 +149,17 @@ instance.web.DataExport = instance.web.Dialog.extend({ export_fields: _(fields).map(function (field) { return [0, 0, {name: field}]; }) - }, function (export_list_id) { - if (!export_list_id.result) { + }).then(function (export_list_id) { + if (!export_list_id) { return; } - self.$el.find("#saved_export_list").append( - new Option(value, export_list_id.result)); - if (self.$el.find("#saved_export_list").is(":hidden")) { + if (!self.$el.find("#saved_export_list").length || self.$el.find("#saved_export_list").is(":hidden")) { self.show_exports_list(); } + self.$el.find("#saved_export_list").append( + new Option(value, export_list_id)); }); this.on_show_save_list(); - this.$el.find("#fields_list option").remove(); }, on_click: function(id, record) { var self = this; -- cgit v1.2.3 From 2e3ec5e2e92b76703eecb76d31c085157aba5b98 Mon Sep 17 00:00:00 2001 From: Mohammed Shekha Date: Wed, 3 Jul 2013 18:42:23 +0530 Subject: [FIX]Fixed the issue of last element of grouped row removed, due to which grouped total information also got lost. bzr revid: msh@openerp.com-20130703131223-bwu6hl8v5y5sjt5w --- addons/web/static/src/js/view_list.js | 3 ++- 1 file changed, 2 insertions(+), 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 74c2fc47aee..a9f110eac28 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1280,7 +1280,8 @@ instance.web.ListView.Groups = instance.web.Class.extend( /** @lends instance.we } }, close: function () { - this.$row.children().last().empty(); + this.$row.children().last().find('button').remove(); + this.$row.children().last().find('span').remove(); this.records.reset(); }, /** -- cgit v1.2.3 From e578e2af784cb3af11ceae7d07cc07c7036a85e9 Mon Sep 17 00:00:00 2001 From: "Mohammed Shekha (OpenERP)" Date: Thu, 17 Oct 2013 18:32:17 +0530 Subject: [FIX]Fix the issue of page navigation when all records of current page are deleted, currently it does not go to previous page instead displays blank list, expected behavior: it should navigated to previous page when all records of the current page deleted. bzr revid: msh@openerp.com-20131017130217-dtpukpq27fdmsvd9 --- addons/web/static/src/js/view_list.js | 8 +++++++- 1 file changed, 7 insertions(+), 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 74c2fc47aee..dd8b62ae619 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -593,7 +593,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi _(ids).each(function (id) { self.records.remove(self.records.get(id)); }); - self.configure_pager(self.dataset); + if (self.records.length == 0 && self.page > 0) { + //Trigger previous manually to navigate to previous page, + //If all records are deleted on current page. + self.$pager.find('ul li:first a').trigger('click'); + } else { + self.configure_pager(self.dataset); + } self.compute_aggregates(); }); }, -- cgit v1.2.3 From fa9f3676879d1978b2e8d025533777d6b5bb41b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 18 Oct 2013 15:22:59 +0200 Subject: [IMP] form_view: statusbar improvements It now uses the bar_fold field instead of the fold field to hide the stage. It now uses bar_color to personnalize the stage. Added css for oe_bar_1 (still WIP, just for testing purpose) bzr revid: tde@openerp.com-20131018132259-2kip8723ibr296ri --- addons/web/static/src/css/base.css | 83 ++++++++++++++++++++++++----------- addons/web/static/src/css/base.sass | 27 +++++++++--- addons/web/static/src/js/view_form.js | 20 ++++++--- addons/web/static/src/xml/base.xml | 12 ++--- 4 files changed, 98 insertions(+), 44 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 5420462cbf1..583754f947b 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2717,6 +2717,7 @@ width: 24px; height: 24px; display: inline-block; + z-index: 1; margin-left: -12px; margin-top: 3px; box-shadow: -1px 1px 2px rgba(255, 255, 255, 0.2), inset -1px 1px 1px rgba(0, 0, 0, 0.2); @@ -2750,24 +2751,54 @@ padding-left: 14px; } .openerp ul.oe_form_status li.oe_active, .openerp ul.oe_form_status_clickable li.oe_active { - background-color: #5382b9; - background-image: -webkit-gradient(linear, left top, left bottom, from(#729fcf), to(#3465a4)); - background-image: -webkit-linear-gradient(top, #729fcf, #3465a4); - background-image: -moz-linear-gradient(top, #729fcf, #3465a4); - background-image: -ms-linear-gradient(top, #729fcf, #3465a4); - background-image: -o-linear-gradient(top, #729fcf, #3465a4); - background-image: linear-gradient(to bottom, #729fcf, #3465a4); + background-color: #868686; + background-image: -webkit-gradient(linear, left top, left bottom, from(#9c9c9c), to(#707070)); + background-image: -webkit-linear-gradient(top, #9c9c9c, #707070); + background-image: -moz-linear-gradient(top, #9c9c9c, #707070); + background-image: -ms-linear-gradient(top, #9c9c9c, #707070); + background-image: -o-linear-gradient(top, #9c9c9c, #707070); + background-image: linear-gradient(to bottom, #9c9c9c, #707070); } .openerp ul.oe_form_status li.oe_active > .arrow span, .openerp ul.oe_form_status_clickable li.oe_active > .arrow span { - background-color: #3465a4; - background: -moz-linear-gradient(135deg, #3465a4, #729fcf); - background: -o-linear-gradient(135deg, #729fcf, #3465a4); - background: -webkit-gradient(linear, left top, right bottom, from(#729fcf), to(#3465a4)); - background: -ms-linear-gradient(top, #729fcf, #3465a4); + background-color: #707070; + background: -moz-linear-gradient(135deg, #707070, #9c9c9c); + background: -o-linear-gradient(135deg, #9c9c9c, #707070); + background: -webkit-gradient(linear, left top, right bottom, from(#9c9c9c), to(#707070)); + background: -ms-linear-gradient(top, #9c9c9c, #707070); } .openerp ul.oe_form_status li.oe_active > .label, .openerp ul.oe_form_status_clickable li.oe_active > .label { color: white; - text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4; + text-shadow: 0 1px 1px #9c9c9c, 0 -1px 1px #707070; +} +.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active), .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) { + background: #dc5f59; + background-color: #c02c2c; + background-image: -webkit-gradient(linear, left top, left bottom, from(#df3f3f), to(#a21a1a)); + background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -moz-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -ms-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -o-linear-gradient(top, #df3f3f, #a21a1a); + background-image: linear-gradient(to bottom, #df3f3f, #a21a1a); + -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 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; +} +.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active) > .arrow span, .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) > .arrow span { + background: #dc5f59; + background-color: #c02c2c; + background-image: -webkit-gradient(linear, left top, left bottom, from(#df3f3f), to(#a21a1a)); + background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -moz-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -ms-linear-gradient(top, #df3f3f, #a21a1a); + background-image: -o-linear-gradient(top, #df3f3f, #a21a1a); + background-image: linear-gradient(to bottom, #df3f3f, #a21a1a); + -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 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; +} +.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active) > .label, .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) > .label { + color: white; + text-shadow: none; } .openerp ul.oe_form_status_clickable li { cursor: pointer; @@ -2797,23 +2828,23 @@ color: #7c7bad; } .openerp ul.oe_form_status_clickable li.oe_active:hover { - background-color: #3a699f; - background-image: -webkit-gradient(linear, left top, left bottom, from(#4c85c2), to(#284d7d)); - background-image: -webkit-linear-gradient(top, #4c85c2, #284d7d); - background-image: -moz-linear-gradient(top, #4c85c2, #284d7d); - background-image: -ms-linear-gradient(top, #4c85c2, #284d7d); - background-image: -o-linear-gradient(top, #4c85c2, #284d7d); - background-image: linear-gradient(to bottom, #4c85c2, #284d7d); + background-color: #6d6d6d; + background-image: -webkit-gradient(linear, left top, left bottom, from(#838383), to(#575757)); + background-image: -webkit-linear-gradient(top, #838383, #575757); + background-image: -moz-linear-gradient(top, #838383, #575757); + background-image: -ms-linear-gradient(top, #838383, #575757); + background-image: -o-linear-gradient(top, #838383, #575757); + background-image: linear-gradient(to bottom, #838383, #575757); } .openerp ul.oe_form_status_clickable li.oe_active:hover > .label { - text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4; + text-shadow: 0 -1px 1px #9c9c9c, 0 1px 1px #707070; } .openerp ul.oe_form_status_clickable li.oe_active:hover > .arrow span { - background-color: #284d7d; - background: -moz-linear-gradient(135deg, #284d7d, #4c85c2); - background: -o-linear-gradient(135deg, #4c85c2, #284d7d); - background: -webkit-gradient(linear, left top, right bottom, from(#4c85c2), to(#284d7d)); - background: -ms-linear-gradient(top, #4c85c2, #284d7d); + background-color: #575757; + background: -moz-linear-gradient(135deg, #575757, #838383); + background: -o-linear-gradient(135deg, #838383, #575757); + background: -webkit-gradient(linear, left top, right bottom, from(#838383), to(#575757)); + background: -ms-linear-gradient(top, #838383, #575757); } .openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page { display: none; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 5900eb9d268..0a94fb21f33 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2166,6 +2166,7 @@ $sheet-padding: 16px width: 24px height: 24px display: inline-block + z-index: 1 margin-left: -12px margin-top: 3px box-shadow: -1px 1px 2px rgba(255,255,255,0.2), inset -1px 1px 1px rgba(0,0,0,0.2) @@ -2185,12 +2186,26 @@ $sheet-padding: 16px padding-left: 14px li.oe_active - @include vertical-gradient(#729fcf, #3465a4) + @include vertical-gradient(#9c9c9c, #707070) > .arrow span - @include skew-gradient(#729fcf, #3465a4) + @include skew-gradient(#9c9c9c, #707070) > .label color: white - text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4 + text-shadow: 0 1px 1px #9c9c9c, 0 -1px 1px #707070 + + li.oe_bar_1:not(.oe_active) + background: #DC5F59 + @include vertical-gradient(#df3f3f, #a21a1a) + @include box-shadow((0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset)) + > .arrow + span + background: #DC5F59 + @include vertical-gradient(#df3f3f, #a21a1a) + @include box-shadow((0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset)) + > .label + color: white + text-shadow: none + ul.oe_form_status_clickable li cursor: pointer @@ -2204,11 +2219,11 @@ $sheet-padding: 16px color: $link-color li.oe_active &:hover - @include vertical-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%)) + @include vertical-gradient(darken(#9c9c9c, 10%), darken(#707070, 10%)) > .label - text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4 + text-shadow: 0 -1px 1px #9c9c9c, 0 1px 1px #707070 > .arrow span - @include skew-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%)) + @include skew-gradient(darken(#9c9c9c, 10%), darken(#707070, 10%)) // }}} // FormView.one2many {{{ .oe_form .oe_form_field_one2many > .oe_view_manager diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index bcea1bf5bbe..6f19455fc0b 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5522,16 +5522,24 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ if (this.field.type == "many2one") { return self.get_distant_fields().then(function(fields) { return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) - .read_slice(fields.fold ? ['fold'] : ['id'], {}).then(function (records) { + .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { + console.log(records); + var ids = _.pluck(records, 'id'); - var ids = _.map(records, function (val) {return val.id;}); + // var ids = _.map(records, function (val) {return val.id;}); return self.dataset.name_get(ids).then(function (records_name) { _.each(records, function (record) { var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; - if (record.fold && record.id != self.get('value')) { - selection_folded.push([record.id, name]); + var widget_item = { + 'id': record.id, + 'name': name, + 'bar_color': record.bar_color || 0, + 'bar_fold': record.bar_fold || false, + } + if (record.bar_fold && record.id != self.get('value')) { + selection_folded.push(widget_item); } else { - selection_unfolded.push([record.id, name]); + selection_unfolded.push(widget_item); } }); }); @@ -5563,7 +5571,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ if (this.distant_fields) { return $.when(this.distant_fields); } - return new instance.web.Model(self.field.relation).call("fields_get", [["fold"]]).then(function(fields) { + return new instance.web.Model(self.field.relation).call("fields_get", [["bar_fold", "bar_color"]]).then(function(fields) { self.distant_fields = fields; return fields; }); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 6cbc3fb5692..f60f8d1c6d8 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1220,9 +1220,9 @@
    - -
  • - + +
  • +
  • @@ -1231,9 +1231,9 @@
  • More
      - -
    • - + +
    • +
    -- cgit v1.2.3 From a28c14a8ccfd09dc07e2bcc606daac629097e9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 21 Oct 2013 12:47:08 +0200 Subject: [REV] StatusField: reverted changes about bar widget color and thing slike that. bzr revid: tde@openerp.com-20131021104708-vrax9zhpjwyjq6ns --- addons/web/static/src/css/base.css | 83 +++++++++++------------------------ addons/web/static/src/css/base.sass | 27 +++--------- addons/web/static/src/js/view_form.js | 1 - addons/web/static/src/xml/base.xml | 2 +- 4 files changed, 33 insertions(+), 80 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 583754f947b..5420462cbf1 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2717,7 +2717,6 @@ width: 24px; height: 24px; display: inline-block; - z-index: 1; margin-left: -12px; margin-top: 3px; box-shadow: -1px 1px 2px rgba(255, 255, 255, 0.2), inset -1px 1px 1px rgba(0, 0, 0, 0.2); @@ -2751,54 +2750,24 @@ padding-left: 14px; } .openerp ul.oe_form_status li.oe_active, .openerp ul.oe_form_status_clickable li.oe_active { - background-color: #868686; - background-image: -webkit-gradient(linear, left top, left bottom, from(#9c9c9c), to(#707070)); - background-image: -webkit-linear-gradient(top, #9c9c9c, #707070); - background-image: -moz-linear-gradient(top, #9c9c9c, #707070); - background-image: -ms-linear-gradient(top, #9c9c9c, #707070); - background-image: -o-linear-gradient(top, #9c9c9c, #707070); - background-image: linear-gradient(to bottom, #9c9c9c, #707070); + background-color: #5382b9; + background-image: -webkit-gradient(linear, left top, left bottom, from(#729fcf), to(#3465a4)); + background-image: -webkit-linear-gradient(top, #729fcf, #3465a4); + background-image: -moz-linear-gradient(top, #729fcf, #3465a4); + background-image: -ms-linear-gradient(top, #729fcf, #3465a4); + background-image: -o-linear-gradient(top, #729fcf, #3465a4); + background-image: linear-gradient(to bottom, #729fcf, #3465a4); } .openerp ul.oe_form_status li.oe_active > .arrow span, .openerp ul.oe_form_status_clickable li.oe_active > .arrow span { - background-color: #707070; - background: -moz-linear-gradient(135deg, #707070, #9c9c9c); - background: -o-linear-gradient(135deg, #9c9c9c, #707070); - background: -webkit-gradient(linear, left top, right bottom, from(#9c9c9c), to(#707070)); - background: -ms-linear-gradient(top, #9c9c9c, #707070); + background-color: #3465a4; + background: -moz-linear-gradient(135deg, #3465a4, #729fcf); + background: -o-linear-gradient(135deg, #729fcf, #3465a4); + background: -webkit-gradient(linear, left top, right bottom, from(#729fcf), to(#3465a4)); + background: -ms-linear-gradient(top, #729fcf, #3465a4); } .openerp ul.oe_form_status li.oe_active > .label, .openerp ul.oe_form_status_clickable li.oe_active > .label { color: white; - text-shadow: 0 1px 1px #9c9c9c, 0 -1px 1px #707070; -} -.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active), .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) { - background: #dc5f59; - background-color: #c02c2c; - background-image: -webkit-gradient(linear, left top, left bottom, from(#df3f3f), to(#a21a1a)); - background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -moz-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -ms-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -o-linear-gradient(top, #df3f3f, #a21a1a); - background-image: linear-gradient(to bottom, #df3f3f, #a21a1a); - -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 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; -} -.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active) > .arrow span, .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) > .arrow span { - background: #dc5f59; - background-color: #c02c2c; - background-image: -webkit-gradient(linear, left top, left bottom, from(#df3f3f), to(#a21a1a)); - background-image: -webkit-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -moz-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -ms-linear-gradient(top, #df3f3f, #a21a1a); - background-image: -o-linear-gradient(top, #df3f3f, #a21a1a); - background-image: linear-gradient(to bottom, #df3f3f, #a21a1a); - -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 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; -} -.openerp ul.oe_form_status li.oe_bar_1:not(.oe_active) > .label, .openerp ul.oe_form_status_clickable li.oe_bar_1:not(.oe_active) > .label { - color: white; - text-shadow: none; + text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4; } .openerp ul.oe_form_status_clickable li { cursor: pointer; @@ -2828,23 +2797,23 @@ color: #7c7bad; } .openerp ul.oe_form_status_clickable li.oe_active:hover { - background-color: #6d6d6d; - background-image: -webkit-gradient(linear, left top, left bottom, from(#838383), to(#575757)); - background-image: -webkit-linear-gradient(top, #838383, #575757); - background-image: -moz-linear-gradient(top, #838383, #575757); - background-image: -ms-linear-gradient(top, #838383, #575757); - background-image: -o-linear-gradient(top, #838383, #575757); - background-image: linear-gradient(to bottom, #838383, #575757); + background-color: #3a699f; + background-image: -webkit-gradient(linear, left top, left bottom, from(#4c85c2), to(#284d7d)); + background-image: -webkit-linear-gradient(top, #4c85c2, #284d7d); + background-image: -moz-linear-gradient(top, #4c85c2, #284d7d); + background-image: -ms-linear-gradient(top, #4c85c2, #284d7d); + background-image: -o-linear-gradient(top, #4c85c2, #284d7d); + background-image: linear-gradient(to bottom, #4c85c2, #284d7d); } .openerp ul.oe_form_status_clickable li.oe_active:hover > .label { - text-shadow: 0 -1px 1px #9c9c9c, 0 1px 1px #707070; + text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4; } .openerp ul.oe_form_status_clickable li.oe_active:hover > .arrow span { - background-color: #575757; - background: -moz-linear-gradient(135deg, #575757, #838383); - background: -o-linear-gradient(135deg, #838383, #575757); - background: -webkit-gradient(linear, left top, right bottom, from(#838383), to(#575757)); - background: -ms-linear-gradient(top, #838383, #575757); + background-color: #284d7d; + background: -moz-linear-gradient(135deg, #284d7d, #4c85c2); + background: -o-linear-gradient(135deg, #4c85c2, #284d7d); + background: -webkit-gradient(linear, left top, right bottom, from(#4c85c2), to(#284d7d)); + background: -ms-linear-gradient(top, #4c85c2, #284d7d); } .openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page { display: none; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 0a94fb21f33..5900eb9d268 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2166,7 +2166,6 @@ $sheet-padding: 16px width: 24px height: 24px display: inline-block - z-index: 1 margin-left: -12px margin-top: 3px box-shadow: -1px 1px 2px rgba(255,255,255,0.2), inset -1px 1px 1px rgba(0,0,0,0.2) @@ -2186,26 +2185,12 @@ $sheet-padding: 16px padding-left: 14px li.oe_active - @include vertical-gradient(#9c9c9c, #707070) + @include vertical-gradient(#729fcf, #3465a4) > .arrow span - @include skew-gradient(#9c9c9c, #707070) + @include skew-gradient(#729fcf, #3465a4) > .label color: white - text-shadow: 0 1px 1px #9c9c9c, 0 -1px 1px #707070 - - li.oe_bar_1:not(.oe_active) - background: #DC5F59 - @include vertical-gradient(#df3f3f, #a21a1a) - @include box-shadow((0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset)) - > .arrow - span - background: #DC5F59 - @include vertical-gradient(#df3f3f, #a21a1a) - @include box-shadow((0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(155, 155, 155, 0.4) inset)) - > .label - color: white - text-shadow: none - + text-shadow: 0 1px 1px #729fcf, 0 -1px 1px #3465a4 ul.oe_form_status_clickable li cursor: pointer @@ -2219,11 +2204,11 @@ $sheet-padding: 16px color: $link-color li.oe_active &:hover - @include vertical-gradient(darken(#9c9c9c, 10%), darken(#707070, 10%)) + @include vertical-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%)) > .label - text-shadow: 0 -1px 1px #9c9c9c, 0 1px 1px #707070 + text-shadow: 0 -1px 1px #729fcf, 0 1px 1px #3465a4 > .arrow span - @include skew-gradient(darken(#9c9c9c, 10%), darken(#707070, 10%)) + @include skew-gradient(darken(#729fcf, 10%), darken(#3465a4, 10%)) // }}} // FormView.one2many {{{ .oe_form .oe_form_field_one2many > .oe_view_manager diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 6f19455fc0b..0ca5f39e387 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5523,7 +5523,6 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ return self.get_distant_fields().then(function(fields) { return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { - console.log(records); var ids = _.pluck(records, 'id'); // var ids = _.map(records, function (val) {return val.id;}); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index f60f8d1c6d8..4dc26e84e0a 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1221,7 +1221,7 @@ -
  • +
  • -- cgit v1.2.3 From 2d78686db75c390cec4db191ddea45fce0cef629 Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Mon, 21 Oct 2013 19:20:04 +0530 Subject: [REF]: Refector many2many_tags bzr revid: aja@tinyerp.com-20131021135004-rmxft7jrvbixhekx --- addons/web/static/src/js/view_form.js | 52 +++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 17 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 7a0890bdcfa..8bff844a540 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -4216,6 +4216,7 @@ var lazy_build_o2m_kanban_view = function() { instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(instance.web.form.CompletionFieldMixin, instance.web.form.ReinitializeFieldMixin, { template: "FieldMany2ManyTags", + tag_template: "FieldMany2ManyTag", init: function() { this._super.apply(this, arguments); instance.web.form.CompletionFieldMixin.init.call(this); @@ -4223,13 +4224,9 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in this._display_orderer = new instance.web.DropMisordered(); this._drop_shown = false; }, - initialize_content: function() { - if (this.get("effective_readonly")) - return; + initialize_texttext: function(){ var self = this; - var ignore_blur = false; - self.$text = this.$("textarea"); - self.$text.textext({ + return { plugins : 'tags arrow autocomplete', autocomplete: { render: function(suggestion) { @@ -4280,7 +4277,15 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in }, }, }, - }).bind('getSuggestions', function(e, data) { + } + }, + initialize_content: function() { + if (this.get("effective_readonly")) + return; + var self = this; + var ignore_blur = false; + self.$text = this.$("textarea"); + self.$text.textext(self.initialize_texttext()).bind('getSuggestions', function(e, data) { var _this = this; var str = !!data ? data.query || '' : ''; self.get_search_result(str).done(function(result) { @@ -4328,6 +4333,24 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in get_search_blacklist: function() { return this.get("value"); }, + map_tag: function(data){ + return _.map(data, function(el) {return {name: el[1], id:el[0]};}) + }, + get_render_data: function(ids){ + var self = this; + var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context()); + return dataset.name_get(ids); + }, + render_tag: function(data) { + var self = this; + if (! self.get("effective_readonly")) { + self.tags.containerElement().children().remove(); + self.$('textarea').css("padding-left", "3px"); + self.tags.addTags(self.map_tag(data)); + } else { + self.$el.html(QWeb.render(self.tag_template, {elements: data})); + } + }, render_value: function() { var self = this; var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context()); @@ -4340,17 +4363,12 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in indexed[el[0]] = el; }); data = _.map(values, function(el) { return indexed[el]; }); - if (! self.get("effective_readonly")) { - self.tags.containerElement().children().remove(); - self.$('textarea').css("padding-left", "3px"); - self.tags.addTags(_.map(data, function(el) {return {name: el[1], id:el[0]};})); - } else { - self.$el.html(QWeb.render("FieldMany2ManyTag", {elements: data})); - } - }; + self.render_tag(data); + } if (! values || values.length > 0) { - this._display_orderer.add(dataset.name_get(values)).done(handle_names); - } else { + this._display_orderer.add(self.get_render_data(values)).done(handle_names); + } + else{ handle_names([]); } }, -- cgit v1.2.3 From 833c1f207213bd742f229ddb0954096c1559494d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 23 Oct 2013 14:08:04 +0200 Subject: [IMP] view_form: fieldstatus: deprecated folded on widget bzr revid: tde@openerp.com-20131023120804-vx7etkzewkgx9sk0 --- addons/web/static/src/js/view_form.js | 47 +++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 22 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 707d1b8dcd8..bbaaa2c04f7 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5520,30 +5520,30 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ var calculation = _.bind(function() { if (this.field.type == "many2one") { - return self.get_distant_fields().then(function(fields) { - return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) - .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { - var ids = _.pluck(records, 'id'); - - // var ids = _.map(records, function (val) {return val.id;}); - return self.dataset.name_get(ids).then(function (records_name) { - _.each(records, function (record) { - var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; - var widget_item = { - 'id': record.id, - 'name': name, - 'bar_color': record.bar_color || 0, - 'bar_fold': record.bar_fold || false, - } - if (record.bar_fold && record.id != self.get('value')) { - selection_folded.push(widget_item); - } else { - selection_unfolded.push(widget_item); - } - }); + /* :deprecated: fold feature will probably be removed */ + // return self.get_distant_fields().then(function(fields) { + self.distant_fields = {}; + return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) + .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { + var ids = _.pluck(records, 'id'); + return self.dataset.name_get(ids).then(function (records_name) { + _.each(records, function (record) { + var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; + var widget_item = { + 'id': record.id, + 'name': name, + /* :deprecated: should probably be removed */ + 'bar_color': record.bar_color || 0, + 'bar_fold': record.bar_fold || false, + } + if (record.bar_fold && record.id != self.get('value')) { + selection_folded.push(widget_item); + } else { + selection_unfolded.push(widget_item); + } }); }); - }); + }); } else { // For field type selection filter values according to // statusbar_visible attribute of the field. For example: @@ -5565,6 +5565,9 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ } }); }, + /* + * :deprecated: this feature will probably be removed with OpenERP v8 + */ get_distant_fields: function() { var self = this; if (this.distant_fields) { -- cgit v1.2.3 From 4c460dfa4e65b68a59a52d0797d081331614ea54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 4 Nov 2013 12:59:09 +0100 Subject: [REV] Reverted most changes, to lessen the number of changed in a stable branch. bzr revid: tde@openerp.com-20131104115909-exhujer0lqqr4xk5 --- addons/web/static/src/js/view_form.js | 23 ++++++++--------------- addons/web/static/src/xml/base.xml | 12 ++++++------ 2 files changed, 14 insertions(+), 21 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 bbaaa2c04f7..c4e7733a70e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5527,22 +5527,15 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { var ids = _.pluck(records, 'id'); return self.dataset.name_get(ids).then(function (records_name) { - _.each(records, function (record) { - var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; - var widget_item = { - 'id': record.id, - 'name': name, - /* :deprecated: should probably be removed */ - 'bar_color': record.bar_color || 0, - 'bar_fold': record.bar_fold || false, - } - if (record.bar_fold && record.id != self.get('value')) { - selection_folded.push(widget_item); - } else { - selection_unfolded.push(widget_item); - } + _.each(records, function (record) { + var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; + if (record.fold && record.id != self.get('value')) { + selection_folded.push([record.id, name]); + } else { + selection_unfolded.push([record.id, name]); + } + }); }); - }); }); } else { // For field type selection filter values according to diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index ee3a429937c..28c8b08ced0 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1220,9 +1220,9 @@
      - -
    • - + +
    • +
    • @@ -1231,9 +1231,9 @@
    • More
        - -
      • - + +
      • +
      -- cgit v1.2.3 From 0ff21fc5e8fc687b22a4010e83460732b73fcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 4 Nov 2013 13:03:24 +0100 Subject: [REV] view_form: statusbar widget: indentation issue + reverted some more changes bzr revid: tde@openerp.com-20131104120324-2h2j6huhgwc134c9 --- addons/web/static/src/js/view_form.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 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 c4e7733a70e..8c5188620d8 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5527,15 +5527,15 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { var ids = _.pluck(records, 'id'); return self.dataset.name_get(ids).then(function (records_name) { - _.each(records, function (record) { - var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; - if (record.fold && record.id != self.get('value')) { - selection_folded.push([record.id, name]); - } else { - selection_unfolded.push([record.id, name]); - } - }); + _.each(records, function (record) { + var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; + if (record.fold && record.id != self.get('value')) { + selection_folded.push([record.id, name]); + } else { + selection_unfolded.push([record.id, name]); + } }); + }); }); } else { // For field type selection filter values according to @@ -5566,7 +5566,7 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ if (this.distant_fields) { return $.when(this.distant_fields); } - return new instance.web.Model(self.field.relation).call("fields_get", [["bar_fold", "bar_color"]]).then(function(fields) { + return new instance.web.Model(self.field.relation).call("fields_get", [["fold"]]).then(function(fields) { self.distant_fields = fields; return fields; }); -- cgit v1.2.3 From db7573384800fdea71bad45cd980237eeff5cccb Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 7 Nov 2013 12:20:17 +0100 Subject: [FIX] rare race condition in BufferedDataset lp bug: https://launchpad.net/bugs/1248531 fixed bzr revid: nicolas.vanhoren@openerp.com-20131107112017-7omd01ocvnbzx9m6 --- addons/web/static/src/js/data.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 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 f4e1b5a9c57..fe572dffbcb 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -780,6 +780,7 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ this._super.apply(this, arguments); this.reset_ids([]); this.last_default_get = {}; + this.running_reads = []; }, default_get: function(fields, options) { var self = this; @@ -846,6 +847,9 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ this.to_write = []; this.cache = []; this.delete_all = false; + _.each(_.clone(this.running_reads), function(el) { + el.reject(); + }); }, read_ids: function (ids, fields, options) { var self = this; @@ -861,7 +865,6 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ to_get.push(id); } }); - var completion = $.Deferred(); var return_records = function() { var records = _.map(ids, function(id) { return _.extend({}, _.detect(self.cache, function(c) {return c.id === id;}).values, {"id": id}); @@ -896,10 +899,20 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ }, 0); }); } - completion.resolve(records); + return $.when(records); }; if(to_get.length > 0) { - var rpc_promise = this._super(to_get, fields, options).done(function(records) { + var def = $.Deferred(); + self.running_reads.push(def); + def.always(function() { + self.running_reads = _.without(self.running_reads, def); + }); + this._super(to_get, fields, options).then(function() { + def.resolve.apply(def, arguments); + }, function() { + def.reject.apply(def, arguments); + }); + return def.then(function(records) { _.each(records, function(record, index) { var id = to_get[index]; var cached = _.detect(self.cache, function(x) {return x.id === id;}); @@ -910,13 +923,11 @@ instance.web.BufferedDataSet = instance.web.DataSetStatic.extend({ cached.values = _.defaults(_.clone(cached.values), record); } }); - return_records(); + return return_records(); }); - $.when(rpc_promise).fail(function() {completion.reject();}); } else { - return_records(); + return return_records(); } - return completion.promise(); }, /** * Invalidates caching of a record in the dataset to ensure the next read -- cgit v1.2.3 From a48e79335509f96f9dd386b8ca08f6f7de494f52 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 7 Nov 2013 15:32:12 +0100 Subject: [FIX] web: correct cookie parsing. avoid reading wrong cookie by matching the whole cookie name bzr revid: chs@openerp.com-20131107143212-50hrpvkaw3gxxlop --- addons/web/static/src/js/openerpframework.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js index 1d688505a06..9f3a6352511 100644 --- a/addons/web/static/src/js/openerpframework.js +++ b/addons/web/static/src/js/openerpframework.js @@ -1209,15 +1209,14 @@ openerp.TranslationDataBase = openerp.Class.extend(/** @lends instance.Translati openerp._t = new openerp.TranslationDataBase().build_translation_function(); openerp.get_cookie = function(c_name) { - if (document.cookie.length > 0) { - var c_start = document.cookie.indexOf(c_name + "="); - if (c_start != -1) { - c_start = c_start + c_name.length + 1; - var c_end = document.cookie.indexOf(";", c_start); - if (c_end == -1) { - c_end = document.cookie.length; - } - return unescape(document.cookie.substring(c_start, c_end)); + var cookies = document.cookie ? document.cookie.split('; ') : []; + for (var i = 0, l = cookies.length; i < l; i++) { + var parts = cookies[i].split('='); + var name = parts.shift(); + var cookie = parts.join('='); + + if (c_name && c_name === name) { + return cookie; } } return ""; -- cgit v1.2.3 From 5311db325cf62f38db906c3f769e035837e68ded Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 8 Nov 2013 17:06:27 +0100 Subject: [FIX] web: filter context before executing actions triggered by buttons in views bzr revid: chs@openerp.com-20131108160627-osiigir6tsr2k783 --- addons/web/static/src/js/views.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 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 ecdbaf8b465..6a181fc4dc7 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1354,7 +1354,17 @@ instance.web.View = instance.web.Widget.extend({ return self.getParent().on_action_executed.apply(null, arguments); } }; - var context = new instance.web.CompoundContext(dataset.get_context(), action_data.context || {}); + var context = dataset.get_context(); + if (action_data.model !== dataset.model) { + // filter out context keys that are specific to the action model. + // Wrong default_ and search_default values will no give the expected views + // Wrong group_by values will simply fail and forbid rendering of the destination view + context = _.object(_.reject(_.pairs(context.eval()), function(pair) { + return pair[0].match('^(?:(?:default_|search_default_).+|group_by|group_by_no_leaf)$') !== null; + })); + } + + context = new instance.web.CompoundContext(context, action_data.context || {}); var handler = function (action) { if (action && action.constructor == Object) { var ncontext = new instance.web.CompoundContext(context); -- cgit v1.2.3 From be7084b988c23df09c4eef40aa54e01eb73ed0a4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 8 Nov 2013 17:07:47 +0100 Subject: [FIX] web: do not declare variables inside if() scope bzr revid: chs@openerp.com-20131108160747-1jrpihb66y6vtov5 --- addons/web/static/src/js/views.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (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 6a181fc4dc7..1ee89238e7d 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1178,11 +1178,12 @@ instance.web.Sidebar = instance.web.Widget.extend({ var self = this; self.getParent().sidebar_eval_context().done(function (sidebar_eval_context) { var ids = self.getParent().get_selected_ids(); + var domain; if (self.getParent().get_active_domain) { - var domain = self.getParent().get_active_domain(); + domain = self.getParent().get_active_domain(); } else { - var domain = $.Deferred().resolve(undefined); + domain = $.Deferred().resolve(undefined); } if (ids.length === 0) { instance.web.dialog($("
      ").text(_t("You must choose at least one record.")), { title: _t("Warning"), modal: true }); -- cgit v1.2.3 From 8214e291a9eafeb39b61dd923dce00b3cce1dccc Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 31 Oct 2013 08:39:20 -0500 Subject: [FIX] web: correct date and datetime parsing. When creating a new Date object at a specific date, this date is treated as a UTC datetime then normalized to the browser timezone. This can lead to a change of Year/Month/Day depending of the chosen date. Using a date of a leap year date for date parsing and forcing UTC date for datetime parsing correct the month-switch errors in all timezones bzr revid: chs@openerp.com-20131031133920-yl5z4oz939smwvz8 --- addons/web/static/src/js/openerpframework.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js index 9f3a6352511..1704856886b 100644 --- a/addons/web/static/src/js/openerpframework.js +++ b/addons/web/static/src/js/openerpframework.js @@ -1264,7 +1264,10 @@ openerp.str_to_datetime = function(str) { if ( !res ) { throw new Error("'" + str + "' is not a valid datetime"); } - var tmp = new Date(0); + var tmp = new Date(2000,0,1); + tmp.setUTCMonth(1970); + tmp.setUTCMonth(0); + tmp.setUTCDate(1); tmp.setUTCFullYear(parseFloat(res[1])); tmp.setUTCMonth(parseFloat(res[2]) - 1); tmp.setUTCDate(parseFloat(res[3])); @@ -1296,7 +1299,7 @@ openerp.str_to_date = function(str) { if ( !res ) { throw new Error("'" + str + "' is not a valid date"); } - var tmp = new Date(0); + var tmp = new Date(2000,0,1); tmp.setFullYear(parseFloat(res[1])); tmp.setMonth(parseFloat(res[2]) - 1); tmp.setDate(parseFloat(res[3])); -- cgit v1.2.3 From 4476cd670112e2aff612e945d626ce03f28f3a6e Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Wed, 13 Nov 2013 16:21:07 +0100 Subject: [FIX] problem when clicking too fast on pagers in the form view lp bug: https://launchpad.net/bugs/1238569 fixed bzr revid: nicolas.vanhoren@openerp.com-20131113152107-5zwsbntil4wihoh4 --- addons/web/static/src/js/view_form.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 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 2cb318dcb17..94fc38faa23 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -399,9 +399,11 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.dataset.index = this.dataset.ids.length - 1; break; } - this.reload(); + var def = this.reload(); this.trigger('pager_action_executed'); + return def; } + return $.when(); }, init_pager: function() { var self = this; @@ -416,8 +418,15 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.$el.find('.oe_form_pager').replaceWith(this.$pager); } this.$pager.on('click','a[data-pager-action]',function() { - var action = $(this).data('pager-action'); - self.execute_pager_action(action); + var $el = $(this); + if ($el.attr("disabled")) + return; + var action = $el.data('pager-action'); + var def = $.when(self.execute_pager_action(action)); + $el.attr("disabled"); + def.always(function() { + $el.removeAttr("disabled"); + }); }); this.do_update_pager(); }, -- cgit v1.2.3 From 30e6eadf421565341f22baf2ff9d6130436df551 Mon Sep 17 00:00:00 2001 From: Gery Debongnie Date: Wed, 13 Nov 2013 11:22:04 +0100 Subject: [FIX] fixes a problem in pyeval catching all exceptions silently bzr revid: ged@openerp.com-20131113102204-m0gox7odwgkmon4o --- addons/web/static/src/js/pyeval.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js index 0b0e9725af9..b10c175c683 100644 --- a/addons/web/static/src/js/pyeval.js +++ b/addons/web/static/src/js/pyeval.js @@ -845,16 +845,18 @@ }; instance.web.pyeval.eval_domains_and_contexts = function (source) { return new $.Deferred(function (d) {setTimeout(function () { + var result; try { var contexts = ([instance.session.user_context] || []).concat(source.contexts); // see Session.eval_context in Python - d.resolve({ + result = { context: instance.web.pyeval.eval('contexts', contexts), domain: instance.web.pyeval.eval('domains', source.domains), group_by: instance.web.pyeval.eval('groupbys', source.group_by_seq || []) - }); + }; + } catch (e) { - d.resolve({ error: { + result = { error: { code: 400, message: instance.web._t("Evaluation Error"), data: { @@ -863,8 +865,9 @@ instance.web._t("Local evaluation failure\n%s\n\n%s"), e.message, JSON.stringify(source)) } - }}); + }}; } + d.resolve(result); }, 0); }); }; })(); -- cgit v1.2.3 From a3e4cdef515469a5988fe97b03bc89c58e9655f5 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 13 Nov 2013 16:19:11 +0100 Subject: [ADD] hacky abort() proxy for json requests bzr revid: xmo@openerp.com-20131113151911-l4f7vlzkcht38nuc --- addons/web/static/src/js/openerpframework.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js index e986a2f4112..a2e4c06d67d 100644 --- a/addons/web/static/src/js/openerpframework.js +++ b/addons/web/static/src/js/openerpframework.js @@ -809,7 +809,8 @@ var genericJsonRpc = function(fct_name, params, fct) { params: params, id: Math.floor(Math.random() * 1000 * 1000 * 1000) }; - return fct(data).pipe(function(result) { + var xhr = fct(data); + var result = xhr.pipe(function(result) { if (result.error !== undefined) { console.error("Server application error", result.error); return $.Deferred().reject("server", result.error); @@ -821,6 +822,9 @@ var genericJsonRpc = function(fct_name, params, fct) { var def = $.Deferred(); return def.reject.apply(def, ["communication"].concat(_.toArray(arguments))); }); + // FIXME: jsonp? + result.abort = function () { xhr.abort && xhr.abort(); }; + return result; }; openerp.jsonRpc = function(url, fct_name, params, settings) { -- cgit v1.2.3 From e9c633cb7e8053d63a31d1d1f375dc10347a0389 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 13 Nov 2013 19:40:00 +0100 Subject: [IMP] web: call call_kw with full route to help debugging bzr revid: chs@openerp.com-20131113184000-3k3dnwl5ftllq2rv --- addons/web/static/src/js/openerpframework.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/openerpframework.js b/addons/web/static/src/js/openerpframework.js index 1704856886b..99d11b58ca9 100644 --- a/addons/web/static/src/js/openerpframework.js +++ b/addons/web/static/src/js/openerpframework.js @@ -1128,7 +1128,8 @@ openerp.Model = openerp.Class.extend({ kwargs = args; args = []; } - return this.session().rpc('/web/dataset/call_kw', { + var call_kw = _.str.sprintf('/web/dataset/call_kw/%s/%s', this.name, method); + return this.session().rpc(call_kw, { model: this.name, method: method, args: args, -- cgit v1.2.3 From b61997e71671c7640ca3fe271804de46550c8502 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 14 Nov 2013 10:46:24 +0100 Subject: [FIX] web: correct url matching in tests bzr revid: chs@openerp.com-20131114094624-588lvc9vunwa99d8 --- addons/web/static/src/js/testing.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js index a7768f0ca24..f607b278437 100644 --- a/addons/web/static/src/js/testing.js +++ b/addons/web/static/src/js/testing.js @@ -58,8 +58,7 @@ openerp.testing = {}; } var fn, params; var needle = rparams.model + ':' + rparams.method; - if (url.url === '/web/dataset/call_kw' - && needle in this.responses) { + if (url.url.substr(0, 20) === '/web/dataset/call_kw' && needle in this.responses) { fn = this.responses[needle]; params = [ rparams.args || [], -- cgit v1.2.3 From bb9c83714ad9b194eca10901a0c3c5d4c2559c82 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 18 Nov 2013 11:21:12 +0100 Subject: [FIX] Avoid rpc errors on actions.act.url@target='self' bzr revid: fme@openerp.com-20131118102112-znm2mza36md6896n --- addons/web/static/src/js/views.js | 6 +++++- 1 file changed, 5 insertions(+), 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 ecdbaf8b465..2d05b5b41dc 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -510,7 +510,11 @@ instance.web.ActionManager = instance.web.Widget.extend({ }); }, ir_actions_act_url: function (action) { - window.open(action.url, action.target === 'self' ? '_self' : '_blank'); + if (action.target === 'self') { + instance.web.redirect(action.url); + } else { + window.open(action.url, '_blank'); + } return $.when(); }, }); -- cgit v1.2.3 From 9ded116baf006f9eb7a6674bf298ad9f185de6c5 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 18 Nov 2013 12:22:11 +0100 Subject: [ADD] return_label & return_url in action_manager#load_state for breadcrumb bzr revid: fme@openerp.com-20131118112211-q15p0d7cc8wpku5n --- addons/web/static/src/js/views.js | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (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 2d05b5b41dc..5e9cfa07399 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -147,6 +147,19 @@ instance.web.ActionManager = instance.web.Widget.extend({ this.inner_action = last_widget.action; } }, + add_breadcrumb_url: function (url, label) { + // Add a pseudo breadcrumb that will redirect to an url + this.push_breadcrumb({ + show: function(index) { + instance.web.redirect(url); + }, + hide: function() {}, + destroy: function() {}, + get_title: function() { + return label; + } + }); + }, get_title: function() { var titles = []; for (var i = 0; i < this.breadcrumbs.length; i += 1) { @@ -217,6 +230,12 @@ instance.web.ActionManager = instance.web.Widget.extend({ do_load_state: function(state, warm) { var self = this, action_loaded; + if (!warm && 'return_label' in state) { + var return_url = state.return_url || document.referrer; + if (return_url) { + this.add_breadcrumb_url(return_url, state.return_label); + } + } if (state.action) { if (_.isString(state.action) && instance.web.client_actions.contains(state.action)) { var action_client = { @@ -225,7 +244,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ params: state, _push_me: state._push_me, }; - this.null_action(); + if (warm) { + this.null_action(); + } action_loaded = this.do_action(action_client); } else { var run_action = (!this.inner_widget || !this.inner_widget.action) || this.inner_widget.action.id !== state.action; @@ -245,7 +266,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ add_context.active_ids = [state.active_id]; } add_context.params = state; - this.null_action(); + if (warm) { + this.null_action(); + } action_loaded = this.do_action(state.action, { additional_context: add_context }); $.when(action_loaded || null).done(function() { instance.webclient.menu.has_been_loaded.done(function() { @@ -258,7 +281,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ } } else if (state.model && state.id) { // TODO handle context & domain ? - this.null_action(); + if (warm) { + this.null_action(); + } var action = { res_model: state.model, res_id: state.id, @@ -268,7 +293,9 @@ instance.web.ActionManager = instance.web.Widget.extend({ action_loaded = this.do_action(action); } else if (state.sa) { // load session action - this.null_action(); + if (warm) { + this.null_action(); + } action_loaded = this.rpc('/web/session/get_session_action', {key: state.sa}).then(function(action) { if (action) { return self.do_action(action); -- cgit v1.2.3 From 7c9be80f9558229effb5abf0d428f62d97f7cc96 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 18 Nov 2013 19:06:42 +0100 Subject: [FIX] jquery browser detection fix bzr revid: al@openerp.com-20131118180642-xa39ja4o8zt8zd5o --- addons/web/static/src/js/core.js | 4 ++++ 1 file changed, 4 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 8c69f86c47e..3e2b93a8ead 100644 --- a/addons/web/static/src/js/core.js +++ b/addons/web/static/src/js/core.js @@ -586,6 +586,10 @@ instance.web.TranslationDataBase.include({ }); /** Custom jQuery plugins */ +if(navigator.appVersion.indexOf("MSIE") !== -1) { + $.browser = $.browser || {}; + $.browser.msie = 1; +} $.fn.getAttributes = function() { var o = {}; if (this.length) { -- cgit v1.2.3 From 584d21a26fb2bfd0af194f97bc200cfd98a39e92 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 18 Nov 2013 19:24:16 +0100 Subject: [FIX] field statusbar css color between stages bzr revid: al@openerp.com-20131118182416-picnqdmcwbqalk2y --- addons/web/static/src/css/base.css | 2 +- addons/web/static/src/css/base.sass | 2 +- 2 files changed, 2 insertions(+), 2 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 21d5edd5704..a9b4934e4da 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3399,7 +3399,7 @@ div.ui-widget-overlay { background: transparent; } .openerp_ie ul.oe_form_status li > .arrow span, .openerp_ie ul.oe_form_status_clickable li > .arrow span { - background-color: #fefefe !important; + background-color: #eeeeee !important; } .openerp_ie ul.oe_form_status li.oe_active > .label, .openerp_ie ul.oe_form_status_clickable li.oe_active > .label { border-bottom: 1px solid #729fcf; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 13f1ab30b17..57d2a855512 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2681,7 +2681,7 @@ div.ui-widget-overlay background: transparent > .arrow span - background-color: #fefefe !important + background-color: #eeeeee !important li.oe_active > .label border-bottom: 1px solid #729fcf -- cgit v1.2.3 From 8721307dae148af6d4381f849de495aafd4bf77b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 20 Nov 2013 19:53:37 +0100 Subject: [IMP] web: avoid double reload() when clicking on a button on a editable form view. bzr revid: chs@openerp.com-20131120185337-w8857fmwosa36r4d --- addons/web/static/src/js/view_form.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 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 bd04b4c75d0..080cd6f70aa 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -720,12 +720,13 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var self = this; return this.save().done(function(result) { self.trigger("save", result); - self.to_view_mode(); - }).then(function(result) { - var parent = self.ViewManager.ActionManager.getParent(); - if(parent){ - parent.menu.do_reload_needaction(); - } + self.reload().then(function() { + self.to_view_mode(); + var parent = self.ViewManager.ActionManager.getParent(); + if(parent){ + parent.menu.do_reload_needaction(); + } + }); }); }, on_button_cancel: function(event) { @@ -889,17 +890,12 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM * @param {Object} r result of the write function. */ record_saved: function(r) { - var self = this; + this.trigger('record_saved', r); if (!r) { // should not happen in the server, but may happen for internal purpose - this.trigger('record_saved', r); return $.Deferred().reject(); - } else { - return $.when(this.reload()).then(function () { - self.trigger('record_saved', r); - return r; - }); } + return r; }, /** * Updates the form' dataset to contain the new record: -- cgit v1.2.3 From e5558726465419e4c6dce68601c47325941e15a9 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 22 Nov 2013 14:10:37 +0100 Subject: [FIX] web: view list: ensure that the mutex of synchronized method `reload_content` is always released. bzr revid: chs@openerp.com-20131122131037-sqxs1fdh4al32eh2 --- addons/web/static/src/js/view_list.js | 41 ++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 13 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 b9c789cb6a9..868a218f70e 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -501,23 +501,38 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.$el.find('.oe_list_record_selector').prop('checked', false); this.records.reset(); var reloaded = $.Deferred(); - this.$el.find('.oe_list_content').append( - this.groups.render(function () { - if (self.dataset.index == null) { - if (self.records.length) { + + setTimeout(function() { + var $group; + try { + $group = self.groups.render(function () { + // NOTE using == instead of === is wanted. + if (self.dataset.index == null) { // jshint ignore:line + if (self.records.length) { + self.dataset.index = 0; + } + } else if (self.dataset.index >= self.records.length) { self.dataset.index = 0; } - } else if (self.dataset.index >= self.records.length) { - self.dataset.index = 0; + + self.compute_aggregates(); + }); + } finally { + // ensure that the deferred is always rejected/resolved to quit the + // synchronized block properly. + if (_.isUndefined($group)) { + reloaded.reject(); + } else { + reloaded.resolve(); + self.$el.find('.oe_list_content').append($group); + self.do_push_state({ + page: self.page, + limit: self._limit + }); } + } - self.compute_aggregates(); - reloaded.resolve(); - })); - this.do_push_state({ - page: this.page, - limit: this._limit - }); + }, 0); return reloaded.promise(); }), reload: function () { -- cgit v1.2.3 From 5c080a1634fd408905996756c1fbac10220e3881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 22 Nov 2013 14:59:59 +0100 Subject: [IMP] webclient: Introducing the FullscreenWidget, enabling fullscreen behavior and fixed zoomlevels on mobile devices bzr revid: fva@openerp.com-20131122135959-ezv9cmgwp2zfkt00 --- addons/web/static/src/js/chrome.js | 20 ++++++++++++++++++++ 1 file changed, 20 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 f019972fd14..56559e9edb9 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -1223,6 +1223,26 @@ instance.web.UserMenu = instance.web.Widget.extend({ }, }); +instance.web.FullscreenWidget = instance.web.Widget.extend({ + /** + * Widgets extending the FullscreenWidget will be displayed fullscreen, + * and will have a fixed 1:1 zoom level on mobile devices. + */ + start: function(){ + if(!$('#oe-fullscreenwidget-viewport').length){ + $('head').append(''); + } + instance.webclient.set_content_full_screen(true); + return this._super(); + }, + destroy: function(){ + instance.webclient.set_content_full_screen(false); + $('#oe-fullscreenwidget-viewport').remove(); + return this._super(); + }, + +}); + instance.web.Client = instance.web.Widget.extend({ init: function(parent, origin) { instance.client = instance.webclient = this; -- cgit v1.2.3 From 0a76694628e0f10e4ae2a809f3a2b08d899ffa06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 22 Nov 2013 15:00:48 +0100 Subject: [IMP] webclient: Introducing SimpleIndexedDB, a key value wrapper around IndexedDB bzr revid: fva@openerp.com-20131122140048-goaplzrx26jvcmmu --- addons/web/static/src/js/data.js | 151 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) (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 04f657d91f7..76164657d84 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -1090,6 +1090,157 @@ instance.web.DropMisordered = instance.web.Class.extend({ } }); +instance.web.SimpleIndexedDB = instance.web.Class.extend({ + /** + * A simple wrapper around IndexedDB that provides an asynchronous + * localStorage-like Key-Value api that persists between browser + * restarts. + * + * It will not work if the browser doesn't support a recent version + * of IndexedDB, and it may fail if the user refuses db access. + * + * All instances of SimpleIndexedDB will by default refer to the same + * IndexedDB database, if you want to pick another one, use the 'name' + * option on instanciation. + */ + init: function(opts){ + var self = this; + var opts = opts || {}; + + this.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; + this.db = undefined; + this._ready = new $.Deferred(); + + if(this.indexedDB && this.indexedDB.open){ + var request = this.indexedDB.open( opts.name || "SimpleIndexedDB" ,1); + + request.onerror = function(event){ + self.db = null; + self._ready.reject(event.target.error); + }; + + request.onsuccess = function(event){ + self.db = request.result; + self._ready.resolve(); + }; + + request.onupgradeneeded = function(event){ + self.db = event.target.result; + + var objectStore = self.db.createObjectStore("keyvals", { keyPath:"key" }); + self._ready.resolve(); + }; + }else{ + this.db = null; + this._ready.reject({type:'UnknownError', message:'IndexedDB is not supported by your Browser'}); + } + }, + + /** + * returns true if the browser supports the necessary IndexedDB API + * (but doesn't tell if the db can be created, check ready() for that) + */ + isSupportedByBrowser: function(){ + return this.indexedDB && this.indexedDB.open; + }, + + /** + * returns a deferred that resolves when the db has been successfully + * initialized. done/failed callbacks are optional. + */ + ready: function(done,failed){ + this._ready.then(done,failed); + return this._ready.promise(); + }, + + /** + * fetches the value associated to 'key' in the db. if the key doesn't + * exists, it returns undefined. The returned value is provided as a + * deferred, or as the first parameter of the optional 'done' callback. + */ + getItem: function(key,done,failed){ + var self = this; + var def = new $.Deferred(); + def.then(done,failed); + + this._ready.then(function(){ + var request = self.db.transaction(["keyvals"],"readwrite") + .objectStore("keyvals") + .get(key); + + request.onsuccess = function(){ + def.resolve(request.result ? request.result.value : undefined); + }; + + request.onerror = function(event){ + def.reject(event.target.error); + }; + },function(){ + def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'}); + }); + + return def.promise(); + }, + + /** + * Associates a value to 'key' in the db, overwriting previous value if + * necessary. Contrary to localStorage, the value is not limited to strings and + * can be any javascript object, even with cyclic references ! + * + * Be sure to check for failure as the user may refuse to have data localy stored. + */ + setItem: function(key,value,done,failed){ + var self = this; + var def = new $.Deferred(); + def.then(done,failed); + + this._ready.then(function(){ + var request = self.db.transaction(["keyvals"],"readwrite") + .objectStore("keyvals") + .put( {key:key, value:value} ); + + request.onsuccess = function(){ + def.resolve(); + }; + + request.onerror = function(event){ + def.reject(event.target.error); + }; + },function(){ + def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'}); + }); + + return def.promise(); + }, + + /** + * Removes the value associated with 'key' from the db. + */ + removeItem: function(key,done,failed){ + var self = this; + var def = new $.Deferred(); + def.then(done,failed); + + this._ready.then(function(){ + var request = self.db.transaction(["keyvals"],"readwrite") + .objectStore("keyvals") + .delete(key); + + request.onsuccess = function(){ + def.resolve(); + }; + + request.onerror = function(event){ + def.reject(event.target.error); + }; + },function(){ + def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'}); + }); + + return def.promise(); + }, +}); + })(); // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: -- cgit v1.2.3 From 1be71fdae6d01169b50dff6f3eb7657a98436dce Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 22 Nov 2013 18:03:16 +0100 Subject: [REVERT] revert previous commit which: 1. is wrong 2. break runbot bzr revid: chs@openerp.com-20131122170316-lbuxddprrgz1are3 --- addons/web/static/src/js/view_list.js | 41 +++++++++++------------------------ 1 file changed, 13 insertions(+), 28 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 868a218f70e..b9c789cb6a9 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -501,38 +501,23 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi self.$el.find('.oe_list_record_selector').prop('checked', false); this.records.reset(); var reloaded = $.Deferred(); - - setTimeout(function() { - var $group; - try { - $group = self.groups.render(function () { - // NOTE using == instead of === is wanted. - if (self.dataset.index == null) { // jshint ignore:line - if (self.records.length) { - self.dataset.index = 0; - } - } else if (self.dataset.index >= self.records.length) { + this.$el.find('.oe_list_content').append( + this.groups.render(function () { + if (self.dataset.index == null) { + if (self.records.length) { self.dataset.index = 0; } - - self.compute_aggregates(); - }); - } finally { - // ensure that the deferred is always rejected/resolved to quit the - // synchronized block properly. - if (_.isUndefined($group)) { - reloaded.reject(); - } else { - reloaded.resolve(); - self.$el.find('.oe_list_content').append($group); - self.do_push_state({ - page: self.page, - limit: self._limit - }); + } else if (self.dataset.index >= self.records.length) { + self.dataset.index = 0; } - } - }, 0); + self.compute_aggregates(); + reloaded.resolve(); + })); + this.do_push_state({ + page: this.page, + limit: this._limit + }); return reloaded.promise(); }), reload: function () { -- cgit v1.2.3 From 727b188eac4eb61134aca3666e861af3923776e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 27 Nov 2013 10:50:37 +0100 Subject: [IMP] form_view: statusbar widget: folded back as an option. The widget option 'fold_field' allows to tell the widget to use this field on the model used for stages to compute the folded selection. If not set, no stage is folded. bzr revid: tde@openerp.com-20131127095037-me1cvl272ex1e6r9 --- addons/web/static/src/js/view_form.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 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 8b985695860..683cdebbbf4 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5552,23 +5552,23 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ var self = this; var selection_unfolded = []; var selection_folded = []; + var fold_field = this.options.fold_field; var calculation = _.bind(function() { if (this.field.type == "many2one") { - /* :deprecated: fold feature will probably be removed */ - // return self.get_distant_fields().then(function(fields) { - self.distant_fields = {}; - return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) - .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { - var ids = _.pluck(records, 'id'); - return self.dataset.name_get(ids).then(function (records_name) { - _.each(records, function (record) { - var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; - if (record.fold && record.id != self.get('value')) { - selection_folded.push([record.id, name]); - } else { - selection_unfolded.push([record.id, name]); - } + return self.get_distant_fields().then(function (fields) { + return new instance.web.DataSetSearch(self, self.field.relation, self.build_context(), self.get("evaluated_selection_domain")) + .read_slice(_.union(_.keys(self.distant_fields), ['id']), {}).then(function (records) { + var ids = _.pluck(records, 'id'); + return self.dataset.name_get(ids).then(function (records_name) { + _.each(records, function (record) { + var name = _.find(records_name, function (val) {return val[0] == record.id;})[1]; + if (fold_field && record[fold_field] && record.id != self.get('value')) { + selection_folded.push([record.id, name]); + } else { + selection_unfolded.push([record.id, name]); + } + }); }); }); }); @@ -5598,10 +5598,13 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({ */ get_distant_fields: function() { var self = this; + if (! this.options.fold_field) { + this.distant_fields = {} + } if (this.distant_fields) { return $.when(this.distant_fields); } - return new instance.web.Model(self.field.relation).call("fields_get", [["fold"]]).then(function(fields) { + return new instance.web.Model(self.field.relation).call("fields_get", [[this.options.fold_field]]).then(function(fields) { self.distant_fields = fields; return fields; }); -- cgit v1.2.3 From e468eeb9b30af8ff54c006657d79f5cff32919c4 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 28 Nov 2013 14:46:07 +0100 Subject: [FIX] web_form: FieldMany2ManyBinaryMultiFiles error when rendering twice (with an onchange for e.g.) bzr revid: chm@openerp.com-20131128134607-2fisdnoq0qgpvibx --- addons/web/static/src/js/view_form.js | 13 +++++++------ addons/web/static/src/xml/base.xml | 2 +- 2 files changed, 8 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 94fc38faa23..57ac87c8d09 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5379,25 +5379,26 @@ instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractFie read_name_values : function () { var self = this; // don't reset know values - var _value = _.filter(this.get('value'), function (id) { return typeof self.data[id] == 'undefined'; } ); + var ids = this.get('value'); + var _value = _.filter(ids, function (id) { return typeof self.data[id] == 'undefined'; } ); // send request for get_name if (_value.length) { - return this.ds_file.call('read', [_value, ['id', 'name', 'datas_fname']]).done(function (datas) { + return this.ds_file.call('read', [_value, ['id', 'name', 'datas_fname']]).then(function (datas) { _.each(datas, function (data) { data.no_unlink = true; data.url = self.session.url('/web/binary/saveas', {model: 'ir.attachment', field: 'datas', filename_field: 'datas_fname', id: data.id}); self.data[data.id] = data; }); + return ids; }); } else { - return $.when(); + return $.when(ids); } }, render_value: function () { var self = this; - this.read_name_values().then(function () { - - var render = $(instance.web.qweb.render('FieldBinaryFileUploader.files', {'widget': self})); + this.read_name_values().then(function (ids) { + var render = $(instance.web.qweb.render('FieldBinaryFileUploader.files', {'widget': self, 'values': ids})); render.on('click', '.oe_delete', _.bind(self.on_file_delete, self)); self.$('.oe_placeholder_files, .oe_attachments').replaceWith( render ); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 60a344467c0..78398071c22 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1334,7 +1334,7 @@
      - +
      -- cgit v1.2.3 From d6c6f31231070213bfabf0afdadc7a45d6fd626a Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 2 Dec 2013 14:19:43 +0100 Subject: [MERGE] boostrap3 manually merged bzr revid: al@openerp.com-20131202131943-b01fb56u0qsgcs53 --- addons/web/static/src/css/base.css | 368 ++++++++++++++++++++---------- addons/web/static/src/css/base.sass | 287 ++++++++++++++++------- addons/web/static/src/css/data_export.css | 5 + addons/web/static/src/js/chrome.js | 24 +- addons/web/static/src/xml/base.xml | 44 ++-- 5 files changed, 495 insertions(+), 233 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 a9b4934e4da..010585ee4a0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -111,6 +111,8 @@ } .openerp h4 { margin: 4px 0; + font-weight: bold; + font-size: inherit; } .openerp a.button:link, .openerp a.button:visited, .openerp button, .openerp input[type='submit'], .openerp .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button { display: inline-block; @@ -199,6 +201,7 @@ } .openerp.ui-dialog { display: none; + height: auto !important; padding: 6px; background-color: rgba(60, 60, 60, 0.7); border: 1px solid; @@ -241,6 +244,7 @@ } .openerp.ui-dialog .ui-dialog-content { background: white; + width: auto !important; } .openerp.ui-dialog .ui-dialog-buttonpane { border-top: 1px solid #e0e0e0; @@ -529,6 +533,15 @@ .openerp .oe_grey { color: #aaaaaa; } +.openerp .oe_error_detail hr { + display: block; + -webkit-margin-before: 0.5em; + -webkit-margin-after: 0.5em; + -webkit-margin-start: auto; + -webkit-margin-end: auto; + border-style: inset; + border-width: 1px; +} .openerp .oe_tag { border: 1px solid #afafb6; font-size: 11px; @@ -680,6 +693,9 @@ .openerp .oe_notebook_page { padding: 0; } +.openerp .oe_notebook_page > label:not([for]) { + font-weight: normal !important; +} .openerp div.ui-tabs { padding: 3px 0px 3px 0px; } @@ -976,7 +992,7 @@ } .openerp .oe_login .oe_login_footer a { color: #eeeeee; - margin: 0 8px; + margin: 0 6px; } .openerp .oe_login .oe_login_footer a:hover { text-decoration: underline; @@ -1022,19 +1038,7 @@ .openerp .oe_content_full_screen .oe_topbar, .openerp .oe_content_full_screen .oe_leftbar { display: none; } -.openerp .oe_topbar { - width: 100%; - height: 32px; - background-color: #414141; - background-color: #454343; - 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); -} -.openerp .oe_topbar .oe_topbar_anonymous_login { +.openerp .navbar .oe_topbar_anonymous_login { background-color: #dc5f59; color: #eeeeee; background-color: #be4343; @@ -1045,11 +1049,11 @@ background-image: -o-linear-gradient(top, #fc8787, maroon); background-image: linear-gradient(to bottom, #fc8787, maroon); } -.openerp .oe_topbar .oe_topbar_anonymous_login a { +.openerp .navbar .oe_topbar_anonymous_login a { display: block; padding: 5px 10px 7px; line-height: 20px; - height: 20px; + height: 30px; text-decoration: none; color: white; background: transparent; @@ -1059,7 +1063,7 @@ -o-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } -.openerp .oe_topbar .oe_topbar_anonymous_login a:hover { +.openerp .navbar .oe_topbar_anonymous_login a:hover { background: rgba(0, 0, 0, 0.1); color: white; text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.2); @@ -1067,9 +1071,9 @@ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; } -.openerp .oe_topbar .oe_topbar_item { +.openerp .navbar .oe_topbar_item { display: block; - padding: 5px 10px 7px; + padding: 5px 10px 26px; line-height: 20px; height: 20px; text-decoration: none; @@ -1082,7 +1086,7 @@ -o-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } -.openerp .oe_topbar .oe_topbar_item:hover { +.openerp .navbar .oe_topbar_item:hover { background: rgba(0, 0, 0, 0.2); text-shadow: black 0px 0px 3px; color: white; @@ -1090,7 +1094,7 @@ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; } -.openerp .oe_topbar .oe_topbar_avatar { +.openerp .navbar .oe_topbar_avatar { width: 24px; height: 24px; margin: -2px 2px 0 0; @@ -1098,13 +1102,13 @@ -webkit-border-radius: 3px; border-radius: 3px; } -.openerp .oe_topbar .oe_topbar_avatar { +.openerp .navbar .oe_topbar_avatar { vertical-align: top; } -.openerp .oe_topbar .oe_dropdown_arrow:after { +.openerp .navbar .oe_dropdown_arrow:after { border-top: 4px solid white; } -.openerp .oe_topbar .oe_dropdown_menu { +.openerp .navbar .dropdown_menu { top: 32px; background: #333333; background: rgba(37, 37, 37, 0.9); @@ -1119,14 +1123,14 @@ -moz-background-clip: padding-box; background-clip: padding-box; } -.openerp .oe_topbar .oe_dropdown_menu li { +.openerp .navbar .dropdown_menu li { float: none; padding: 3px 12px; } -.openerp .oe_topbar .oe_dropdown_menu li a { +.openerp .navbar .dropdown_menu li a { color: #eeeeee; } -.openerp .oe_topbar .oe_dropdown_menu li:hover { +.openerp .navbar .dropdown_menu li:hover { background-color: #212121; background-image: -webkit-gradient(linear, left top, left bottom, from(#292929), to(#191919)); background-image: -webkit-linear-gradient(top, #292929, #191919); @@ -1138,21 +1142,21 @@ -webkit-box-shadow: none; box-shadow: none; } -.openerp .oe_topbar .oe_topbar_name { +.openerp .navbar .oe_topbar_name { max-width: 150px; - overflow: hidden; display: inline-block; - max-height: 100%; + height: 15px; text-overflow: ellipsis; white-space: nowrap; + overflow: hidden; } -.openerp .oe_menu { +.openerp .navbar-nav { float: left; padding: 0; margin: 0; font-size: 13px; } -.openerp .oe_menu > li { +.openerp .navbar-nav > li { list-style-type: none; padding: 0; margin: 0; @@ -1160,13 +1164,13 @@ display: block; color: #eeeeee; } -.openerp .oe_menu > li > a { +.openerp .navbar-nav > li > a { display: block; - padding: 5px 10px 7px; + padding: 5px 10px 26px !important; line-height: 20px; height: 20px; text-decoration: none; - color: #eeeeee; + color: #eeeeee !important; vertical-align: top; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -webkit-transition: all 0.2s ease-out; @@ -1175,7 +1179,7 @@ -o-transition: all 0.2s ease-out; transition: all 0.2s ease-out; } -.openerp .oe_menu > li > a:hover { +.openerp .navbar-nav > li > a:hover { background: rgba(0, 0, 0, 0.2); text-shadow: black 0px 0px 3px; color: white; @@ -1183,7 +1187,7 @@ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; } -.openerp .oe_menu > li > .oe_active { +.openerp .navbar-nav > li > .active { background: rgba(0, 0, 0, 0.3); text-shadow: black 0px 0px 3px; -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) inset; @@ -1214,7 +1218,7 @@ width: 220px; background: #f0eeee; border-right: 1px solid #afafb6; - text-shadow: 0 1px 1px white; + text-shadow: none; padding-bottom: 16px; } .openerp a.oe_logo { @@ -1266,37 +1270,9 @@ color: #7c7bad; } .openerp .oe_secondary_submenu { - padding: 2px 0 8px 0; - margin: 0; -} -.openerp .oe_secondary_submenu li { - position: relative; - margin: 0; - padding: 1px 0 1px 20px !important; - list-style-type: none; -} -.openerp .oe_secondary_submenu li a { - display: block; - color: #4c4c4c; - padding: 2px 4px 2px 0; -} -.openerp .oe_secondary_submenu li .oe_menu_label { - position: absolute; - top: 1px; - right: 1px; - font-size: 10px; - background: #7c7bad; - color: white; - padding: 2px 4px; - margin: 1px 6px 0 0; - border: 1px solid lightgrey; - 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); + margin-bottom: 10px !important; + line-height: 1.1em; + margin-top: 3px; } .openerp .oe_secondary_submenu .oe_menu_text { white-space: nowrap; @@ -1304,15 +1280,9 @@ display: inline-block; text-overflow: ellipsis; max-width: 85%; + margin-top: 1px; } -.openerp .oe_secondary_submenu .oe_menu_counter { - float: right; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - margin: 1px; - padding: 1px 4px; - border: none; -} -.openerp .oe_secondary_submenu .oe_menu_counter:hover { +.openerp .oe_secondary_submenu .badge:hover { cursor: pointer; -webkit-transform: scale(1.1); -moz-transform: scale(1.1); @@ -1320,33 +1290,6 @@ -o-transform: scale(1.1); transform: scale(1.1); } -.openerp .oe_secondary_submenu .oe_active { - border-top: 1px solid lightgrey; - border-bottom: 1px solid #dedede; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); - -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); - -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); - box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); - background: #7c7bad; -} -.openerp .oe_secondary_submenu .oe_active a { - color: white; -} -.openerp .oe_secondary_submenu .oe_active .oe_menu_label { - background: #eeeeee; - color: #7c7bad; - 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); -} -.openerp .oe_secondary_submenu .oe_active .oe_menu_counter { - background: #eeeeee; - color: #7c7bad; - -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); - box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); -} .openerp .oe_secondary_submenu .oe_menu_toggler:before { width: 0; height: 0; @@ -1371,9 +1314,6 @@ border-right: 4px solid transparent; border-top: 4px solid #4c4c4c; } -.openerp .oe_secondary_submenu .oe_secondary_submenu { - margin-left: -20px; -} .openerp .oe_secondary_submenu .oe_secondary_submenu li { margin-left: 20px; } @@ -1440,6 +1380,7 @@ .openerp .oe_application .oe_breadcrumb_title > * { display: inline-block; overflow: hidden; + font-weight: bold; } .openerp .oe_view_manager { display: table; @@ -1482,6 +1423,7 @@ font-size: 18px; margin: 0; float: left; + line-height: 30px; } .openerp .oe_view_manager table.oe_view_manager_header h2 a { color: #7c7bad; @@ -1652,9 +1594,12 @@ .openerp .oe_view_manager_inline > .oe_view_manager_header, .openerp .oe_view_manager_inlineview > .oe_view_manager_header { display: none; } -.openerp .oe_popup_form > .oe_formview > .oe_form_pager { +.openerp .oe_popup_form .oe_formview .oe_form_pager { display: none !important; } +.openerp .oe_popup_form table label { + font-weight: normal; +} .openerp .oe_popup_list_pager { float: right; } @@ -1680,6 +1625,16 @@ font-size: 12px; line-height: 18px; } +.openerp .oe_searchview input:not([type]), .openerp .oe_searchview input[type="text"], .openerp .oe_searchview input[type="number"] { + width: 156px; + height: 22px; +} +.openerp .oe_searchview input[type="checkbox"] { + margin: 3px 3px 3px 4px; +} +.openerp .oe_searchview select { + margin: 2px 4px 2px 0; +} .openerp .oe_searchview.oe_focused { border-color: #a6a6fe; -moz-box-shadow: 0 1px 2px #a6a6fe inset; @@ -1904,6 +1859,7 @@ box-sizing: border-box; display: table-cell; width: 50%; + padding-left: 2px; } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_section ul { margin: 0 8px 8px; @@ -1939,7 +1895,7 @@ line-height: 18px; } .openerp .oe_searchview .oe_searchview_drawer form button { - margin: 0 0 8px 0; + margin: 0 0 8px -3px; } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom { padding: 0 8px 8px 8px; @@ -1967,6 +1923,9 @@ top: 0; right: 5px; } +.openerp .oe_searchview .oe_searchview_drawer .oe_searchview_custom label { + font-weight: normal; +} .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_dashboard form { display: none; margin-top: 2px; @@ -1994,6 +1953,7 @@ } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced li:first-child .searchview_extended_prop_or { visibility: hidden; + margin-left: -14px; } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced .searchview_extended_prop_or { opacity: 0.5; @@ -2185,6 +2145,12 @@ background: url(/web/static/src/img/form_sheetbg.png); border-bottom: 1px solid #dddddd; } +.openerp .oe_application .oe_form_sheetbg .oe_subtotal_footer label { + font-weight: bold; +} +.openerp .oe_application .oe_form_sheetbg table label { + font-weight: normal; +} .openerp .oe_application .oe_form_sheet { border: 1px solid #c8c8d3; -moz-box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); @@ -2273,7 +2239,7 @@ padding: 2px 11px 2px 0px !important; } .openerp .oe_form .oe_subtotal_footer label.oe_form_label_help { - font-weight: normal; + font-weight: normal !important; } .openerp .oe_form .oe_form_box_info { background: #ffee99; @@ -2305,7 +2271,8 @@ .openerp .oe_form td.oe_form_group_cell_label label { line-height: 18px; display: block; - min-width: 140px; + min-width: 150px; + font-weight: bold !important; } .openerp .oe_form td.oe_form_group_cell + .oe_form_group_cell { padding: 2px 0 2px 8px; @@ -2318,13 +2285,12 @@ padding-left: 20px; } .openerp .oe_form .oe_form_label_help[for], .openerp .oe_form .oe_form_label[for] { - font-weight: bold; white-space: nowrap; padding-right: 8px; } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkgreen; + color: darkGreen; vertical-align: top; position: relative; top: -4px; @@ -2402,6 +2368,18 @@ height: inherit !important; font-size: inherit; } +.openerp .oe_form .oe_title h1, .openerp .oe_form h1 { + font-weight: bold; + font-size: 2em; +} +.openerp .oe_form h2 { + font-size: 1.5em; +} +.openerp .oe_form label { + font-weight: bold; + margin-bottom: 0px; + display: inline; +} .openerp .oe_form .oe_form_field { width: 100%; display: inline-block; @@ -2539,6 +2517,9 @@ margin: 0; padding: 0; } +.openerp .oe_form .oe_form_field_binary { + display: inline-block; +} .openerp .oe_form .oe_form_field_image { padding: 0; position: relative; @@ -2570,13 +2551,14 @@ display: inline-block; clear: both; width: 100%; + margin-bottom: -15px; } .openerp .oe_fileupload .oe_add { float: left; position: relative; width: 100%; left: 2px; - top: 7px; + margin: 9px 0; overflow: hidden; } .openerp .oe_fileupload .oe_add button { @@ -2588,9 +2570,6 @@ } .openerp .oe_fileupload .oe_add button.oe_attach { width: 24px; - overflow: hidden; - width: 24px; - overflow: hidden; background: transparent; color: #7c7bad; box-shadow: none; @@ -2639,6 +2618,9 @@ .openerp .oe_fileupload .oe_attachments .oe_attachment:nth-child(even) { background: #f4f5fa; } +.openerp .oe_form_field_many2one { + display: inline-block; +} .openerp .oe_form_field_many2one td:first-child { position: relative; } @@ -2701,9 +2683,13 @@ padding-left: 24px; margin: 0; position: relative; + line-height: normal; + font-size: 100%; + font-weight: normal; } .openerp ul.oe_form_status li > .arrow, .openerp ul.oe_form_status_clickable li > .arrow { width: 17px; + height: 30px; display: inline-block; vertical-align: top; overflow: hidden; @@ -3201,9 +3187,6 @@ .openerp .oe_form_field_many2one .oe_m2o_cm_button { line-height: 18px; } - .openerp .oe_secondary_submenu { - line-height: 14px; - } .openerp .oe_webclient .oe_star_on, .openerp .oe_webclient .oe_star_off { top: 0px; } @@ -3451,6 +3434,151 @@ div.ui-widget-overlay { overflow: hidden !important; } } + +.nav li > a { + padding: 3px 4px 2px 18px; + color: #4c4c4c; +} +.nav nav-pills.nav-stacked > li > ul { + padding-left: 16px; +} + +.nav-pills > li.active > a, a.list-group-item.active > a { + background-color: #7c7bad; + color: white; + border-radius: 0; +} +.nav-pills > li.active a:hover, .nav-pills > li.active a:focus, a.list-group-item.active a:hover, a.list-group-item.active a:focus { + background-color: #7c7bad; +} +.nav-pills > li.active .badge, a.list-group-item.active .badge { + background-color: white; + color: #7c7bad; + text-shadow: none; +} + +.badge { + font-weight: normal; + font-size: 11px; + background-color: #7c7bad; +} + +button, body { + line-height: normal; +} + +h1, h2 { + font-weight: bold; +} + +h3 { + font-size: 1.17em; + font-weight: bold; +} + +p { + display: block; + -webkit-margin-before: 1em; + -webkit-margin-after: 1em; + -webkit-margin-start: 0px; + -webkit-margin-end: 0px; +} + +pre { + background-color: white; + border: none; + padding: 10px 0 3px 0; +} + +.jqstooltip { + height: auto !important; + width: auto !important; +} + +h5 { + font-weight: bold; + font-size: smaller; +} + +.oe_form .oe_subtype label, .oe_subtype label { + font-weight: normal; +} + +.oe_msg_subtype_check { + margin: 3px 3px 0 !important; +} + +.oe_view_manager_new .oe_form_nosheet { + margin-top: 8px; +} +.oe_view_manager_new .oe_form_nosheet .oe_form_label { + font-weight: normal; +} + +.navbar { + min-height: 32px; + margin-bottom: 0px; + border: none; + z-index: 1; + background-color: #414141; + background-color: #454343; + 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); +} + +.navbar-default .navbar-nav li a:hover, .navbar-default .navbar-nav li a:focus { + background: rgba(0, 0, 0, 0.3); +} +.navbar-default .navbar-nav .open > a, .navbar-default .navbar-nav a:hover, .navbar-default .navbar-nav a:focus { + background: rgba(0, 0, 0, 0.3) !important; +} +.navbar-default .navbar-nav .dropdown > a .caret { + border-top-color: #777777 !important; + border-bottom-color: #777777 !important; +} + +.navbar-nav li a { + padding: 4px 32px 4px 12px; +} + +.dropdown-menu { + font-size: 13px; + padding: 4px 0; + background: #333333 !important; + background: rgba(37, 37, 37, 0.9) !important; + border-color: #999999; + border-color: rgba(0, 0, 0, 0.2); + background-color: #414141; + text-shadow: none; + background-color: #454343; + 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); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +.dropdown-menu li a, .dropdown-menu li a:hover, .dropdown-menu li a:focus { + color: #eeeeee; +} + +.ui-icon { + width: 18px; + height: 18px; +} + +input[type="radio"], input[type="checkbox"] { + margin-right: 4px; + margin-left: 4px; +} + .blockUI.blockOverlay { background-color: black; opacity: 0.6; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 57d2a855512..e9a51370192 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -204,6 +204,8 @@ $sheet-padding: 16px vertical-align: middle h4 margin: 4px 0 + font-weight: bold + font-size: inherit // }}} // Button style {{{ a.button:link, a.button:visited, button, input[type='submit'], .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button @@ -263,6 +265,7 @@ $sheet-padding: 16px // Modal box &.ui-dialog display: none + height: auto !important padding: 6px //overflow: hidden background-color: rgba(60,60,60,0.7) @@ -287,6 +290,7 @@ $sheet-padding: 16px border: none .ui-dialog-content background: white + width: auto !important .ui-dialog-buttonpane border-top: 1px solid #e0e0e0 background: #f5f7f9 @@ -467,7 +471,16 @@ $sheet-padding: 16px max-width: 650px .oe_grey color: #aaa - + // Added for generic error message and customize bootstrap3
      ,
      + .oe_error_detail + hr + display: block + -webkit-margin-before: 0.5em + -webkit-margin-after: 0.5em + -webkit-margin-start: auto + -webkit-margin-end: auto + border-style: inset + border-width: 1px // }}} // Tags (for many2many tags, among others) {{{ @@ -589,6 +602,10 @@ $sheet-padding: 16px cursor: default .oe_notebook_page padding: 0 + //Customize label weight according bootstrap3 + > label:not([for]) + font-weight: normal !important + // End of customize div.ui-tabs padding: 3px 0px 3px 0px .ui-tabs-hide @@ -811,7 +828,7 @@ $sheet-padding: 16px text-align: center a color: #eee - margin: 0 8px + margin: 0 6px &:hover text-decoration: underline span @@ -854,11 +871,7 @@ $sheet-padding: 16px // }}} // Top Menu {{{ - .oe_topbar - width: 100% - height: 32px - background-color: #414141 - @include vertical-gradient(#646060, #262626) + .navbar .oe_topbar_anonymous_login background-color: #dc5f59 color: #eeeeee @@ -867,7 +880,7 @@ $sheet-padding: 16px display: block padding: 5px 10px 7px line-height: 20px - height: 20px + height: 30px text-decoration: none color: white background: transparent @@ -879,7 +892,7 @@ $sheet-padding: 16px @include box-shadow(0 1px 2px rgba(0,0,0,0.2) inset) .oe_topbar_item display: block - padding: 5px 10px 7px + padding: 5px 10px 26px line-height: 20px height: 20px text-decoration: none @@ -902,7 +915,7 @@ $sheet-padding: 16px vertical-align: top .oe_dropdown_arrow:after border-top: 4px solid white - .oe_dropdown_menu + .dropdown_menu top: 32px background: #333 background: rgba(37,37,37,0.9) @@ -922,17 +935,17 @@ $sheet-padding: 16px @include box-shadow(none) .oe_topbar_name max-width: 150px - overflow: hidden display: inline-block - max-height: 100% + height: 15px // Customize to manage caret when topbar_name is over sized. text-overflow: ellipsis white-space: nowrap + overflow: hidden // Customize to bring ellipsis when topbar_name is over sized. // oe menu is the list of the buttons on the left side of the bar. // So why aren't the buttons oe_topbar_items ? This sad state of affairs // is a leftover from an uncomplete refactoring when the left and top menu // were merged. You are welcome to refactor and clean this up - .oe_menu + .navbar-nav float: left padding: 0 margin: 0 @@ -946,11 +959,11 @@ $sheet-padding: 16px color: #eeeeee > a display: block - padding: 5px 10px 7px + padding: 5px 10px 26px !important line-height: 20px height: 20px text-decoration: none - color: #eee + color: #eee !important vertical-align: top text-shadow: 0 1px 1px rgba(0,0,0,0.2) @include transition(all 0.2s ease-out) @@ -959,7 +972,7 @@ $sheet-padding: 16px text-shadow: black 0px 0px 3px color: white @include box-shadow(0 1px 2px rgba(0,0,0,0.4) inset) - > .oe_active + > .active background: rgba(0,0,0,0.30) text-shadow: black 0px 0px 3px @include box-shadow(0 1px 2px rgba(0,0,0,0.4) inset) @@ -987,7 +1000,7 @@ $sheet-padding: 16px width: 220px background: #f0eeee border-right: 1px solid $tag-border - text-shadow: 0 1px 1px white + text-shadow: none padding-bottom: 16px a.oe_logo position: relative @@ -1030,62 +1043,20 @@ $sheet-padding: 16px margin-left: 8px color: $link-color .oe_secondary_submenu - padding: 2px 0 8px 0 - margin: 0 - li - position: relative - margin: 0 - padding: 1px 0 1px 20px !important - 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: $link-color - 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)) + margin-bottom: 10px !important + line-height: 1.1em + margin-top: 3px .oe_menu_text white-space: nowrap overflow: hidden display: inline-block text-overflow: ellipsis max-width: 85% - .oe_menu_counter - float: right - text-shadow: 0 1px 1px rgba(0,0,0,0.2) - margin: 1px - padding: 1px 4px - border: none + margin-top: 1px + .badge &:hover cursor: pointer @include transform(scale(1.1)) - .oe_active - border-top: 1px solid lightGray - border-bottom: 1px solid #dedede - text-shadow: 0 1px 1px rgba(0,0,0,0.2) - @include box-shadow((inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2))) - background: $link-color - a - color: white - .oe_menu_label - background: #eee - color: $link-color - text-shadow: 0 1px 1px white - @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.2)) - .oe_menu_counter - background: #eee - color: $link-color - @include box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.2)) .oe_menu_toggler:before width: 0 height: 0 @@ -1107,11 +1078,8 @@ $sheet-padding: 16px border-left: 4px solid transparent border-right: 4px solid transparent border-top: 4px solid #4c4c4c - .oe_secondary_submenu - margin-left: -20px .oe_secondary_submenu li margin-left: 20px - // }}} // About openerp {{{ .oe_about @@ -1157,6 +1125,7 @@ $sheet-padding: 16px .oe_breadcrumb_title > * display: inline-block overflow: hidden + font-weight: bold // }}} // ViewManager common {{{ .oe_view_manager @@ -1195,6 +1164,7 @@ $sheet-padding: 16px font-size: 18px margin: 0 float: left + line-height: 30px a color: $link-color .oe_dropdown_menu @@ -1323,8 +1293,13 @@ $sheet-padding: 16px display: none // }}} // FormPopup {{{ - .oe_popup_form > .oe_formview > .oe_form_pager - display: none !important + .oe_popup_form + .oe_formview .oe_form_pager + display: none !important + // Customize label weight for popup wizard appear from another wizard according bootstrap3 + table label + font-weight: normal + // End of customize .oe_popup_list_pager float: right // }}} @@ -1345,6 +1320,15 @@ $sheet-padding: 16px height: 14px font-size: 12px line-height: 18px + //Customize searchview input, select + input:not([type]), input[type="text"], input[type="number"] + width: 156px + height: 22px + input[type="checkbox"] + margin: 3px 3px 3px 4px + select + margin: 2px 4px 2px 0 + //End of customize &.oe_focused border-color: $tag-border-selected @include box-shadow(0 1px 2px $tag-border-selected inset) @@ -1509,6 +1493,7 @@ $sheet-padding: 16px @include box-sizing(border) display: table-cell width: 50% + padding-left: 2px // Managed padding-left according bootstrap3 ul margin: 0 8px 8px padding: 0 @@ -1538,7 +1523,7 @@ $sheet-padding: 16px margin: 4px 0 line-height: 18px button - margin: 0 0 8px 0 + margin: 0 0 8px -3px // Managed margin-left according bootstrap3 .oe_searchview_custom padding: 0 8px 8px 8px div @@ -1558,6 +1543,10 @@ $sheet-padding: 16px position: absolute top: 0 right: 5px + //Customize for searchview label + label + font-weight: normal + //End of Customize .oe_searchview_dashboard form display: none @@ -1583,9 +1572,10 @@ $sheet-padding: 16px white-space: nowrap &:first-child .searchview_extended_prop_or visibility: hidden + margin-left: -14px .searchview_extended_prop_or opacity: 0.5 - margin-left: -14px + margin-left: -14px //Customize 'or' in searchview .oe_opened h4:before content: "▾ " @@ -1732,6 +1722,12 @@ $sheet-padding: 16px .oe_form_sheetbg background: url(/web/static/src/img/form_sheetbg.png) border-bottom: 1px solid #ddd + // Customize font weight according bootstrap3 + .oe_subtotal_footer label + font-weight: bold + table label + font-weight: normal + // End of customize .oe_form_sheet border: 1px solid #c8c8d3 //$tag-border @include box-shadow(0 4px 20px rgba(0,0,0,0.15)) @@ -1799,7 +1795,7 @@ $sheet-padding: 16px font-weight: bold !important padding: 2px 11px 2px 0px !important label.oe_form_label_help - font-weight: normal + font-weight: normal !important .oe_form_box_info background: #fe9 border-bottom: 1px solid #cb6 @@ -1826,7 +1822,8 @@ $sheet-padding: 16px label line-height: 18px display: block - min-width: 140px + min-width: 150px + font-weight: bold !important td.oe_form_group_cell + .oe_form_group_cell padding: 2px 0 2px 8px .oe_form_group @@ -1838,7 +1835,6 @@ $sheet-padding: 16px // FormView.label {{{ .oe_form .oe_form_label_help[for], .oe_form_label[for] - font-weight: bold white-space: nowrap padding-right: 8px span @@ -1907,6 +1903,17 @@ $sheet-padding: 16px input height: inherit !important font-size: inherit + // Customize for formview + .oe_title h1, h1 + font-weight: bold + font-size: 2em + h2 + font-size: 1.5em + label + font-weight: bold + margin-bottom: 0px + display: inline + // End of customize .oe_form_field width: 100% display: inline-block @@ -2022,6 +2029,8 @@ $sheet-padding: 16px margin: 0 padding: 0 .oe_form + .oe_form_field_binary + display: inline-block .oe_form_field_image padding: 0 position: relative @@ -2045,12 +2054,13 @@ $sheet-padding: 16px display: inline-block clear: both width: 100% + margin-bottom: -15px .oe_add float: left position: relative width: 100% left: +2px - top: +7px + margin: 9px 0 /* Customize margin according bootstrap3 */ overflow: hidden button display: inline @@ -2060,9 +2070,6 @@ $sheet-padding: 16px vertical-align: middle button.oe_attach width: 24px - overflow: hidden - width: 24px - overflow: hidden background: transparent color: #7C7BAD box-shadow: none @@ -2104,6 +2111,7 @@ $sheet-padding: 16px // }}} // FormView.many2one {{{ .oe_form_field_many2one + display: inline-block td:first-child position: relative span.oe_m2o_drop_down_button @@ -2152,8 +2160,14 @@ $sheet-padding: 16px padding-left: 24px margin: 0 position: relative + // Customize for statusbar label + line-height: normal + font-size: 100% + font-weight: normal + // End of customize > .arrow width: 17px + height: 30px display: inline-block vertical-align: top overflow: hidden @@ -2522,8 +2536,6 @@ $sheet-padding: 16px top: -1px .oe_form_field_many2one .oe_m2o_cm_button line-height: 18px - .oe_secondary_submenu - line-height: 14px .oe_webclient .oe_star_on, .oe_star_off top: 0px @@ -2728,6 +2740,121 @@ div.ui-widget-overlay overflow: hidden !important // }}} +// Customize bootstrap3 for leftbar +.nav + li > a + padding: 3px 4px 2px 18px + color: #4c4c4c + nav-pills.nav-stacked > li > ul + padding-left: 16px +.nav-pills > li.active,a.list-group-item.active + > a + background-color: #7c7bad + color: white + border-radius: 0 + a:hover,a:focus + background-color: #7c7bad + .badge + background-color: white + color: #7c7bad + text-shadow: none +.badge + font-weight: normal + font-size: 11px + background-color: #7c7bad +// End of customize + +// Customize for global tags +button, body + line-height: normal +h1,h2 + font-weight: bold +h3 + font-size: 1.17em + font-weight: bold +p + display: block + -webkit-margin-before: 1em + -webkit-margin-after: 1em + -webkit-margin-start: 0px + -webkit-margin-end: 0px +pre + background-color: #FFFFFF + border: none + padding: 10px 0 3px 0 +// End of customize + +// Customize for kanban tooltip +.jqstooltip + height: auto !important + width: auto !important +// End of kanban tooltip + +// Customize for chatter +h5 + font-weight: bold + font-size: smaller +.oe_form .oe_subtype label, .oe_subtype label + font-weight: normal +.oe_msg_subtype_check + margin: 3px 3px 0 !important +// End of customize + +// Minimized unused white space and label weight for wizard popup +.oe_view_manager_new .oe_form_nosheet + margin-top: 8px + .oe_form_label + font-weight: normal +// End of customize + +// navbar hack {{{ +.navbar + min-height: 32px + margin-bottom: 0px + border: none + z-index: 1 + background-color: #414141 + @include vertical-gradient(#646060, #262626) +.navbar-default + .navbar-nav + li + a:hover,a:focus + background: rgba(0, 0, 0, 0.3) + .open > a,a:hover,a:focus + background: rgba(0, 0, 0, 0.3) !important + .dropdown > a .caret + border-top-color: #777 !important + border-bottom-color: #777 !important +.navbar-nav + li + a + padding: 4px 32px 4px 12px +.dropdown-menu + font-size: 13px + padding: 4px 0 + background: #333333 !important + background: rgba(37, 37, 37, 0.9) !important + border-color: #999999 + border-color: rgba(0, 0, 0, 0.2) + background-color: #414141 + text-shadow: none + @include vertical-gradient(#646060, #262626) + @include radius(3px) + li + a,a:hover,a:focus + color: #eeeeee +// End hack }}} + +// Hack for ui icon {{{ +.ui-icon + width: 18px + height: 18px +// End hack}}} + +input[type="radio"], input[type="checkbox"] + margin-right: 4px + margin-left: 4px + .blockUI.blockOverlay background-color: black opacity: 0.6000000238418579 diff --git a/addons/web/static/src/css/data_export.css b/addons/web/static/src/css/data_export.css index 3fa24265b45..b9b885cd8e9 100644 --- a/addons/web/static/src/css/data_export.css +++ b/addons/web/static/src/css/data_export.css @@ -1,6 +1,11 @@ .openerp .oe_export { width: 100%; } +/* Customize according bootstrap3 */ +.openerp .oe_export label { + font-weight: normal; +} +/* End of customize */ .openerp .oe_export_row tr{ background-color: #FFFFFF; font-size: 0.8em; diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 56559e9edb9..abbd4767361 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -442,10 +442,10 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ self.$el.html(QWeb.render("DatabaseManager", { widget : self })); $('.oe_user_menu_placeholder').append(QWeb.render("DatabaseManager.user_menu",{ widget : self })); $('.oe_secondary_menus_container').append(QWeb.render("DatabaseManager.menu",{ widget : self })); - $('ul.oe_secondary_submenu > li:first').addClass('oe_active'); + $('ul.oe_secondary_submenu > li:first').addClass('active'); $('ul.oe_secondary_submenu > li').bind('click', function (event) { var menuitem = $(this); - menuitem.addClass('oe_active').siblings().removeClass('oe_active'); + menuitem.addClass('active').siblings().removeClass('active'); var form_id =menuitem.find('a').attr('href'); $(form_id).show().siblings().hide(); event.preventDefault(); @@ -969,7 +969,7 @@ instance.web.Menu = instance.web.Widget.extend({ this.needaction_data = data; _.each(this.needaction_data, function (item, menu_id) { var $item = self.$secondary_menus.find('a[data-menu="' + menu_id + '"]'); - $item.find('.oe_menu_counter').remove(); + $item.find('.badge').remove(); if (item.needaction_counter && item.needaction_counter > 0) { $item.append(QWeb.render("Menu.needaction_counter", { widget : item })); } @@ -982,8 +982,8 @@ instance.web.Menu = instance.web.Widget.extend({ reflow: function() { var self = this; this.$el.height('auto').show(); - var $more_container = this.$('.oe_menu_more_container').hide(); - var $more = this.$('.oe_menu_more'); + var $more_container = this.$('#menu_more_container').hide(); + var $more = this.$('#menu_more'); $more.children('li').insertBefore($more_container); var $toplevel_items = this.$el.children('li').not($more_container).hide(); $toplevel_items.each(function() { @@ -1026,8 +1026,8 @@ instance.web.Menu = instance.web.Widget.extend({ } // Activate current main menu - this.$el.find('.oe_active').removeClass('oe_active'); - $main_menu.addClass('oe_active'); + this.$el.find('.active').removeClass('active'); + $main_menu.addClass('active'); // Show current sub menu this.$secondary_menus.find('.oe_secondary_menu').hide(); @@ -1037,13 +1037,13 @@ instance.web.Menu = instance.web.Widget.extend({ this.$secondary_menus.parent('.oe_leftbar').toggle(!!$sub_menu.children().length); // Activate current menu item and show parents - this.$secondary_menus.find('.oe_active').removeClass('oe_active'); + this.$secondary_menus.find('.active').removeClass('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'); + $clicked_menu.parent().addClass('active'); } } }, @@ -1129,7 +1129,7 @@ instance.web.Menu = instance.web.Widget.extend({ }, on_menu_click: function(ev) { ev.preventDefault(); - var needaction = $(ev.target).is('div.oe_menu_counter'); + var needaction = $(ev.target).is('div#menu_counter'); this.menu_click($(ev.currentTarget).data('menu'), needaction); }, }); @@ -1143,7 +1143,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ start: function() { var self = this; this._super.apply(this, arguments); - this.$el.on('click', '.oe_dropdown_menu li a[data-menu]', function(ev) { + this.$el.on('click', '.dropdown-menu li a[data-menu]', function(ev) { ev.preventDefault(); var f = self['on_menu_' + $(this).data('menu')]; if (f) { @@ -1304,7 +1304,7 @@ instance.web.Client = instance.web.Widget.extend({ self.action_manager.appendTo(self.$('.oe_application')); }, toggle_bars: function(value) { - this.$('tr:has(td.oe_topbar),.oe_leftbar').toggle(value); + this.$('tr:has(td.navbar),.oe_leftbar').toggle(value); }, has_uncommitted_changes: function() { return false; diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 60a344467c0..ae7a4f279b0 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -320,7 +320,7 @@
      Database Management
      -
      -
        +