11.0 mig website_logo - #470
Conversation
| 'views/website_templates.xml', | ||
| ], | ||
| 'qweb': [ | ||
| ], |
| "LasLabs, " | ||
| "Tecnativa, " | ||
| "Odoo Community Association (OCA)", | ||
| 'website': 'http://www.agilebg.com', |
|
|
||
| logo = fields.Binary( | ||
| string="Website logo", related="website_id.logo", | ||
| help="This field holds the logo for this website, showed in header." |
There was a problem hiding this comment.
no need to repeat params on related field
| '/website_logo', | ||
| '/website_logo.png', | ||
| ], type='http', auth="none", cors="*") | ||
| def website_logo(self, dbname=None, **kw): |
There was a problem hiding this comment.
question: do we really need this whole machinery just to get the logo?
Why can't we simply get current website from request and grab logo value?
There was a problem hiding this comment.
We can use current website method and obtain the current website, but this method, if it not find a website that has the current domain, return the firs website un database. But, with the current code, if it not find a website tha has the current domain, it try to find a website that has the 'localhost' domain. That is a differece. If it doesn't matter, we can use the method.
| '/website_logo.png', | ||
| ], type='http', auth="none", cors="*") | ||
| def website_logo(self, dbname=None, **kw): | ||
| imgname = 'website_nologo.png' |
There was a problem hiding this comment.
nologo image seems empty, am I wrong? Should we have a no logo image or the default odoo one?
There was a problem hiding this comment.
It is the text placed in Usage section of README.rst, it was written before the migration:
This addon supports multi-website. If no logo is defined, a transparent image is
placed, allowing to have no logo in one website, even if "Show logo" option is
set.
| Name, favicon and logo of your website | ||
| </div> | ||
| </xpath> | ||
| <xpath expr="//div[@id='domain_setting']//field[@name='favicon']/.." position="after"> |
There was a problem hiding this comment.
shouldn't we state that png format is required?
|
cc @Tecnativa |
|
Tested funcionally 👍 |
rafaelbn
left a comment
There was a problem hiding this comment.
Functionaly tested 👍
Please @chienandalu @simahawk @MeetKD could you make here last review in technical staff ? Thank you!
yajo
left a comment
There was a problem hiding this comment.
Lol, I expected to see something more, but code is OK besides some unneeded whitespace and comments. It would be great if you can clean those.
| @@ -1,4 +1,3 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| @@ -1,3 +1,2 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| @@ -1,8 +1,8 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| @@ -1,4 +1,3 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| @@ -1,4 +1,3 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| @@ -1,3 +1,2 @@ | |||
| # -*- coding: utf-8 -*- | |||
|
|
|||
| self.cont_obj = Website() | ||
| self.rec_id = self.env.ref('base.main_company') | ||
| self.image_val = 'Test'.encode('base64') | ||
| # self.image_val = 'Test'.encode('base64') |
| <field name="logo" widget="image"/> | ||
| </div> | ||
| </xpath> | ||
|
|
|
@yajo is a pyromaniacal 😝 |
Changes include: - update version number - make module installable - In company_view use an xpath expression to add logo configuration to company view.
In view, logo field should come after the 'Domain' group, which is the first group when searching by XPath.
Tests are taken from commit: c1c9d53
…* Remove duplicated http send in favor of pass * Fix broken test for exception handling
* [FIX] website_logo: show logo by domain Use domain field to match a logo by website instead of the name field of the website model. * [FIX] website_logo update readme The logo is now configured from 'Website admin' instead of 'Company settings'.
a0273c3 to
ec2156b
Compare
cc @Tecnativa