Skip to content

Commit

Permalink
[REF] fermente_web:
Browse files Browse the repository at this point in the history
- set images for mache, fermente, etc...
- set company logo at top of swith company menu
  • Loading branch information
legalsylvain committed Feb 28, 2025
1 parent 93b473c commit 43eca3e
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 186 deletions.
73 changes: 0 additions & 73 deletions fermente_web/README.rst
Original file line number Diff line number Diff line change
@@ -1,73 +0,0 @@
================
GRAP - Web Theme
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a0ae6d4db20ac40aabd07e0c8819d16cc5847cf1748b5e1e84b17b26c1e00135
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-grap%2Fgrap--odoo--custom-lightgray.png?logo=github
:target: https://github.com/grap/grap-odoo-custom/tree/12.0/grap_theme
:alt: grap/grap-odoo-custom

|badge1| |badge2| |badge3|

This module extend Odoo web module, to change UI.

* Change border fields to make it smoother

.. image:: https://raw.githubusercontent.com/grap/grap-odoo-custom/12.0/grap_theme/static/description/product_product_form.png

* improve the display of user image and add the company image in the menu

.. image:: https://raw.githubusercontent.com/grap/grap-odoo-custom/12.0/grap_theme/static/description/menu.png

* Change the image of the login page, setting it static

.. image:: https://raw.githubusercontent.com/grap/grap-odoo-custom/12.0/grap_theme/static/description/logout_page.png

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-custom/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/grap/grap-odoo-custom/issues/new?body=module:%20grap_theme%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* GRAP

Contributors
~~~~~~~~~~~~

* Quentin DUPONT <https://twitter.com/pondupont>
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)

Maintainers
~~~~~~~~~~~

This module is part of the `grap/grap-odoo-custom <https://github.com/grap/grap-odoo-custom/tree/12.0/grap_theme>`_ project on GitHub.

You are welcome to contribute.
24 changes: 13 additions & 11 deletions fermente_web/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
# @author Quentin DUPONT (https://twitter.com/pondupont)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "GRAP - Web Theme",
"name": "Fermente - Custom Web",
"summary": "Customize Odoo web User Interface",
"version": "16.0.1.0.0",
"category": "GRAP Custom",
"category": "Fermente Custom",
"author": "GRAP",
"website": "https://github.com/grap/grap-odoo-custom",
"license": "AGPL-3",
"depends": [
"web",
],
"data": [
"views/templates.xml",
],
"qweb": [
"static/src/xml/base.xml",
],
"depends": ["web"],
"assets": {
"web.assets_backend": [
"fermente_web/static/src/xml/switch_company_menu.xml",
"fermente_web/static/src/js/switch_company_menu.esm.js",
"fermente_web/static/src/scss/fermente_web.scss",
],
},
# "qweb": [
# "static/src/xml/base.xml",
# ],
"installable": True,
}
22 changes: 9 additions & 13 deletions fermente_web/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import functools

from odoo import http
from odoo.http import db_monodb, request
from odoo.modules import get_resource_path

from odoo.addons.web import controllers


class Binary(controllers.main.Binary):
class Binary(controllers.binary.Binary):
@http.route(
[
"/web/binary/company_logo",
Expand All @@ -23,17 +22,14 @@ class Binary(controllers.main.Binary):
cors="*",
)
def company_logo(self, dbname=None, **kw):
if request.session.db:
dbname = request.session.db
elif dbname is None:
dbname = db_monodb()
dbname = dbname or http.request.session.db or ""

placeholder = functools.partial(
get_resource_path, "grap_theme", "static", "src", "img"
get_resource_path, "fermente_web", "static", "src", "img"
)
if dbname.startswith("grap"):
return http.send_file(placeholder("grap.png"))
elif dbname.startswith("caap"):
return http.send_file(placeholder("caap.png"))
else:
return http.send_file(placeholder("undefined_database.png"))
file_name = "undefined_database"
for name in ["grap", "caap", "mache", "fermente"]:
if dbname.startswith(f"{name}_production"):
file_name = name

return http.Stream.from_path(placeholder(f"{file_name}.png")).get_response()
4 changes: 2 additions & 2 deletions fermente_web/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ This module extend Odoo web module, to change UI.

.. image:: ../static/description/product_product_form.png

* improve the display of user image and add the company image in the menu
* Add the company image in the menu

.. image:: ../static/description/menu.png

* Change the image of the login page, setting it static

.. image:: ../static/description/logout_page.png
.. image:: ../static/description/login_page.png
44 changes: 0 additions & 44 deletions fermente_web/static/src/css/grap_theme.css

This file was deleted.

Binary file added fermente_web/static/src/img/fermente.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fermente_web/static/src/img/mache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions fermente_web/static/src/js/widgets.js

This file was deleted.

22 changes: 22 additions & 0 deletions fermente_web/static/src/scss/fermente_web.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* ****************************************************
Form View: Change input and spaces between objects
**************************************************** */
.mb-3 {
margin-top: 0.3rem !important;
}
.mb-4 {
margin-top: 0.4rem !important;
}

.o-form-buttonbox {
margin-bottom: 8px;
}

/* ****************************************************
Tree View: Border for all cells
**************************************************** */

.table td {
border-left: 1px solid rgb(233, 236, 239);
}

16 changes: 0 additions & 16 deletions fermente_web/static/src/xml/base.xml

This file was deleted.

20 changes: 20 additions & 0 deletions fermente_web/static/src/xml/switch_company_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2020-Today GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<templates xml:space="preserve">
<t
t-name="fermente_web.SwitchCompanyMenu"
t-inherit="web.SwitchCompanyMenu"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//i[hasclass('fa-building')]" position="replace">
<img class="o_user_avatar h-75 py-1" style="padding-right:5px;"
t-att-src="'/web/image?model=res.company&amp;field=logo&amp;id=' + currentCompany.id"/>
</xpath>
</t>

</templates>

0 comments on commit 43eca3e

Please sign in to comment.