Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Inherit frontend website theme to add custom font/css

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
websiteodoo16features
1 Responder
4329 Vistas
Avatar
Matija

I am trying to inherit current website theme (Odoo v16) and add custom fonts/css to it. In documentation I was only able to find how to create new theme from scratch but not how to inherit it. This is what I've done (so far with no success):

Module folder structure:
website_theme/ ├── __init__.py ├── controllers/ ├── models/ │ __init__.py │ website_inherit.py ├── static/ │ src/ │ css/ │ custom_styles.css │ fonts/ │ Walkway_Bold.ttf ├── views/ │ odoo_theme.xml ├── __manifest__.py

This are the contents of files:
init.py

# -*- coding: utf-8 -*- from . import models

manifest.py
{ 'name': 'Website theme', 'description': 'Customisation for website theme', 'version': '1.0', 'author': 'author', 'data': ['views/odoo_theme.xml'], 'category': 'Website', 'depends': ['website',], 'assets': { 'web._assets_primary_variables': [ "website_theme/static/src/css/custom_styles.css", ], }, 'installable': True, }

/models/init.py

# -*- coding: utf-8 -*- from . import website_inherit

/models/website_inherit.py
from odoo import models class WebsiteInherit(models.Model): _inherit = 'website'

/static/src/css/custom_styles.css
@font-face { font-family: 'WalkwayBold'; src: url('/custom_website/static/src/fonts/Walkway_Bold.ttf') format('truetype'); } $o-theme-font-configs: map-merge($o-theme-font-configs, ( 'WalkwayBold': ( 'family': ('WalkwayBold'), ), ));

/views/odoo_theme.xml
< -- odoo>
    < -- data>
        
        < -- template id="website.layout" inherit_id="website.layout">
            < --- xpath expr="//head" position="inside">
                
            < -- /xpath>
        < -- /template>
    < -- /data>
< -- /odoo>

In odoo_theme xml file I had to add -- in tags so it can be displayed, it is not like that in the module.


I updated this module (using .sh editor) and restarted server. Found module in apps and try to install it. This is the error I get:

You cannot create recursive inherited views. View error context: '-no context-'

There is way to add custom CSS / JS in website editor but coming from Wordpress I'd like to have module for this and store this information in separate file/module outside the editor. Also, I need to use font that is not available in Google Fonts repository. Appreciate any help here, thank you.

0
Avatar
Descartar
Avatar
Nihal Haider 🇵🇰
Mejor respuesta




try to add sans-serif in your css file

0
Avatar
Descartar
Matija
Autor

Hi Nihal. I don't get it - this doesn't help with error - the problem is I'm not sure if theme inheritance is done correctly. Question is more complex on that side, adding font as you suggested would work if theme inheritance is correct :)

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
How to restrict access to a certain website page depending on group
website odoo16features
Avatar
Avatar
1
may 25
2877
Error with website
website odoo16features
Avatar
0
jul 24
256
how can I create a dropdown and put inside header the website1? odoo v16 please help me
website odoo16features
Avatar
0
may 23
2823
Error when adding a new webiste in odoo 16
website odoo16features
Avatar
0
abr 23
3567
HTTPS redirect to HTTP Content block of url Resuelto
ecommerce website odoo16features
Avatar
Avatar
Avatar
Avatar
4
nov 25
10083
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now