March 2018
Beginner to intermediate
336 pages
8h 22m
English
An XML file can also execute arbitrary methods during its load process through the <function> element. This can be used to set up demo and test data. For example, the CRM app uses it to set up demonstration data:
<function
model="todo.task"
name="action_set_lost"
eval="[ref('crm_case_7'), ref('crm_case_9')
, ref('crm_case_11'), ref('crm_case_12')]
, {'install_mode': True}" />
This calls the action_set_lost method of the crm.lead model, passing two arguments through the eval attribute. The first is the list of IDs to work on, and the next is the context to use.
Read now
Unlock full access