Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Inherit frontend website theme to add custom font/css

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
websiteodoo16features
1 Balas
4321 Tampilan
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
Buang
Avatar
Nihal Haider 🇵🇰
Jawaban Terbai




try to add sans-serif in your css file

0
Avatar
Buang
Matija
Penulis

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

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How to restrict access to a certain website page depending on group
website odoo16features
Avatar
Avatar
1
Mei 25
2875
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
2821
Error when adding a new webiste in odoo 16
website odoo16features
Avatar
0
Apr 23
3565
HTTPS redirect to HTTP Content block of url Diselesaikan
ecommerce website odoo16features
Avatar
Avatar
Avatar
Avatar
4
Nov 25
10077
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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