diff --git a/web_favicon/README.rst b/web_favicon/README.rst index c9bb1ddb8..be9fd7a51 100644 --- a/web_favicon/README.rst +++ b/web_favicon/README.rst @@ -1,25 +1,33 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 -==================== -Custom shortcut icon -==================== +============================== +Custom shortcut icon (favicon) +============================== This module was written to allow you to customize your Odoo instance's shortcut icon (aka favicon). This is useful for branding purposes, but also for integrators who have many different Odoo instances running and need to see at a glance which browser tab does what. +More info about favicon: https://en.wikipedia.org/wiki/Favicon + Configuration ============= -Upload your favicon (16x16, 32x32 or 64x64 pixels, 16 colors) on the company -form. The file format whould be ico, gif or png with 16x16, 32x32 or 64x64 -pixels and 16 colors. +Upload your favicon (16x16, 32x32, 64x64 or "as big as possible") on the +company form. The file format would be ico, gif or png with 16x16, 32x32 or +64x64 pixels and 16 colors. Highers resolutions or colors support depends on +the used browser, but most modern browsers do. Note that most browsers cache favicons basically forever, so if you want your icon to show up, you'll most probably have to delete you browser cache. +You have a sample SVG that can be used as template for generating your icon +in /static/src/img/master_original_favicon.svg. You can also search for some +favicon generators across the web. + Usage ===== @@ -27,14 +35,15 @@ Usage :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/162/8.0 -For further information, please visit: - -* https://www.odoo.com/forum/help-1 - Known issues / Roadmap ====================== -* allow to upload some big icon (preferrably SVG or the like) and generate icons suitable for mobile devices +* Allow to upload some big icon (preferrably SVG or the like) and generate + all the icons from it +* Generate icons suitable for mobile devices and web apps (see /static/src/img/ + folder inside the module for a sample of the possible current formats. +* Put the icon definition at system level, not at company level. It doesn't + make sense (as the icon is cached) to have a different icon per company. Bug Tracker =========== @@ -42,7 +51,9 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. +`here `_. Credits ======= @@ -51,6 +62,7 @@ Contributors ------------ * Holger Brunn +* Pedro M. Baeza Maintainer ---------- @@ -65,4 +77,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/web_favicon/__init__.py b/web_favicon/__init__.py index d8724ec7a..a2666d4d3 100644 --- a/web_favicon/__init__.py +++ b/web_favicon/__init__.py @@ -1,21 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import models from . import controllers diff --git a/web_favicon/__openerp__.py b/web_favicon/__openerp__.py index 10d188004..b6d6491fa 100644 --- a/web_favicon/__openerp__.py +++ b/web_favicon/__openerp__.py @@ -1,29 +1,17 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV +# © 2016 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + { "name": "Custom shortcut icon", "version": "8.0.1.0.0", - "author": "Therp BV,Odoo Community Association (OCA)", + "author": "Therp BV, " + "Tecnativa, " + "Odoo Community Association (OCA)", "license": "AGPL-3", "category": "Website", - "summary": "Allows to set a custom shortcut icon", + "summary": "Allows to set a custom shortcut icon (aka favicon)", "depends": [ 'web', ], @@ -31,14 +19,5 @@ "views/res_company.xml", 'views/templates.xml', ], - "qweb": [ - ], - "test": [ - ], - "auto_install": False, "installable": True, - "application": False, - "external_dependencies": { - 'python': [], - }, } diff --git a/web_favicon/controllers/__init__.py b/web_favicon/controllers/__init__.py index 5c319aec6..7c3fa3f84 100644 --- a/web_favicon/controllers/__init__.py +++ b/web_favicon/controllers/__init__.py @@ -1,20 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import web_favicon diff --git a/web_favicon/controllers/web_favicon.py b/web_favicon/controllers/web_favicon.py index f9212ce42..f0b92aa0c 100644 --- a/web_favicon/controllers/web_favicon.py +++ b/web_favicon/controllers/web_favicon.py @@ -1,22 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + import StringIO import base64 from openerp import http diff --git a/web_favicon/models/__init__.py b/web_favicon/models/__init__.py index 6c860e44a..54d77ccf2 100644 --- a/web_favicon/models/__init__.py +++ b/web_favicon/models/__init__.py @@ -1,20 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import res_company diff --git a/web_favicon/models/res_company.py b/web_favicon/models/res_company.py index 6f54bb465..e30c1b2ad 100644 --- a/web_favicon/models/res_company.py +++ b/web_favicon/models/res_company.py @@ -1,22 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV +# © 2016 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from openerp import models, fields @@ -24,6 +10,8 @@ class ResCompany(models.Model): _inherit = 'res.company' favicon_backend = fields.Binary() - favicon_backend_mimetype = fields.Char( - help='Set the mimetype of your file. Usually, that\'s one of\n' - 'image/x-icon, image/gif, image/png') + favicon_backend_mimetype = fields.Selection( + selection=[('image/x-icon', 'image/x-icon'), + ('image/gif', 'image/gif'), + ('image/png', 'image/png')], + help='Set the mimetype of your file.') diff --git a/web_favicon/static/description/icon.png b/web_favicon/static/description/icon.png index 3a0328b51..bc0090b3d 100644 Binary files a/web_favicon/static/description/icon.png and b/web_favicon/static/description/icon.png differ diff --git a/web_favicon/static/src/img/android-chrome-144x144.png b/web_favicon/static/src/img/android-chrome-144x144.png new file mode 100644 index 000000000..47cbf21af Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-144x144.png differ diff --git a/web_favicon/static/src/img/android-chrome-192x192.png b/web_favicon/static/src/img/android-chrome-192x192.png new file mode 100644 index 000000000..95dd0dfc4 Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-192x192.png differ diff --git a/web_favicon/static/src/img/android-chrome-36x36.png b/web_favicon/static/src/img/android-chrome-36x36.png new file mode 100644 index 000000000..046b7266d Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-36x36.png differ diff --git a/web_favicon/static/src/img/android-chrome-48x48.png b/web_favicon/static/src/img/android-chrome-48x48.png new file mode 100644 index 000000000..5a31a338d Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-48x48.png differ diff --git a/web_favicon/static/src/img/android-chrome-72x72.png b/web_favicon/static/src/img/android-chrome-72x72.png new file mode 100644 index 000000000..1e22c5202 Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-72x72.png differ diff --git a/web_favicon/static/src/img/android-chrome-96x96.png b/web_favicon/static/src/img/android-chrome-96x96.png new file mode 100644 index 000000000..63ba2618c Binary files /dev/null and b/web_favicon/static/src/img/android-chrome-96x96.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-114x114.png b/web_favicon/static/src/img/apple-touch-icon-114x114.png new file mode 100644 index 000000000..0aaacd347 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-114x114.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-120x120.png b/web_favicon/static/src/img/apple-touch-icon-120x120.png new file mode 100644 index 000000000..3909ec7f0 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-120x120.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-144x144.png b/web_favicon/static/src/img/apple-touch-icon-144x144.png new file mode 100644 index 000000000..f295122a6 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-144x144.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-152x152.png b/web_favicon/static/src/img/apple-touch-icon-152x152.png new file mode 100644 index 000000000..93fd730ba Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-152x152.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-180x180.png b/web_favicon/static/src/img/apple-touch-icon-180x180.png new file mode 100644 index 000000000..2899fa5da Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-180x180.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-57x57.png b/web_favicon/static/src/img/apple-touch-icon-57x57.png new file mode 100644 index 000000000..1f06b9f29 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-57x57.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-60x60.png b/web_favicon/static/src/img/apple-touch-icon-60x60.png new file mode 100644 index 000000000..715f33398 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-60x60.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-72x72.png b/web_favicon/static/src/img/apple-touch-icon-72x72.png new file mode 100644 index 000000000..6e869d454 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-72x72.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-76x76.png b/web_favicon/static/src/img/apple-touch-icon-76x76.png new file mode 100644 index 000000000..490ff715a Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-76x76.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon-precomposed.png b/web_favicon/static/src/img/apple-touch-icon-precomposed.png new file mode 100644 index 000000000..2b3af81e8 Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon-precomposed.png differ diff --git a/web_favicon/static/src/img/apple-touch-icon.png b/web_favicon/static/src/img/apple-touch-icon.png new file mode 100644 index 000000000..2899fa5da Binary files /dev/null and b/web_favicon/static/src/img/apple-touch-icon.png differ diff --git a/web_favicon/static/src/img/browserconfig.xml b/web_favicon/static/src/img/browserconfig.xml new file mode 100644 index 000000000..fe44cae80 --- /dev/null +++ b/web_favicon/static/src/img/browserconfig.xml @@ -0,0 +1,12 @@ + + + + + + + + + #da532c + + + diff --git a/web_favicon/static/src/img/favicon-16x16.png b/web_favicon/static/src/img/favicon-16x16.png new file mode 100644 index 000000000..b9f30800c Binary files /dev/null and b/web_favicon/static/src/img/favicon-16x16.png differ diff --git a/web_favicon/static/src/img/favicon-32x32.png b/web_favicon/static/src/img/favicon-32x32.png new file mode 100644 index 000000000..8e73a1639 Binary files /dev/null and b/web_favicon/static/src/img/favicon-32x32.png differ diff --git a/web_favicon/static/src/img/favicon-96x96.png b/web_favicon/static/src/img/favicon-96x96.png new file mode 100644 index 000000000..63ba2618c Binary files /dev/null and b/web_favicon/static/src/img/favicon-96x96.png differ diff --git a/web_favicon/static/src/img/favicon.ico b/web_favicon/static/src/img/favicon.ico new file mode 100644 index 000000000..cdf7926f9 Binary files /dev/null and b/web_favicon/static/src/img/favicon.ico differ diff --git a/web_favicon/static/src/img/manifest.json b/web_favicon/static/src/img/manifest.json new file mode 100644 index 000000000..0f649d7b5 --- /dev/null +++ b/web_favicon/static/src/img/manifest.json @@ -0,0 +1,41 @@ +{ + "name": "Odoo", + "icons": [ + { + "src": "\/android-chrome-36x36.png", + "sizes": "36x36", + "type": "image\/png", + "density": "0.75" + }, + { + "src": "\/android-chrome-48x48.png", + "sizes": "48x48", + "type": "image\/png", + "density": "1.0" + }, + { + "src": "\/android-chrome-72x72.png", + "sizes": "72x72", + "type": "image\/png", + "density": "1.5" + }, + { + "src": "\/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image\/png", + "density": "2.0" + }, + { + "src": "\/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image\/png", + "density": "3.0" + }, + { + "src": "\/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image\/png", + "density": "4.0" + } + ] +} diff --git a/web_favicon/static/src/img/master_original_favicon.png b/web_favicon/static/src/img/master_original_favicon.png new file mode 100644 index 000000000..22a0aa8fb Binary files /dev/null and b/web_favicon/static/src/img/master_original_favicon.png differ diff --git a/web_favicon/static/src/img/master_original_favicon.svg b/web_favicon/static/src/img/master_original_favicon.svg new file mode 100644 index 000000000..078a9ef3f --- /dev/null +++ b/web_favicon/static/src/img/master_original_favicon.svg @@ -0,0 +1,56 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/web_favicon/static/src/img/mstile-144x144.png b/web_favicon/static/src/img/mstile-144x144.png new file mode 100644 index 000000000..e44e23675 Binary files /dev/null and b/web_favicon/static/src/img/mstile-144x144.png differ diff --git a/web_favicon/static/src/img/mstile-150x150.png b/web_favicon/static/src/img/mstile-150x150.png new file mode 100644 index 000000000..96b4e8657 Binary files /dev/null and b/web_favicon/static/src/img/mstile-150x150.png differ diff --git a/web_favicon/static/src/img/mstile-310x150.png b/web_favicon/static/src/img/mstile-310x150.png new file mode 100644 index 000000000..a924d3ffd Binary files /dev/null and b/web_favicon/static/src/img/mstile-310x150.png differ diff --git a/web_favicon/static/src/img/mstile-310x310.png b/web_favicon/static/src/img/mstile-310x310.png new file mode 100644 index 000000000..b9b4a3e83 Binary files /dev/null and b/web_favicon/static/src/img/mstile-310x310.png differ diff --git a/web_favicon/static/src/img/mstile-70x70.png b/web_favicon/static/src/img/mstile-70x70.png new file mode 100644 index 000000000..c02805fe1 Binary files /dev/null and b/web_favicon/static/src/img/mstile-70x70.png differ diff --git a/web_favicon/static/src/img/website_favicon_sample.html b/web_favicon/static/src/img/website_favicon_sample.html new file mode 100644 index 000000000..db828882d --- /dev/null +++ b/web_favicon/static/src/img/website_favicon_sample.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web_favicon/tests/__init__.py b/web_favicon/tests/__init__.py index 15f22fcad..6a5f7312d 100644 --- a/web_favicon/tests/__init__.py +++ b/web_favicon/tests/__init__.py @@ -1,20 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import test_web_favicon diff --git a/web_favicon/tests/test_web_favicon.py b/web_favicon/tests/test_web_favicon.py index 0301639c2..2af4f83c2 100644 --- a/web_favicon/tests/test_web_favicon.py +++ b/web_favicon/tests/test_web_favicon.py @@ -1,22 +1,7 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + import base64 from openerp.tests.common import TransactionCase from openerp.tools.misc import file_open