TaskXMLRPC
class tasks.task_xmlrpc.TaskXMLRPC
Call a XMLRPC service.
Inputs
Name | Type | Default | Description |
---|---|---|---|
args | list | None | Positional arguments for function call |
func | str | The function to call on the remote | |
kwargs | dict | None | Keyword arguments for function call |
url | str |
Outputs
Name | Type | Default | Description |
---|---|---|---|
log | list | ||
result | object | ||
execution_id | int | The ID of the task execution | |
message | str | The ended message for the task. If the task ended with an error, the message will contain information about what went wrong | |
status | str | The ended status for the task. Either "success" or "error". |
Constants
input_list = ['args', 'func', 'kwargs', 'url']output_list = ['log', 'result']version = 1Methods
run ()
Example
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):db = <your odoo database name>api = <your odoo xmlrpc url>userid = <your odoo user id>password = <your odoo password>products = this.task('XMLRPC',url=f'{api}/object',func='execute_kw',args=[db,userid,password,'product.product','search_read',[[['type','=', 'product']]],{'fields': ['code','name','categ_id',]},],).get('output_value').get('result')
The example above will call a odoo xmlrpc API
log:- Start- 'Connecting to <your odoo xmlrpc url>/object'- Calling execute_kw
The result will be a list of json objects
result:- id: 15code: DESK0004name: Customizable Deskcateg_id:- 8- All / Saleable / Office Furniture- id: 16code: DESK0005name: Customizable Deskcateg_id:- 8- All / Saleable / Office Furniture