Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Inherit frontend website theme to add custom font/css

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
websiteodoo16features
1 Beantwoorden
4331 Weergaven
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
Annuleer
Avatar
Nihal Haider 🇵🇰
Beste antwoord




try to add sans-serif in your css file

0
Avatar
Annuleer
Matija
Auteur

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 :)

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to restrict access to a certain website page depending on group
website odoo16features
Avatar
Avatar
1
mei 25
2878
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
mei 23
2823
Error when adding a new webiste in odoo 16
website odoo16features
Avatar
0
apr. 23
3568
HTTPS redirect to HTTP Content block of url Opgelost
ecommerce website odoo16features
Avatar
Avatar
Avatar
Avatar
4
nov. 25
10086
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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