Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
blockwebsiteodoo
2 Răspunsuri
7645 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Bit Level Code
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Damien Hick
Cel mai bun răspuns

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

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Odoo website iframe youtube video not showing
website odoo
Imagine profil
1
nov. 25
3421
Error when i try to buy "Scale-Up! The Business Game" from odoo store
website odoo
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
nov. 25
3764
Hide Variants from the Website
website odoo
Imagine profil
Imagine profil
1
iul. 23
3330
Odoo Website withdrawal
website odoo
Imagine profil
0
iul. 22
2705
Odoo? Why this new name? Rezolvat
website odoo
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
sept. 21
25231
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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