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
4月 25
|
4628 | ||
|
5
11月 23
|
42950 | ||
|
1
9月 22
|
3706 | ||
|
1
6月 22
|
12543 | ||
|
3
3月 20
|
11008 |