How to create dynamic tree view? or hidden field in tree view?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hello Irawan,
You can create dynamic tree view using fields_view_get method.
Example:
from lxml import etree
@api.model
def fields_view_get(self, view_id=None, view_type=’tree’, context=None, toolbar=False,submenu=False):
result = super(model_name,self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu)
doc = etree.XML(result[‘arch’])
if new_string:
for node in doc.xpath(“//field[@name=’field_a’]”):
node.set(‘string’, new_string)
result[‘arch’] = etree.tostring(doc)
return result
Hope this help.
Thank you.
But, how to trigger that when onchange?
Thank you.
But, how to trigger that when onchange?
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
3
أبريل 25
|
4553 | ||
|
5
نوفمبر 23
|
42920 | ||
|
1
سبتمبر 22
|
3690 | ||
|
1
يونيو 22
|
12518 | ||
|
3
مارس 20
|
10993 |