I customized the "external_layout_header" template from the "report" module in a custom module that modifies the Sales Quote/Order layout. I didn't realize that this template is also used for Purchase RFQs/Orders. Now I'm getting errors on the Purchase Order layout, because I moved a field from the sale.order object up into the header template, and this field doesn't exist in the purchase.order object. Is there any way that I can detect the document/object type with a t-function? Something along the lines of <t t-if="o = 'sale.order'"> ...?
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
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Cool. I will try that, thanks! I couldn't find any information on what kinds of comparisons can be done inside of a t-if statement. Is there any documentation for methods and operators?
Or the available variables, such as the "doc_model" you listed?
Updated my answer.
Thanks. I had read the QWeb section, but didn't notice that there was a separate QWeb Reports section.
Thank you very much for the answer. I spent so many hours fixing my problem before find this forum.
My code was:
<div t-if="o._name == 'sale.order'">
So I obtained odoo error:
AttributeError: 'NoneType' object has no attribute '_name'
you change the code like this. it will work
<div>
<t- t-if="o._name == 'sale.order'">
</t>
</div>
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 | |
---|---|---|---|---|
|
1
thg 7 16
|
24393 | ||
|
2
thg 3 15
|
7536 | ||
QWEB: Place full width image on page
Đã xử lý
|
|
1
thg 6 21
|
8004 | |
|
0
thg 3 15
|
3742 | ||
|
1
thg 3 15
|
14148 |