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


Java IrModel类代码示例

本文整理汇总了Java中com.odoo.base.addons.ir.IrModel的典型用法代码示例。如果您正苦于以下问题:Java IrModel类的具体用法?Java IrModel怎么用?Java IrModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IrModel类属于com.odoo.base.addons.ir包,在下文中一共展示了IrModel类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOptionsItemSelected

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case android.R.id.home:
            // app icon in action bar clicked; go home
            finish();
            return true;
        case R.id.menu_about_our_apps:
            IntentUtils.openURLInBrowser(this, OConstants.URL_ODOO_APPS_ON_PLAY_STORE);
            return true;
        case R.id.menu_about_github:
            IntentUtils.openURLInBrowser(this, OConstants.URL_ODOO_MOBILE_GIT_HUB);
            return true;
        case R.id.menu_export_db:
            IrModel model = new IrModel(this);
            model.exportDB();
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:22,代码来源:About.java

示例2: getLastSyncDateTime

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public String getLastSyncDateTime() {
    IrModel model = new IrModel(mContext);
    List<ODataRow> records = model.select(null, "model = ?", new String[]{getModelName()});
    if (records.size() > 0) {
        String date = records.get(0).getString("last_synced");
        Date write_date = ODateUtils.createDateObject(date, ODateUtils.DEFAULT_FORMAT, true);
        Calendar cal = Calendar.getInstance();
        cal.setTime(write_date);
        /*
            Fixed for Postgres SQL
            It stores milliseconds so comparing date wrong. 
         */
        cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + 2);
        write_date = cal.getTime();
        return ODateUtils.getDate(write_date, ODateUtils.DEFAULT_FORMAT);
    }
    return null;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:19,代码来源:OModel.java

示例3: onOptionsItemSelected

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case android.R.id.home:
            // app icon in action bar clicked; go home
            finish();
            return true;
        case R.id.menu_about_our_apps:
            IntentUtils.openURLInBrowser(this, OConstants.URL_ODOO_APPS_ON_PLAY_STORE);
            return true;
        case R.id.menu_about_github:
            IntentUtils.openURLInBrowser(this, OConstants.URL_ODOO_MOBILE_GIT_HUB);
            return true;
        case R.id.menu_export_db:
            IrModel model = new IrModel(this, null);
            model.exportDB();
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:22,代码来源:About.java

示例4: getLastSyncDateTime

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public String getLastSyncDateTime() {
    IrModel model = new IrModel(mContext, mUser);
    List<ODataRow> records = model.select(null, "model = ?", new String[]{getModelName()});
    if (records.size() > 0) {
        String date = records.get(0).getString("last_synced");
        Date write_date = ODateUtils.createDateObject(date, ODateUtils.DEFAULT_FORMAT, true);
        Calendar cal = Calendar.getInstance();
        cal.setTime(write_date);
        /*
            Fixed for Postgres SQL
            It stores milliseconds so comparing date wrong. 
         */
        cal.set(Calendar.SECOND, cal.get(Calendar.SECOND) + 2);
        write_date = cal.getTime();
        return ODateUtils.getDate(write_date, ODateUtils.DEFAULT_FORMAT);
    }
    return null;
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:19,代码来源:OModel.java

示例5: baseModels

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public static List<OModel> baseModels(Context context, OUser user) {
    List<OModel> models = new ArrayList<>();
    models.add(new IrModel(context));
    models.add(new ResPartner(context));
    models.add(new ResUsers(context));
    models.add(new ResCompany(context));
    models.add(new IrAttachment(context));
    models.add(new MailMessage(context));
    models.add(new ProductPublicCategory(context));
    models.add(new ProductProduct(context));
    models.add(new FavouriteProducts(context));
    models.add(new ShopCart(context));
    models.add(new RecentViewProducts(context));
    return models;
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:16,代码来源:BaseModels.java

示例6: isInstalledOnServer

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public void isInstalledOnServer(final String module_name, IModuleInstallListener callback) {
    App app = (App) mContext.getApplicationContext();
    app.getOdoo(getUser()).installedOnServer(module_name, new IModuleInstallListener() {
        @Override
        public void installedOnServer(boolean isInstalled) {
            IrModel model = new IrModel(mContext);
            OValues values = new OValues();
            values.put("id", 0);
            values.put("name", module_name);
            values.put("state", "installed");
            model.insertOrUpdate("name = ?", new String[]{module_name}, values);
        }
    });
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:15,代码来源:OModel.java

示例7: baseModels

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public static List<OModel> baseModels(Context context, OUser user) {
    List<OModel> models = new ArrayList<>();
    models.add(new OdooNews(context, user));
    models.add(new IrModel(context, user));
    models.add(new ResPartner(context, user));
    models.add(new ResUsers(context, user));
    models.add(new ResCompany(context, user));
    models.add(new IrAttachment(context, user));
    models.add(new MailMessage(context, user));
    return models;
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:12,代码来源:BaseModels.java

示例8: isInstalledOnServer

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
public void isInstalledOnServer(final String module_name, IModuleInstallListener callback) {
    App app = (App) mContext.getApplicationContext();
    app.getOdoo(getUser()).installedOnServer(module_name, new IModuleInstallListener() {
        @Override
        public void installedOnServer(boolean isInstalled) {
            IrModel model = new IrModel(mContext, getUser());
            OValues values = new OValues();
            values.put("id", 0);
            values.put("name", module_name);
            values.put("state", "installed");
            model.insertOrUpdate("name = ?", new String[]{module_name}, values);
        }
    });
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:15,代码来源:OModel.java

示例9: setModel

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
@Override
public void setModel(Uri uri) {
    mModel = new IrModel(getContext());
}
 
开发者ID:dpr-odoo,项目名称:trainee-om-shop,代码行数:5,代码来源:IrModelProvider.java

示例10: setModel

import com.odoo.base.addons.ir.IrModel; //导入依赖的package包/类
@Override
public void setModel(Uri uri) {
    mModel = new IrModel(getContext(), getUser(uri));
}
 
开发者ID:Odoo-mobile,项目名称:hr,代码行数:5,代码来源:IrModelProvider.java


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