Sistema de gestión multisucursal sobre Odoo 19 Community: módulos matrix_*, guiones de alta de instalaciones, suite de pruebas y documentación.
34 lines
1.3 KiB
Python
34 lines
1.3 KiB
Python
# Part of Matrix. Collina Systems proprietary module.
|
|
"""La app instalable (PWA) con el icono y los colores de la casa.
|
|
|
|
El manifiesto que Odoo sirve en /web/manifest.webmanifest trae el nombre
|
|
de `web.web_app_name` (lo fija data/nombre_app.xml), pero los iconos y
|
|
los colores están escritos en el controlador: odoo-icon-*.png y el
|
|
morado #714B67. Al instalar la app en una tablet o un teléfono, eso es
|
|
lo que queda en la pantalla de inicio. Mismo mecanismo que el core deja
|
|
abierto para heredar: `_get_webmanifest` y `_icon_path` (este último
|
|
alimenta también la página sin conexión y el icono de las apps con
|
|
alcance).
|
|
"""
|
|
from odoo.addons.web.controllers.webmanifest import WebManifest
|
|
|
|
VERDE_MATRIX = '#0E6B57' # $matrix-primary, matrix_variables.scss
|
|
ICONOS = (192, 512)
|
|
|
|
|
|
class MatrixWebManifest(WebManifest):
|
|
|
|
def _get_webmanifest(self):
|
|
manifest = super()._get_webmanifest()
|
|
manifest['icons'] = [{
|
|
'src': f'/matrix_base/static/img/app-{lado}.png',
|
|
'sizes': f'{lado}x{lado}',
|
|
'type': 'image/png',
|
|
} for lado in ICONOS]
|
|
manifest['background_color'] = VERDE_MATRIX
|
|
manifest['theme_color'] = VERDE_MATRIX
|
|
return manifest
|
|
|
|
def _icon_path(self):
|
|
return 'matrix_base/static/img/app-192.png'
|