Skip to content

Commit 112fed8

Browse files
committed
[MIG] web_responsive_company_color: Migration to 18.0
1 parent 3f3c63d commit 112fed8

File tree

9 files changed

+58
-39
lines changed

9 files changed

+58
-39
lines changed

web_responsive_company_color/README.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ Usage
4444
Simply install the app. See web_company_color for instructions on how to
4545
customize colors.
4646

47-
Known issues / Roadmap
48-
======================
49-
50-
51-
5247
Bug Tracker
5348
===========
5449

@@ -70,10 +65,11 @@ Authors
7065
Contributors
7166
------------
7267

73-
- PyTech SRL
68+
- `PyTech <https://www.pytech.it>`__:
7469

7570
- Alessandro Uffreduzzi <alessandro.uffreduzzi@pytech.it>
7671
- Anusri Veerappan Prakasam <aprakhasam@nps100.com>
72+
- Simone Rubino <simone.rubino@pytech.it>
7773

7874
Maintainers
7975
-----------

web_responsive_company_color/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Anusri Veerappan Prakasam, Odoo Community Association (OCA)",
66
"website": "https://github.com/OCA/web",
77
"category": "Web",
8-
"version": "16.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"depends": [
1010
"web_company_color",
1111
"web_responsive",
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
from odoo import SUPERUSER_ID, api
2-
3-
4-
def uninstall_hook(cr, registry):
5-
env = api.Environment(cr, SUPERUSER_ID, {})
1+
def uninstall_hook(env):
62
env["res.company"].with_context(uninstall_scss=True).search(
73
[]
84
).scss_create_or_update_attachment()
95

106

11-
def post_init_hook(cr, registry):
12-
env = api.Environment(cr, SUPERUSER_ID, {})
7+
def post_init_hook(env):
138
env["res.company"].search([]).scss_create_or_update_attachment()

web_responsive_company_color/models/res_company.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ def _get_scss_template(self):
1313
return (
1414
super()._get_scss_template()
1515
+ """
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-
}
16+
.app-menu-container {
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+
}
2424
"""
2525
)
2626
return super()._get_scss_template()
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
- PyTech SRL
1+
- [PyTech](https://www.pytech.it):
22
- Alessandro Uffreduzzi \<alessandro.uffreduzzi@pytech.it\>
33
- Anusri Veerappan Prakasam \<aprakhasam@nps100.com\>
4+
- Simone Rubino \<simone.rubino@pytech.it\>

web_responsive_company_color/readme/ROADMAP.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

web_responsive_company_color/static/description/index.html

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,11 @@ <h1 class="title">Web Responsive Company Color</h1>
377377
<div class="contents local topic" id="contents">
378378
<ul class="simple">
379379
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
380-
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
381-
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
382-
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
383-
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
384-
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
385-
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
380+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
381+
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
382+
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
383+
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
384+
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
386385
</ul>
387386
</li>
388387
</ul>
@@ -392,37 +391,35 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
392391
<p>Simply install the app. See web_company_color for instructions on how to
393392
customize colors.</p>
394393
</div>
395-
<div class="section" id="known-issues-roadmap">
396-
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
397-
</div>
398394
<div class="section" id="bug-tracker">
399-
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
395+
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
400396
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
401397
In case of trouble, please check there if your issue has already been reported.
402398
If you spotted it first, help us to smash it by providing a detailed and welcomed
403399
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_responsive_company_color%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
404400
<p>Do not contact contributors directly about support or help with technical issues.</p>
405401
</div>
406402
<div class="section" id="credits">
407-
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
403+
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
408404
<div class="section" id="authors">
409-
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
405+
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
410406
<ul class="simple">
411407
<li>Anusri Veerappan Prakasam</li>
412408
</ul>
413409
</div>
414410
<div class="section" id="contributors">
415-
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
411+
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
416412
<ul class="simple">
417-
<li>PyTech SRL<ul>
413+
<li><a class="reference external" href="https://www.pytech.it">PyTech</a>:<ul>
418414
<li>Alessandro Uffreduzzi &lt;<a class="reference external" href="mailto:alessandro.uffreduzzi&#64;pytech.it">alessandro.uffreduzzi&#64;pytech.it</a>&gt;</li>
419415
<li>Anusri Veerappan Prakasam &lt;<a class="reference external" href="mailto:aprakhasam&#64;nps100.com">aprakhasam&#64;nps100.com</a>&gt;</li>
416+
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;pytech.it">simone.rubino&#64;pytech.it</a>&gt;</li>
420417
</ul>
421418
</li>
422419
</ul>
423420
</div>
424421
<div class="section" id="maintainers">
425-
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
422+
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
426423
<p>This module is maintained by the OCA.</p>
427424
<a class="reference external image-reference" href="https://odoo-community.org">
428425
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import test_res_company
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2025 Simone Rubino - PyTech
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
import base64
5+
6+
from odoo.addons.base.tests.common import BaseCommon
7+
8+
9+
class TestResCompany(BaseCommon):
10+
def test_compiled_scss(self):
11+
"""The SCSS is compiled before being sent to the client."""
12+
# Arrange
13+
company = self.env.company
14+
color = "#d2e1dd"
15+
result_color = "white"
16+
company.color_navbar_bg = color
17+
18+
# Act
19+
company.scss_create_or_update_attachment()
20+
21+
# Assert
22+
attachment = self.env["ir.attachment"].search(
23+
[("url", "=", company.scss_get_url())]
24+
)
25+
css = base64.b64decode(attachment.datas).decode()
26+
self.assertNotIn("desaturate(", css)
27+
self.assertNotIn("lighten(", css)
28+
self.assertIn(f"linear-gradient(to bottom, {color}, {result_color})", css)

0 commit comments

Comments
 (0)