Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Artificial Intelligence
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Property Management
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
OWLodoo16features
4092 Vistes
Avatar
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
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
Call JS code from button in header in Odoo 16
OWL odoo16features
Avatar
Avatar
Avatar
2
de jul. 24
7252
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
Avatar
Avatar
1
d’oct. 23
5720
Dialog Box Closed when I clicked to "Filters" or "Groub by" or "Favorites" Odoo 16 OWL
OWL odoo16features
Avatar
0
de set. 23
3040
Show Loading Spinner on OWL Component v16
qweb OWL odoo16features
Avatar
Avatar
1
de gen. 25
6110
How do I override functions outside the class in the Odoo 16 Owl framework?
js OWL odoo16features
Avatar
Avatar
1
de juny 24
6827
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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