Skip to content

Commit 8525963

Browse files
committed
[MIG] web_responsive_company_color: Migration to 16.0
1 parent 858afc9 commit 8525963

File tree

10 files changed

+27
-43
lines changed

10 files changed

+27
-43
lines changed

web_responsive_company_color/README.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Web Responsive Company Color
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:95f3f27e763cdc5439f6171ba4f43af70f47d1cac864b762727d1e64dda9cc69
10+
!! source digest: sha256:44f0095f8dc814ced83dd988cb51fdb49cfc33c0c743cf0c13020b870e94cee6
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -42,8 +42,6 @@ Usage
4242

4343
Simply install the app. See web_company_color for instructions on how to customize colors.
4444

45-
If new elements are included for customization under scss_template, one needs to reinstall the app to view customized colors.
46-
4745
Bug Tracker
4846
===========
4947

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from . import models
2-
from .hooks import post_init_hook
2+
from .hooks import post_init_hook, uninstall_hook

web_responsive_company_color/__manifest__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"author": "Anusri Veerappan Prakasam, Odoo Community Association (OCA)",
66
"website": "https://github.com/OCA/web",
77
"category": "Web",
8-
"version": "14.0.1.0.0",
8+
"version": "16.0.1.0.0",
99
"depends": [
1010
"web_company_color",
1111
"web_responsive",
1212
],
1313
"data": [],
1414
"post_init_hook": "post_init_hook",
15+
"uninstall_hook": "uninstall_hook",
1516
"installable": True,
1617
"application": False,
1718
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
from odoo import SUPERUSER_ID, api
22

33

4+
def uninstall_hook(cr, registry):
5+
env = api.Environment(cr, SUPERUSER_ID, {})
6+
env["res.company"].with_context(uninstall_scss=True).search(
7+
[]
8+
).scss_create_or_update_attachment()
9+
10+
411
def post_init_hook(cr, registry):
512
env = api.Environment(cr, SUPERUSER_ID, {})
613
env["res.company"].search([]).scss_create_or_update_attachment()
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
from . import res_company
2-
from . import ir_module

web_responsive_company_color/models/ir_module.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

web_responsive_company_color/models/res_company.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@
44
class ResCompany(models.Model):
55
_inherit = "res.company"
66

7-
# One need to reinstall web_responsive_company_color module
8-
# to see customization takes effect when new elements added
9-
# to _get_scss_template
7+
# For customizations of new web elements included
8+
# under _get_scss_template to take effect, one need
9+
# to handle migration to invoke post_init_hook()
1010
def _get_scss_template(self):
1111
uninstall_scss = self._context.get("uninstall_scss", False)
1212
if not uninstall_scss:
1313
return (
1414
super()._get_scss_template()
1515
+ """
16-
.o_menu_apps .dropdown-menu {
17-
background: url('/web_responsive/static/img/home-menu-bg-overlay.svg'),
18-
linear-gradient(
19-
to bottom,
20-
%(color_navbar_bg)s,
21-
desaturate(lighten(%(color_navbar_bg)s, 20%%), 15)
22-
);
23-
}
24-
"""
16+
.o_navbar_apps_menu .dropdown-menu-custom {
17+
background: url('/web_responsive/static/src/img/home-menu-bg-overlay.svg'),
18+
linear-gradient(
19+
to bottom,
20+
%(color_navbar_bg)s,
21+
desaturate(lighten(%(color_navbar_bg)s, 20%%), 15)
22+
);
23+
}
24+
"""
2525
)
26-
else:
27-
return super()._get_scss_template()
26+
return super()._get_scss_template()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* PyTech SRL
22
* Alessandro Uffreduzzi <[email protected]>
3-
* Anusri Veerappan Prakasam <[email protected]>
3+
* Anusri Veerappan Prakasam <[email protected]>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Simply install the app. See web_company_color for instructions on how to customize colors.
2-
3-
If new elements are included for customization under scss_template, one needs to reinstall the app to view customized colors.
1+
Simply install the app. See web_company_color for instructions on how to customize colors.

web_responsive_company_color/static/description/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Web Responsive Company Color</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:95f3f27e763cdc5439f6171ba4f43af70f47d1cac864b762727d1e64dda9cc69
370+
!! source digest: sha256:44f0095f8dc814ced83dd988cb51fdb49cfc33c0c743cf0c13020b870e94cee6
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372372
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/16.0/web_responsive_company_color"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_responsive_company_color"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module bridges web_company_color with web_responsive.</p>
@@ -388,7 +388,6 @@ <h1 class="title">Web Responsive Company Color</h1>
388388
<div class="section" id="usage">
389389
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
390390
<p>Simply install the app. See web_company_color for instructions on how to customize colors.</p>
391-
<p>If new elements are included for customization under scss_template, one needs to reinstall the app to view customized colors.</p>
392391
</div>
393392
<div class="section" id="bug-tracker">
394393
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>

0 commit comments

Comments
 (0)