Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How can i add a new block or custom data to the website module?

Naroči se

Get notified when there's activity on this post

This question has been flagged
blockwebsiteodoo
2 Odgovori
7652 Prikazi
Avatar
Muszik Adrián

I have developed custom modules, with their own data, and i wish to present them on the website module. I wish to create a block with it so it is easy to put it out.  Sadly i found no material on how to do this. 

0
Avatar
Opusti
Avatar
Bit Level Code
Best Answer

To present your custom module data on the Odoo website and create a block for easy integration, you can follow these steps. It involves using Odoo's Website Builder and extending it to display your custom module's data dynamically.

Here’s a step-by-step guide to achieve that:

1. Create a Custom Controller

You need to create a custom controller to fetch your custom module data and pass it to the website template.

Example:

Let's assume your custom module is called my_custom_module and you want to display a list of products or records from this module on your website.

  • First, create a Python controller in your custom module. This will handle the request and pass data to the website.

from odoo import http from odoo.http import request class MyCustomModuleController(http.Controller): @http.route('/my_custom_module', auth='public', website=True) def index(self, **kw): # Fetch data from your custom module records = request.env['my.custom.model'].search([]) # Replace with your model name # Render a template with the fetched records return request.render('my_custom_module.template_id', { 'records': records, })

This will create a URL (/my_custom_module) where your custom module data will be displayed.

2. Create a Website Template

Next, you need to create a template in the views folder of your module. This template will display the data passed from the controller.

Example Template (views/website_template.xml):

<odoo> <template id="template_id" name="Custom Module Template"> <div class="custom-module-block"> <h2>My Custom Data</h2> <t t-foreach="records" t-as="record"> <div class="record"> <h3><t t-esc="record.name"/></h3> <!-- Replace with your model's field --> <p><t t-esc="record.description"/></p> <!-- Replace with your model's field --> </div> </t> </div> </template> </odoo>

In this template:

  • We're using <t t-foreach="records" t-as="record"> to loop through the records passed from the controller.
  • Replace record.name and record.description with the actual fields from your model.

3. Add the Block to the Website

Once the controller and template are set up, you can create a block for this data on your website.

  • Go to Website → Pages → Add New Page or edit an existing page.
  • In the page editor, you can add your new custom block using Custom HTML or Snippet options.
  • In the editor, add the block with a dynamic URL (e.g., /my_custom_module) so it pulls the data from the controller template.

0
Avatar
Opusti
Avatar
Damien Hick
Best Answer

Hey, i think your answer is here: https://www.odoo.com/documentation/18.0/fr/developer/howtos/website_themes/building_blocks.html

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Odoo website iframe youtube video not showing
website odoo
Avatar
1
nov. 25
3422
Error when i try to buy "Scale-Up! The Business Game" from odoo store
website odoo
Avatar
Avatar
Avatar
Avatar
4
nov. 25
3765
Hide Variants from the Website
website odoo
Avatar
Avatar
1
jul. 23
3331
Odoo Website withdrawal
website odoo
Avatar
0
jul. 22
2707
Odoo? Why this new name? Solved
website odoo
Avatar
Avatar
Avatar
Avatar
3
sep. 21
25244
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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