# -*- coding: utf-8 -*-
from . import scripts
from . import transodoo
from .clodoo_main import (
    Clodoo,
    version,
    writelog,
    print_hdr_msg,
    decr_lev,
    incr_lev,
    open_connection,
    do_login,
    oerp_set_env,
    get_context,
    set_msg,
    init_db_ctx,
    init_company_ctx,
    init_user_ctx,
    get_dblist,
    get_companylist,
    get_userlist,
    isaction,
    isiteraction,
    lexec_name,
    add_on_account,
    action_id,
    do_group_action,
    do_single_action,
    do_actions,
    create_local_parms,
    ident_db,
    ident_company,
    ident_user,
    get_data_selection,
    env_ref,
    act_help,
    act_list_actions,
    act_show_params,
    act_list_db,
    act_echo_db,
    act_show_db_params,
    act_list_companies,
    act_echo_company,
    act_show_company_params,
    act_list_users,
    act_echo_user,
    act_show_user_params,
    act_unit_test,
    act_per_db,
    act_per_company,
    act_per_user,
    act_execute,
    upd_del_in_journal,
    act_check_xid,
    act_ena_del_in_journal,
    act_dis_del_in_journal,
    append_2_where,
    build_where,
    sql_where,
    build_sql_where,
    build_exclusion,
    workflow_model_all_records,
    setstate_model_all_records,
    reactivate_model_all_records,
    deactivate_model_all_records,
    hard_del_sql,
    remove_model_all_records,
    reset_sequence,
    reset_menuitem,
    validate_models,
    multiuser,
    create_zero_db,
    get_dbname,
    get_param_ver,
    get_real_paramvalue,
    get_real_actname,
    add_external_name,
    translate_ext_names,
    parse_in_fields,
    import_file,
    import_config_file,
    setup_user_config_param,
    setup_global_config_param,
    install_chart_of_account,
    create_simple_act_list,
    create_act_list,
    check_actions_list,
    check_actions_1_list,
    extend_actions_list,
    extend_actions_1_list,
    check_4_actions,
)
from .scripts.main import internal_main

try:
    from clodoocore import (
        browseL8,
        connectL8,
        createL8,
        create_model_object,
        cvt_from_ver_2_ver,
        eval_value,
        exec_sql,
        executeL8,
        execute_action_L8,
        extract_vals_from_rec,
        get_company_id,
        get_country_id,
        get_db_alias,
        get_macro_pos,
        get_model_alias,
        get_model_model,
        get_model_name,
        get_model_structure,
        get_query_id,
        get_res_users,
        get_state_id,
        get_val_from_field,
        is_db_alias,
        is_required_field,
        is_valid_field,
        model_has_company,
        psql_connect,
        put_model_alias,
        searchL8,
        unlinkL8,
        writeL8,
    )
except:
    from clodoo.clodoocore import (
        browseL8,
        connectL8,
        createL8,
        create_model_object,
        cvt_from_ver_2_ver,
        eval_value,
        exec_sql,
        executeL8,
        execute_action_L8,
        extract_vals_from_rec,
        get_company_id,
        get_country_id,
        get_db_alias,
        get_macro_pos,
        get_model_alias,
        get_model_model,
        get_model_name,
        get_model_structure,
        get_query_id,
        get_res_users,
        get_state_id,
        get_val_from_field,
        is_db_alias,
        is_required_field,
        is_valid_field,
        model_has_company,
        psql_connect,
        put_model_alias,
        searchL8,
        unlinkL8,
        writeL8,
    )
try:
    from clodoolib import build_odoo_param, crypt
except:
    from clodoo.clodoolib import build_odoo_param, crypt
