Browse Source

[MIG] web_favicon: Migrated to 10.0 (#459)

pull/800/head
Niki Waibel 8 years ago
committed by Pedro M. Baeza
parent
commit
ab90a5e0b5
  1. 4
      web_favicon/README.rst
  2. 2
      web_favicon/__manifest__.py
  3. 4
      web_favicon/controllers/web_favicon.py
  4. 2
      web_favicon/models/res_company.py
  5. 8
      web_favicon/tests/test_web_favicon.py
  6. 10
      web_favicon/views/res_company.xml
  7. 6
      web_favicon/views/templates.xml

4
web_favicon/README.rst

@ -35,7 +35,7 @@ Usage
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/162/9.0
:target: https://runbot.odoo-community.org/runbot/162/10.0
Known issues / Roadmap Known issues / Roadmap
====================== ======================
@ -55,7 +55,7 @@ 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 If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/web/issues/new?body=module:%20 `here <https://github.com/OCA/web/issues/new?body=module:%20
web_favicon%0Aversion:%20 web_favicon%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
10.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits Credits
======= =======

2
web_favicon/__openerp__.py → web_favicon/__manifest__.py

@ -5,7 +5,7 @@
{ {
"name": "Custom shortcut icon", "name": "Custom shortcut icon",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"author": "Therp BV, " "author": "Therp BV, "
"Tecnativa, " "Tecnativa, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",

4
web_favicon/controllers/web_favicon.py

@ -4,8 +4,8 @@
import StringIO import StringIO
import base64 import base64
from openerp import http
from openerp.tools.misc import file_open
from odoo import http
from odoo.tools.misc import file_open
class WebFavicon(http.Controller): class WebFavicon(http.Controller):

2
web_favicon/models/res_company.py

@ -3,7 +3,7 @@
# © 2016 Pedro M. Baeza # © 2016 Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields
from odoo import models, fields
class ResCompany(models.Model): class ResCompany(models.Model):

8
web_favicon/tests/test_web_favicon.py

@ -3,9 +3,9 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import base64 import base64
from openerp.tests.common import TransactionCase
from openerp.tools.misc import file_open
from openerp import http
from odoo.tests.common import TransactionCase
from odoo.tools.misc import file_open
from odoo import http
class FakeRequest(object): class FakeRequest(object):
@ -26,7 +26,7 @@ class TestWebFavicon(TransactionCase):
def test_web_favicon(self): def test_web_favicon(self):
original_request = http.request original_request = http.request
http.request = FakeRequest(self.env) http.request = FakeRequest(self.env)
from openerp.addons.web_favicon.controllers.web_favicon import\
from odoo.addons.web_favicon.controllers.web_favicon import\
WebFavicon WebFavicon
company = self.env['res.company'].search([], limit=1) company = self.env['res.company'].search([], limit=1)
# default icon # default icon

10
web_favicon/views/res_company.xml

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<odoo>
<record id="view_company_form" model="ir.ui.view"> <record id="view_company_form" model="ir.ui.view">
<field name="model">res.company</field> <field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" /> <field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<page name="configuration" position="inside">
<notebook position="inside">
<page string="Web Favicon" name="favicon">
<group string="Favicon" name="favicon"> <group string="Favicon" name="favicon">
<field name="favicon_backend" widget="image" /> <field name="favicon_backend" widget="image" />
<field name="favicon_backend_mimetype" attrs="{'required': [('favicon_backend', '!=', False)]}" /> <field name="favicon_backend_mimetype" attrs="{'required': [('favicon_backend', '!=', False)]}" />
</group> </group>
</page> </page>
</notebook>
</field> </field>
</record> </record>
</data>
</openerp>
</odoo>

6
web_favicon/views/templates.xml

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<odoo>
<template id="layout" inherit_id="web.layout"> <template id="layout" inherit_id="web.layout">
<xpath expr="//link[@rel='shortcut icon']" position="replace"> <xpath expr="//link[@rel='shortcut icon']" position="replace">
<link rel="icon" href="/web_favicon/favicon" /> <link rel="icon" href="/web_favicon/favicon" />
</xpath> </xpath>
</template> </template>
</data>
</openerp>
</odoo>
Loading…
Cancel
Save