Source code for odoo_xmlrpc_twisted.functions.get_available_countries
"""Give back all available countries from Odoo system."""# call the function "get_settings_odoo" to get the parameters# for the logging of the model on the "odoo Webservice API"try:from.get_settings_odooimportget_settings_odooexceptImportError:fromget_settings_odooimportget_settings_odooresult=get_settings_odoo()db=result[0]uid=result[1]password=result[3]models=result[4]
[docs]defget_available_countries():""" Get the available countries from Odoo system by getting it from the 'res.country' model. Result is an array with id and the name of the countries. """# Call the search_read method of the res.country model to get countriescountries=models.execute_kw(db,uid,password,'res.country','search_read',[[]],{'fields':['id','name']})return(countries)