Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How change the logo size?

By
Gabriel Giani Moreno
on 5/6/16, 11:00 AM 1,291 views

I need to change the logo size in my website:

I try changing this:

In the HTML Editor

<?xml version="1.0"?>

<data inherit_id="website.layout" customize_show="True" name="Show Logo">

<xpath expr="//header//a[@class='navbar-brand']" position="replace">

<a href="/" class="navbar-brand logo">

<img src="/logo.png" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" width=200 height=150 />

</a>

</xpath>

</data>


But only i can change the width but not the height.


Some people can help me?


Best Regards.

0
Jose Vasquez
On 5/6/16, 12:47 PM

Hi Gabriel,

Try this:

<img t-att-src="'/logo.png;base64,'" Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-width: 200px; max-height: 150px;"/>

I hope to help you, regards.

Thanks Jose! This solution work for me!

Gabriel Giani Moreno
on 5/7/16, 9:38 AM
0

Prakash Sharma

--Prakash Sharma--
815
| 2 1 4
Delhi, India
--Prakash Sharma--

I like to surround myself with brave, creative people.

My motivation for learning different technologies and algos drive me. I love challenges of a steep learning curve which I believe makes me a better learner. I have a strong desire to learn different technologies, which would enable me to become a full stack developer.

Prakash Sharma
On 5/6/16, 11:32 AM

override the css:

.openerp .oe_leftbar > div a.oe_logo img {height: 50px;width: 50px;margin14px 0;border0}

header a.navbar-brand img {

max-height: 83px;

height: 100px;

width: 190px;

}

0

Ermin Trevisan

--Ermin Trevisan--
3548
| 6 3 7
Walchwil, Switzerland
--Ermin Trevisan--


Ermin Trevisan
On 5/7/16, 3:02 AM

Well, the problem is, that changing the size of the logo is only a part of the job. You do also have to adjust the height of the navbar and the vertical alignment of the menu accordingly.

Check http://www.restaurant-roessli.ch

I'm not a developer, so I did that in very nasty way manually using the HTML-Editor (Logo size 100px):

Main Layout:

<body>

<div id="wrapwrap">

<header>

<div class="navbar navbar-default navbar-static-top" style="height:120px">

<div class="container">

<div class="navbar-header" style="margin-top:-17px">

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse">

<span class="sr-only">Toggle navigation</span>

...

Show_logo:

<data inherit_id="website.layout" customize_show="True" name="Show Logo">

<xpath expr="//header//a[@class='navbar-brand']" position="replace">

<a href="/" class="navbar-brand logo">

<img src="/logo.png" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-height:100px"/>

</a>

</xpath>

</data>

Anybody willing to automate that and publishing a small module, which allows to enter the required logo size and then adjusts everything automatically?

0
Edser Solis
On 5/6/16, 11:33 AM

Hello Gabriel, what do you mean you can only change the width? 

Odoo will keep the proportions of your logo, see those measures as limits and consider that it will take the one that meets first.

If you're looking to change the proportions you have to use a tool intended for that. 

0

 

Finally i used this solution propossal:

Thanks a lot!!

<img t-att-src="'/logo.png;base64,'" Logo of %s' % res_company.name" t-att-title="res_company.name" style="max-width: 200px; max-height: 150px;"/>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/6/16, 11:00 AM
Seen: 1291 times
Last updated: 5/7/16, 9:37 AM