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

Override qweb template without an id

Abonare

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

Această întrebare a fost marcată
restaurantinherittemplateappointmentOdoo 18
1 Răspunde
1534 Vizualizări
Imagine profil
Panos Anagnostakis

I want to override the following template from Odoo 18 enterprise source code (specifically I want to override the <t t-out="availableResource['name']"/> and replace it with <t t-out="availableResource['display_name']"/>:


<?xml version="1.0" encoding="UTF-8"?>

<template>

    <t t-name="appointment.resources_list">

        <label for="resource_id" class="mb-1">Make your choice</label>

        <select class="o_resources_list form-select cursor-pointer" name="resource_id">

            <t t-if="scheduleBasedOn === 'resources'">

                <option t-foreach="availableResources" t-as="availableResource" t-key="availableResource_index"

                    t-att-value="availableResource['id']" t-att-data-resource-capacity="availableResource['capacity']">

                    <t t-out="availableResource['name']"/>

                </option>

            </t>

            <option t-else="" t-foreach="availableStaffUsers" t-as="availableUser" t-key="availableUser_index"

                t-att-value="availableUser['id']">

                <t t-out="availableUser['name']"/>

            </option>

        </select>

        <button name="submitSlotInfoSelected" class="btn btn-primary w-100 mt-3">Confirm</button>

    </t>

</template>

The problem is that the template has no id and it is rendered from a js file using renderToFragment:

this.resourceSelectionEl.replaceChildren(

            renderToFragment("appointment.resources_list", {

                availableResources,

                availableStaffUsers,

                scheduleBasedOn,

            })

        );

If it means anything the template is used for displaying the select table drop down list in website restaurant table booking. The file is located at appointment/static/src/xml/appointment_resources.xml and the js file that renders it is at appointment/static/src/js/appointment_select_appointment_slot.js 


How can I inherit this template with no id?

0
Imagine profil
Abandonează
Imagine profil
Christoph Farnleitner
Cel mai bun răspuns

You can find further details under the Template inheritance section in https://www.odoo.com/documentation/18.0/developer/reference/frontend/qweb.html#template-inheritance

So, an inheritance would be done similar to this:

<t t-inherit="appointment.resources_list" t-inherit-mode="extension">
    <xpath expr="//select/t/option/t" position="attributes">
        <attribute name="t-out">availableResource['display_name']</attribute>
    </xpath>
</t>
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
Cannot be located in parent view
inherit template
Imagine profil
Imagine profil
Imagine profil
2
mai 25
5747
Restaurant table booking (appointment) that includes next day Rezolvat
restaurant appointment odoo18
Imagine profil
Imagine profil
Imagine profil
2
iul. 25
990
Assertion Error Template is required when i click the pay button(odoo 18)
payment template Odoo 18
Imagine profil
Imagine profil
1
iun. 25
1964
Odoo18 POS restaurant employee
pos restaurant Odoo 18
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
mai 25
2074
Display location as hyperlink in common popover
xml inherit template space
Imagine profil
0
mar. 25
1653
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