Source code for odoo_xmlrpc_twisted.functions.get_installed_user_titles
"""Gives back the installed user titlesfor a specific language code from the 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_installed_user_titles(language_code):""" The function gives back the installed user titles for a specific language code from the Odoo system. """# Set the context with the desired languagecontext={'lang':language_code}# Search and read 'res.partner.title' recordstitle_ids=models.execute_kw(db,uid,password,'res.partner.title','search_read',[[]],{'fields':['id','name','shortcut'],'context':context})# return the installed user titles for a specific languagereturn(title_ids)