Any body please help me to customize contact widget in that is used in t-field options in qweb reports
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ờ
first step:
you can customize it by inheriting base.contact template in XML, for example here is how to add additional field "my_field" just before address in address widget:
<template id="contact" inherit_id="base.contact">
<xpath expr="//address/div" position="after">
<div t-if="object.my_field and 'my_field' in fields"
class='css_editable_mode_hidden'>
<div itemprop="my_field" t-esc="object.my_field"
style="margin-top:4px;margin-bottom:4px;font-size:10px;"/>
</div>
</xpath>
</template>
second step:
then in your qweb template, add "my_field" to fields list:
... t-field-options='{"widget": "contact", "fields": ["address","my_field","name",...],...
if your template is a new one, you need simply add my_field to "fields" list as shown above, if you extending some existing template, then you can inherit it and replace existing widget entry, using position="replace" property in xpath tag...
Thanks for helping me Temur.
This should've been the accepted answer ages ago :)
You could also inherit "base.contact_name" and modify it in the QWeb widget template right away.
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 | |
---|---|---|---|---|
|
0
thg 11 22
|
6333 | ||
|
1
thg 10 15
|
5118 | ||
|
4
thg 1 25
|
43868 | ||
|
0
thg 10 24
|
1171 | ||
|
0
thg 10 24
|
5 |