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
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
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?
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
3
apr 25
|
4508 | ||
|
5
nov 23
|
42861 | ||
|
1
set 22
|
3655 | ||
|
1
giu 22
|
12491 | ||
|
3
mar 20
|
10973 |