Skip to content

Commit e3e71ef

Browse files
committed
[MIG] fermente_web_environment_ribbon
1 parent 0573806 commit e3e71ef

File tree

12 files changed

+142
-0
lines changed

12 files changed

+142
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
=================================
2+
Fermente - Web Environment Ribbon
3+
=================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:2c71deb1b250ee9f84e97810896da25b3401eb28ab9f0de8d1a46055dd926a2b
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-grap%2Fgrap--odoo--custom-lightgray.png?logo=github
20+
:target: https://github.com/grap/grap-odoo-custom/tree/18.0/fermente_web_environment_ribbon
21+
:alt: grap/grap-odoo-custom
22+
23+
|badge1| |badge2| |badge3|
24+
25+
Customize OCA / web / ``web_environment_ribbon`` module.
26+
27+
- Change the text present in the ribbon, splitting the name of the
28+
database in two lines, to improve visibility.
29+
30+
- change style.
31+
32+
**Without the module**
33+
34+
..figure :: ../static/description/01_without_module.png
35+
36+
**With the module**
37+
38+
..figure :: ../static/description/02_with_module.png
39+
40+
**Table of contents**
41+
42+
.. contents::
43+
:local:
44+
45+
Bug Tracker
46+
===========
47+
48+
Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-custom/issues>`_.
49+
In case of trouble, please check there if your issue has already been reported.
50+
If you spotted it first, help us to smash it by providing a detailed and welcomed
51+
`feedback <https://github.com/grap/grap-odoo-custom/issues/new?body=module:%20fermente_web_environment_ribbon%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
52+
53+
Do not contact contributors directly about support or help with technical issues.
54+
55+
Credits
56+
=======
57+
58+
Authors
59+
-------
60+
61+
* GRAP
62+
63+
Contributors
64+
------------
65+
66+
- Sylvain LE GAL (https://www.twitter.com/legalsylvain)
67+
68+
Maintainers
69+
-----------
70+
71+
This module is part of the `grap/grap-odoo-custom <https://github.com/grap/grap-odoo-custom/tree/18.0/fermente_web_environment_ribbon>`_ project on GitHub.
72+
73+
You are welcome to contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
2+
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
{
6+
"name": "Fermente - Web Environment Ribbon",
7+
"version": "18.0.1.0.1",
8+
"category": "Web",
9+
"author": "GRAP",
10+
"website": "https://github.com/grap/grap-odoo-custom",
11+
"license": "AGPL-3",
12+
"depends": ["web_environment_ribbon"],
13+
"assets": {
14+
"web.assets_backend": [
15+
"/fermente_web_environment_ribbon/static/src/scss/fermente_web_environment_ribbon.scss",
16+
],
17+
},
18+
}

fermente_web_environment_ribbon/i18n/fr.po

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import web_environment_ribbon_backend
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from odoo import api, models
2+
3+
4+
class WebEnvironmentRibbonBackend(models.AbstractModel):
5+
_inherit = "web.environment.ribbon.backend"
6+
7+
@api.model
8+
def _prepare_ribbon_format_vals(self):
9+
res = super()._prepare_ribbon_format_vals()
10+
splitted = res["db_name"].split("__")
11+
if len(splitted) == 3:
12+
name_part = splitted[0].replace("_production", "")
13+
date_part = splitted[1]
14+
date_part_splitted = date_part.split("_")
15+
if len(date_part_splitted) == 3:
16+
date_part = (
17+
f"{date_part_splitted[2]}"
18+
f"/{date_part_splitted[1]}/"
19+
f"{date_part_splitted[0]}"
20+
)
21+
time_part = splitted[2]
22+
time_part_splitted = time_part.split("_")
23+
if len(time_part_splitted) == 3:
24+
time_part = f"{time_part_splitted[0]}:{time_part_splitted[1]}"
25+
26+
res["db_name"] = f"{name_part}<br />{date_part} {time_part}"
27+
return res
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[build-system]
3+
requires = ["whool"]
4+
build-backend = "whool.buildapi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Sylvain LE GAL (<https://www.twitter.com/legalsylvain>)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Customize OCA / web / `web_environment_ribbon` module.
2+
3+
- Change the text present in the ribbon, splitting the name of the
4+
database in two lines, to improve visibility.
5+
6+
- change style.
7+
8+
**Without the module**
9+
10+
..figure :: ../static/description/01_without_module.png
11+
12+
**With the module**
13+
14+
..figure :: ../static/description/02_with_module.png
5.89 KB
Loading

0 commit comments

Comments
 (0)