padding-bottom: 16px;
}
.openerp a.oe_logo {
+ position: relative;
width: 220px;
display: block;
text-align: center;
margin: 14px 0;
border: 0;
}
+.openerp a.oe_logo .oe_logo_edit {
+ margin: 14px 0;
+ position: absolute;
+ top: 1px;
+ padding: 4px;
+ width: 100%;
+ display: none;
+ text-align: center;
+ color: #eeeeee;
+ background: rgba(37, 37, 37, 0.9);
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.openerp a.oe_logo:hover .oe_logo_edit_admin {
+ display: block;
+}
.openerp .oe_footer {
position: fixed;
bottom: 0;
text-shadow: 0 1px 1px white
padding-bottom: 16px
a.oe_logo
+ position: relative
width: 220px
display: block
text-align: center
img
margin: 14px 0
border: 0
+ .oe_logo_edit
+ margin: 14px 0
+ position: absolute
+ top: 1px
+ padding: 4px
+ width: 100%
+ display: none
+ text-align: center
+ color: #eee
+ background: rgba(37,37,37,0.9)
+ @include box-sizing(border)
+ &:hover .oe_logo_edit_admin
+ display: block
.oe_footer
position: fixed
bottom: 0
instance.web.WebClient = instance.web.Client.extend({
_template: 'WebClient',
+ events: {
+ 'click .oe_logo_edit_admin': 'logo_edit'
+ },
init: function(parent) {
this._super(parent);
this._current_state = null;
},
update_logo: function() {
var img = this.session.url('/web/binary/company_logo');
- this.$el.find('.oe_logo img').attr('src', '').attr('src', img);
+ this.$('.oe_logo img').attr('src', '').attr('src', img);
+ this.$('.oe_logo_edit').toggleClass('oe_logo_edit_admin', this.session.uid === 1);
+ },
+ logo_edit: function(ev) {
+ var self = this;
+ new instance.web.Model("res.users").get_func("read")(this.session.uid, ["company_id"]).then(function(res) {
+ self.rpc("/web/action/load", { action_id: "base.action_res_company_form" }).done(function(result) {
+ result.res_id = res['company_id'][0];
+ result.target = "new";
+ result.views = [[false, 'form']];
+ result.flags = {
+ action_buttons: true,
+ };
+ self.action_manager.do_action(result);
+ var form = self.action_manager.dialog_widget.views.form.controller;
+ form.on("on_button_cancel", self.action_manager.dialog, self.action_manager.dialog.close);
+ form.on('record_saved', self, function() {
+ self.action_manager.dialog.close();
+ self.update_logo();
+ });
+ });
+ });
+ return false;
},
check_timezone: function() {
var self = this;
<tr>
<td class="oe_leftbar" valign="top">
<t t-set="debug" t-value="__debug__ ? '&debug' : ''"/>
- <a class="oe_logo" t-attf-href="/?ts=#{Date.now()}#{debug}"><img t-att-src='widget.session.url("/web/binary/company_logo")'/></a>
+ <a class="oe_logo" t-attf-href="/?ts=#{Date.now()}#{debug}">
+ <span class="oe_logo_edit">Edit Company data</span>
+ <img t-att-src='widget.session.url("/web/binary/company_logo")'/>
+ </a>
<div class="oe_secondary_menus_container"/>
<div class="oe_footer">
Powered by <a href="http://www.openerp.com" target="_blank"><span>OpenERP</span></a>