Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

Odoo cache and updating qweb templates

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
qwebcachetemplatescaching
10 Trả lời
42871 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
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
Tác giả

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
Tác giả

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
Tác giả

- 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.

Ảnh đại diện
Victor Rodriguez
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Ảnh đại diện
HateCamel
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Juan Muñoz

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

Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
Caching System In odoo
cache caching
Ảnh đại diện
Ảnh đại diện
1
thg 10 23
7318
Alternate product listing, clone a route?
qweb templates
Ảnh đại diện
0
thg 3 15
4295
How to create template for odoo form
form qweb templates
Ảnh đại diện
0
thg 4 25
2086
Custom Invoice Report
invoice qweb templates
Ảnh đại diện
0
thg 1 24
2273
Unescaped '<' not allowed in attributes values (qweb) Đã xử lý
qweb templates odoo12
Ảnh đại diện
Ảnh đại diện
2
thg 2 24
16359
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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