Source code for odoo_xmlrpc_twisted.functions.get_installed_user_titles

"""
Gives back the installed user titles
for 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_odoo import get_settings_odoo
except ImportError:
    from get_settings_odoo import get_settings_odoo
result   = get_settings_odoo()
db       = result[0]
uid      = result[1]
password = result[3]
models   = result[4] 



[docs] def get_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 language context = {'lang': language_code} # Search and read 'res.partner.title' records title_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 language return(title_ids)