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:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
Apr 25
|
3585 | ||
|
5
Nov 23
|
41730 | ||
|
1
Sep 22
|
3002 | ||
|
1
Jun 22
|
11807 | ||
|
3
Mar 20
|
10361 |