Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Odoo cache and updating qweb templates

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
qwebcachetemplatescaching
10 Respuestas
42862 Vistas
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
Descartar
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
Autor

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
Autor

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
Autor

- 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
Mejor respuesta

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
Descartar
Avatar
HateCamel
Mejor respuesta

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
Descartar
Juan Muñoz

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

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Caching System In odoo
cache caching
Avatar
Avatar
1
oct 23
7312
Alternate product listing, clone a route?
qweb templates
Avatar
0
mar 15
4293
How to create template for odoo form
form qweb templates
Avatar
0
abr 25
2086
Custom Invoice Report
invoice qweb templates
Avatar
0
ene 24
2272
Unescaped '<' not allowed in attributes values (qweb) Resuelto
qweb templates odoo12
Avatar
Avatar
2
feb 24
16352
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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