Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profit organisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Odoo cache and updating qweb templates

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
qwebcachetemplatescaching
10 Antwoorden
42874 Weergaven
Avatar
Pepiño

Hi,

I'm following the "Building a Website" tutorial from the developers official documentation, but I'm having a problem to see the changes made in the template (xml file) on the web page.

I have a model like this:

class Teachers(models.Model):
_name = 'academy.teachers'
name = fields.Char()
    biography = fields.Html()

My original template was as follows:

<openerp>
<data>
<template id="index">
<t t-call="website.layout">
<t t-set="title">Academy</t>
<div class="oe_structure">
<div class="container">
<t t-foreach="teachers" t-as="teacher">
<p><a t-attf-href="/academy/{{ slug(teacher) }}">
<t t-esc="teacher.name"/></a>
</p>
</t>
</div>
</div>
</t>
</template>
<template id="biography">
<t t-call="website.layout">
<t t-set="title">Academy</t>
<div class="oe_structure">
<div class="container">
            <h3><t t-esc="person.name"/></h3>
 <div><t t-esc="person.biography"/></div>

</div>
</div>
</t>
</template>
</data>
</openerp>

Then, I change this template to be able to edit the person's name on the webpage.

<openerp>
<data>
<template id="index">
<t t-call="website.layout">
<t t-set="title">Academy</t>
<div class="oe_structure">
<div class="container">
<t t-foreach="teachers" t-as="teacher">
<p><a t-attf-href="/academy/{{ slug(teacher) }}">
<t t-esc="teacher.name"/></a>
</p>
</t>
</div>
</div>
</t>
</template>
<template id="biography">
<t t-call="website.layout">
<t t-set="title">Academy</t>
<div class="oe_structure">
          <div class="container">
      <h3 t-field="person.name"/>
               <div t-field="person.biography"/>
</div>
</div>
</t>
</template>
</data>
</openerp>

I'm sending a person variable from the controller. person is a record from Teachers model.

The source code from my controller is as follows:

# -*- coding: utf-8 -*-

from openerp import http


class Academy(http.Controller):

@http.route('/academy/academy/', auth='public', website=True)
def index(self, **kw):
teachers = http.request.env['academy.teachers']
return http.request.render('academy.index', {
'teachers': teachers.search([])
})

@http.route('/academy/<model("academy.teachers"):teacher>', auth='public', website=True)
def teachers(self, teacher):
return http.request.render('academy.biography', {
'person': teacher
})

And here is the source code from my Teacher model:

# -*- coding: utf-8 -*-

from openerp import models, fields, api


class Teachers(models.Model):
_name = 'academy.teachers'
name = fields.Char()
biography = fields.Html()

I run the following command to start Odoo server updating my academy module:

./odoo.py --addons-path addons,/opt/odoo/custom-addons -d test -u academy


In the top navigation bar, if I click on the 'Customize-->HTML Editor menu', I can see the template 'biography' hadn't been updated. It still contains the original content of the templates.xml file with <h3><t t-esc="person.name"/></h3> instead
<h3 t-field="person.name"></h3>.

I think that it is due to something related to Odoo cache.

I cleared all Google Chrome cache, restart de Odoo server and updgrade my module, but it didn't work.

The only temporary solution is uninstall and install the module again, but I don't want to do this every time.

Any solution please?.

2
Avatar
Annuleer
Jérémy Kersten (jke)

Could you provide some piece of code from your controller ? It's normal that template are not updated. You are updating the record sent from controller... not the template...

Pepiño
Auteur

Thanks for your answer jke. I have edited my post to write down the code from my controller.

Jérémy Kersten (jke)

I don't have your template for index... but for controller academy/teacher... If you do : http://127.0.0.1/academy/1 (where 1 is the id from one of your teacher), if you edit it, the change should be done in the database for this teacher. Which Odoo version are you using ? V8 ?

Pepiño
Auteur

I'm using Odoo version 8. But I think that I didn't explain clearly my problem in my original question. I have edited it to clarify. My problem is that I had a previous template to show the name of a teacher:

Then, I changed this template to have an editable

on the webpage over the name of the teacher:

But somehow, the template didn't update and it still was containing

instead

. I think the problem is due to Odoo cache, but I'm not sure. I had to uninstall and install the module again to the template was updated.
Jérémy Kersten (jke)

When you update a template, you need to restart your server with the option -u to update it. It's not a problem with cache, because when your restart your server, you clear always the cache ! (but according your question, you do it...) Maybe you have a data update="False" in your template ? Can you check that the module i well updated (no warning at startup WARNING ecom openerp.modules.loading: invalid module names, ignored: academy) If you do and update manually via the backend (setting, module , find your apps, update)... does it works ?

Pepiño
Auteur

- I don't have a data update="False" in my template. - No warning at startup. - When I had the problem, a manually update of the module didn't work. I have tried to recreate the original problem. First, I uninstalled the module, then I changed my template.xml file to content the original code (without editable fields on the webpage). After this, I installed the module again and of course, the

tag containing the teacher's name wasn't editable. Everything fine for now. Again, I changed the template to contain an editable tag (

) and I restarted the Odoo server with the command ./odoo.py --addons-path addons,/opt/odoo/custom-addons -d test -u academy After this, the template was updated, but I promise that when I updated my template for the first time, the changes on the template.xml file weren't taken into account. I don't know what happened the first time, but I can't recreate the problem again. Thank for your help Jérémy.
Jérémy Kersten (jke)

Good news ! The only thing that I can see is that template was marked as non updatable because you have edited it from the website front end. When it's the case, you can uncheck the non updatable field from the ir_model_dala (in backend) or do a -i (and not -u) to force the overwritte... Good continuation with Odoo.

Avatar
Victor Rodriguez
Beste antwoord

I had a similar problem and I could solve it by eliminating the QWeb Template from Settings --> Technical --> User Interface --> Views. Then, you need to update the module.


I hope I've helped :)

0
Avatar
Annuleer
Avatar
HateCamel
Beste antwoord

Did you solve this? I am having the same problem. I am adding some fields in account invoice report through my custom module and I have to create a new invoice to see my changes every time, event hough I restarted the server and updated the module.

-1
Avatar
Annuleer
Juan Muñoz

You should go to Settings > Actions > Reports, find Invoice and disable the 'Reload from Attachment'. Hope that helps u :).

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Caching System In odoo
cache caching
Avatar
Avatar
1
okt. 23
7318
Alternate product listing, clone a route?
qweb templates
Avatar
0
mrt. 15
4295
How to create template for odoo form
form qweb templates
Avatar
0
apr. 25
2086
Custom Invoice Report
invoice qweb templates
Avatar
0
jan. 24
2274
Unescaped '<' not allowed in attributes values (qweb) Opgelost
qweb templates odoo12
Avatar
Avatar
2
feb. 24
16359
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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