Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

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

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
OWLodoo16features
2895 Tampilan
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
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Call JS code from button in header in Odoo 16
OWL odoo16features
Avatar
Avatar
Avatar
2
Jul 24
6076
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
Okt 23
3221
Dialog Box Closed when I clicked to "Filters" or "Groub by" or "Favorites" Odoo 16 OWL
OWL odoo16features
Avatar
0
Sep 23
2219
Show Loading Spinner on OWL Component v16
qweb OWL odoo16features
Avatar
Avatar
1
Jan 25
4950
How do I override functions outside the class in the Odoo 16 Owl framework?
js OWL odoo16features
Avatar
Avatar
1
Jun 24
5728
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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