当前位置: 首页>>代码示例>>Java>>正文


Java OdooAccountManager.isValidUserObj方法代码示例

本文整理汇总了Java中com.odoo.core.auth.OdooAccountManager.isValidUserObj方法的典型用法代码示例。如果您正苦于以下问题:Java OdooAccountManager.isValidUserObj方法的具体用法?Java OdooAccountManager.isValidUserObj怎么用?Java OdooAccountManager.isValidUserObj使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.odoo.core.auth.OdooAccountManager的用法示例。


在下文中一共展示了OdooAccountManager.isValidUserObj方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPerformSync

import com.odoo.core.auth.OdooAccountManager; //导入方法依赖的package包/类
@Override
public void onPerformSync(Account account, Bundle extras, String authority,
                          ContentProviderClient provider, SyncResult syncResult) {
    // Creating model Object
    mModel = new OModel(mContext, null, OdooAccountManager.getDetails(mContext, account.name))
            .createInstance(mModelClass);
    mUser = mModel.getUser();
    if (OdooAccountManager.isValidUserObj(mContext, mUser)) {
        // Creating Odoo instance
        mOdoo = createOdooInstance(mContext, mUser);
        Log.i(TAG, "User        : " + mModel.getUser().getAndroidName());
        Log.i(TAG, "Model       : " + mModel.getModelName());
        Log.i(TAG, "Database    : " + mModel.getDatabaseName());
        Log.i(TAG, "Odoo Version: " + mUser.getOdooVersion().getServerSerie());
        // Calling service callback
        if (mService != null)
            mService.performDataSync(this, extras, mUser);

        //Creating domain
        ODomain domain = (mDomain.containsKey(mModel.getModelName())) ?
                mDomain.get(mModel.getModelName()) : null;

        // Ready for sync data from server
        syncData(mModel, mUser, domain, syncResult, true, true);
    }
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:27,代码来源:OSyncAdapter.java

示例2: validateUserObject

import com.odoo.core.auth.OdooAccountManager; //导入方法依赖的package包/类
private void validateUserObject() {
    if (OdooAccountManager.anyActiveUser(this)) {
        OUser user = OUser.current(this);
        if (!OdooAccountManager.isValidUserObj(this, user)
                && app.inNetwork()) {
            OdooUserObjectUpdater.showUpdater(this, new OdooUserObjectUpdater.OnUpdateFinish() {
                @Override
                public void userObjectUpdateFinished() {
                    startActivity(new Intent(OdooActivity.this, OdooLogin.class));
                    finish();
                }

                @Override
                public void userObjectUpdateFail() {
                    Toast.makeText(OdooActivity.this, OResource.string(OdooActivity.this,
                            R.string.toast_something_gone_wrong), Toast.LENGTH_LONG).show();
                    finish();
                }
            });
        }
    }
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:23,代码来源:OdooActivity.java

示例3: onPerformSync

import com.odoo.core.auth.OdooAccountManager; //导入方法依赖的package包/类
@Override
public void onPerformSync(Account account, Bundle extras, String authority,
                          ContentProviderClient provider, SyncResult syncResult) {
    // Creating model Object
    mModel = new OModel(mContext, null)
            .createInstance(mModelClass);
    mUser = mModel.getUser();
    if (OdooAccountManager.isValidUserObj(mContext, mUser)) {
        // Creating Odoo instance
        mOdoo = createOdooInstance(mContext, mUser);
        Log.i(TAG, "User        : " + mModel.getUser().getAndroidName());
        Log.i(TAG, "Model       : " + mModel.getModelName());
        Log.i(TAG, "Database    : " + mModel.getDatabaseName());
        Log.i(TAG, "Odoo Version: " + mUser.getOdooVersion().getServerSerie());
        // Calling service callback
        if (mService != null)
            mService.performDataSync(this, extras, mUser);

        //Creating domain
        ODomain domain = (mDomain.containsKey(mModel.getModelName())) ?
                mDomain.get(mModel.getModelName()) : null;

        // Ready for sync data from server
        syncData(mModel, mUser, domain, syncResult, true, true);
    }
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:27,代码来源:OSyncAdapter.java


注:本文中的com.odoo.core.auth.OdooAccountManager.isValidUserObj方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。