本文整理汇总了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);
}
}
示例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();
}
});
}
}
}
示例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);
}
}