summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-04-28 01:41:19 +0200
committerAntony Lesuisse <al@openerp.com>2012-04-28 01:41:19 +0200
commit40091fe2bfefb10ff51be4a876eae6aa44ac96c2 (patch)
tree0d8a992c60c631618226e288c74a7df11706953b /addons/web/static/src
parentd3c48fca122e88e3fa8424aaa19c009fddaf783f (diff)
form hide sidebar in edit mode
bzr revid: al@openerp.com-20120427234119-6qzy2essj12d63n4
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/css/base.css4
-rw-r--r--addons/web/static/src/css/base.sass3
-rw-r--r--addons/web/static/src/js/view_form.js4
3 files changed, 10 insertions, 1 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 4faee96aac6..c960b6ed39d 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -1513,6 +1513,10 @@
right: 5px;
top: 3px;
}
+.openerp .oe_form .oe_form_button > img {
+ vertical-align: -3px;
+ padding: 0 2px;
+}
.openerp .oe_form .oe-binary-file-set {
overflow: hidden;
position: relative;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 08ce0d40144..63ed68a7b67 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -1242,6 +1242,9 @@ $colour4: #8a89ba
filter: alpha(opacity=50)
right: 5px
top: 3px
+ .oe_form_button > img
+ vertical-align: -3px
+ padding: 0 2px
// }}}
// FormView.binaryfile {{{
/* http://www.quirksmode.org/dom/inputfile.html
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 649b7b38a7b..53038ff1e11 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -80,7 +80,6 @@ instance.web.FormView = instance.web.View.extend({
this.rendering_engine.render_to($dest);
}
- this.$sidebar = this.options.$sidebar || this.$element.find('.oe_form_sidebar');
this.$buttons = $(QWeb.render("FormView.buttons", {'widget':self}));
if (this.options.$buttons) {
@@ -104,6 +103,7 @@ instance.web.FormView = instance.web.View.extend({
self.on_pager_action(action);
});
+ this.$sidebar = this.options.$sidebar || this.$element.find('.oe_form_sidebar');
if (!this.sidebar && this.options.$sidebar) {
this.sidebar = new instance.web.Sidebar(this);
this.sidebar.appendTo(this.$sidebar);
@@ -497,12 +497,14 @@ instance.web.FormView = instance.web.View.extend({
if(this.get("mode") == "view") {
self.$buttons.find('.oe_form_buttons_edit').hide();
self.$buttons.find('.oe_form_buttons_view').show();
+ self.$sidebar.show();
_.each(this.fields,function(field){
field.set({"force_readonly": true});
});
} else {
self.$buttons.find('.oe_form_buttons_edit').show();
self.$buttons.find('.oe_form_buttons_view').hide();
+ self.$sidebar.hide();
_.each(this.fields,function(field){
field.set({"force_readonly": false});
});