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

My xml dosen't update when updating the module (Owl)

Abonare

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

Această întrebare a fost marcată
OWLodoo16features
2732 Vizualizări
Imagine profil
Vladislav Bochkov

I have this JavaScript code (Owl):

odoo.define('victorikus_web.BuildYourCakeApp', function (require) {
'use strict';

const {Component, mount, whenReady, loadFile, useState} = require('@odoo/owl');

class BuildYourCakeApp extends Component {
static template = "victorikus_web.BuildYourCakeApp";

setup() {
console.log("BuildYourCakeApp, setup")
}

state = useState({step: 1, shape: 'square', size: '25cm', color: 'red'});

updateSize(event) {
console.log('updateSize');
this.state.size = event.target.value;
}

updateShape(event) {
console.log('updateShape');
this.state.shape = event.target.value;
}

updateColor(event) {
console.log('updateColor');
this.state.color = event.target.value;
}

resetCake() {
console.log('resetCake');
this.state.step = 1;
this.state.shape = 'square';
this.state.size = '25cm';
this.state.color = 'red';
}
}

whenReady(async function () {
const root = document.querySelector("#BuildYourCakeApp");
if (root) {
const templates = await loadFile(`victorikus_web/static/src/xml/BuildYourCakeApp.xml`);
const env = {
templates,
};
mount(BuildYourCakeApp, root, env);
}
});
});

That links to this xml:

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

<odoo>

    <data>

        <template id="build_your_cake" name="Build Your Cake">

            <t t-call="web.frontend_layout">

                <div class="oe_structure">

                    <div id="wrap" class="container">

                        <div id="BuildYourCakeApp"></div>

                    </div>

                </div>

            </t>

        </template>

    </data>

</odoo>


And adds this xml with owl to the div with id "BuildYourCakeApp":

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

<templates>

    <t t-name="victorikus_web.BuildYourCakeApp" owl="1">

        <div class="container col-lg-12 mt-5">

            <h1 class="text-center mb-4">Build Your Cake</h1>

            <div class="card p-4 rounded">

                <div class="row">

                    <div class="col-lg-6">

                        <div class="step-container">

                            <h2>Step: 1</h2>


                            <div class="form-group mt-4">

                                <b>

                                    <label>Shape:</label>

                                </b>

                                <div class="form-check">

                                    <input class="form-check-input" type="radio" name="shapeRadios" id="shapeSquare"

                                           value="square" checked="checked" t-on-change="updateShape"/>

                                    <label class="form-check-label" for="shapeSquare">

                                        Square

                                    </label>

                                </div>

                                <div class="form-check">

                                    <input class="form-check-input" type="radio" name="shapeRadios" id="shapeRound"

                                           value="round" t-on-change="updateShape"/>

                                    <label class="form-check-label" for="shapeRound">

                                        Round

                                    </label>

                                </div>

                            </div>


                            <div class="form-group mt-4">

                                <b>

                                    <label for="cakeSize">Size:</label>

                                </b>

                                <select class="form-control" id="cakeSize" t-on-change="updateSize">

                                    <option value="">Select an option</option>

                                    <option value="25cm">25 cm</option>

                                    <option value="31cm">31 cm</option>

                                    <option value="39cm">39 cm</option>

                                </select>

                            </div>


                            <div class="form-group mt-4">

                                <b>

                                    <label>Color:</label>

                                </b>

                                <div class="form-check">

                                    <input class="form-check-input" type="radio" name="colorRadios" id="colorRed"

                                           value="red" checked="checked" t-on-change="updateColor"/>

                                    <label class="form-check-label" for="colorRed">

                                        Red

                                    </label>

                                </div>

                                <div class="form-check">

                                    <input class="form-check-input" type="radio" name="colorRadios" id="colorBlue"

                                           value="blue" t-on-change="updateColor"/>

                                    <label class="form-check-label" for="colorBlue">

                                        Blue

                                    </label>

                                </div>

                            </div>

                        </div>

                    </div>

                    <div class="col-lg-6">

                        <div class="result-container mt-4 p-3">

                            A

                            <t t-esc="state.color"/>

                            <t t-esc="state.shape"/>

                            of

                            <t t-esc="state.size"/>

                            cake!

                            <button type="button" class="btn btn-primary mt-3" t-on-click="resetCake">Click Me!</button>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </t>

</templates>


Here is my mainfest file:

# -*- coding: utf-8 -*-
{
'name': "Victorikus Web",

'summary': """
Cake Shop Website.
""",

'description': """
Cake Shop Website.
""",

'author': "My Company",
'website': "https://www.yourcompany.com",

'license': 'Other proprietary',

# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
'category': 'Website',
'version': '1.0.0',

# any module necessary for this one to work correctly
'depends': ['base', 'web', 'website', 'website_sale', 'website_sale_stock', 'account', 'stock', 'contacts'],

'installable': True,

'application': True,

# always loaded
'data': [
'views/landing_page.xml',
'data/res.partner.csv',
'data/res.company.csv',
'data/res.lang.xml',
'data/website.xml',
'data/website.page.csv',
'data/product.template.csv',
'data/res.users.csv',
'data/res.groups.xml',
'data/website.page.sql',
'data/no_update.sql',

# Views
'views/build_your_cake_template.xml'
],

'assets': {
'web.assets_frontend': [
'victorikus_web/static/src/js/landing_page.js',
'victorikus_web/static/src/css/styles.css',
'victorikus_web/static/src/js/BuildYourCakeApp.js',
],
'web.assets_qweb': [
'victorikus_web/static/src/xml/BuildYourCakeApp.xml',
],
},


# only loaded in demonstration mode
'demo': [
],
}


But when modifying the xml with owl, it does not reflect the changes, not until I open a private page and then it shows the updated version.
When exploring the dev tools, I discovered that it loads the xml from cache.
Am I doing something wrong?

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
Call JS code from button in header in Odoo 16
OWL odoo16features
Imagine profil
Imagine profil
Imagine profil
2
iul. 24
5920
in odoo16 owl, how to store current page state after go to another page, and restore them when back to this page from the breadcrumbs?
OWL odoo16features
Imagine profil
Imagine profil
1
oct. 23
3108
Dialog Box Closed when I clicked to "Filters" or "Groub by" or "Favorites" Odoo 16 OWL
OWL odoo16features
Imagine profil
0
sept. 23
2134
Show Loading Spinner on OWL Component v16
qweb OWL odoo16features
Imagine profil
Imagine profil
1
ian. 25
4779
How do I override functions outside the class in the Odoo 16 Owl framework?
js OWL odoo16features
Imagine profil
Imagine profil
1
iun. 24
5534
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