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


Java OdooVersionException类代码示例

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


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

示例1: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_members);

    textNoRecord = (TextView) findViewById(R.id.textEmpty);
    listView = (ListView) findViewById(R.id.list_team_members);
    listView.setOnItemClickListener(this);
    memberList = new ArrayList<>();

    editAddMembers = (EditText) findViewById(R.id.editAddTeamMember);
    editAddMembers.addTextChangedListener(this);

    findViewById(R.id.image_search).setOnClickListener(this);

    try {
        odoo = Odoo.createWithUser(this, OUser.current(this));
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:22,代码来源:SelectMembers.java

示例2: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.base_signup_activity);
    setResult(RESULT_CANCELED);
    try {
        odoo = Odoo.createInstance(this, AppConfig.HOST_URL);
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }

    editName = (EditText) findViewById(R.id.edit_name);
    editEmail = (EditText) findViewById(R.id.edit_email);
    editPassword = (EditText) findViewById(R.id.edit_password);

    // click listeners
    findViewById(R.id.btnSignup).setOnClickListener(this);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:19,代码来源:SignUpActivity.java

示例3: createNewStage

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
private void createNewStage(final String stageName) {
    if (!stageName.equals("")) {
        OUser user = OUser.current(this);
        try {
            Odoo odoo = Odoo.createWithUser(this, user);
            ORecordValues values = new ORecordValues();
            values.put("name", stageName);
            values.put("project_ids", Arrays.asList(Arrays.asList(6, false, Arrays.asList(extra.getInt(KEY_PROJECT_ID)))));
            odoo.createRecord("project.task.type", values, new OdooResponse() {
                @Override
                public void onResponse(OdooResult response) {
                    Toast.makeText(ProjectDetail.this, "new stage added", Toast.LENGTH_SHORT).show();
                }
            });
        } catch (OdooVersionException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:20,代码来源:ProjectDetail.java

示例4: createNewTask

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
private void createNewTask(int stage_id, String taskTitle) {
    if (!taskTitle.equals("")) {
        OUser user = OUser.current(this);
        try {
            Odoo odoo = Odoo.createWithUser(this, user);
            ORecordValues values = new ORecordValues();
            values.put("name", taskTitle);
            values.put("stage_id", taskStages.getServerId(stage_id));
            values.put("project_id", extra.getInt(KEY_PROJECT_ID));

            odoo.createRecord("project.task", values, new OdooResponse() {
                @Override
                public void onResponse(OdooResult response) {
                    Toast.makeText(ProjectDetail.this, "New task created", Toast.LENGTH_SHORT).show();
                }
            });
        } catch (OdooVersionException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:22,代码来源:ProjectDetail.java

示例5: moveTask

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
private void moveTask(final String stageName) {
    try {
        int task_id = projectTask.getServerId(Integer.parseInt(extra.getString(KEY_TASK_ID)));
        int stage_id = stageType.getServerId(stageName);

        Odoo odoo = Odoo.createWithUser(this, OUser.current(this));
        ORecordValues values = new ORecordValues();
        values.put("stage_id", stage_id);

        odoo.updateRecord("project.task", values, task_id, new OdooResponse() {
            @Override
            public void onResponse(OdooResult response) {
                CBind.setText((TextView) findViewById(R.id.taskStage), stageName);
                Toast.makeText(TaskDetailScroll.this, "Task moved to " + stageName,
                        Toast.LENGTH_SHORT).show();
            }
        });
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:22,代码来源:TaskDetailScroll.java

示例6: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_invitation_accept);
    data = getIntent().getExtras();
    teams = new ProjectTeams(this);
    try {
        odoo = Odoo.createWithUser(this, OUser.current(this));
        ODomain domain = new ODomain();
        domain.add("id", "=", Integer.parseInt(data.getString("res_id")));
        odoo.searchRead(teams.getModelName(), new OdooFields(), domain, 0, 1, null, new OdooResponse() {
            @Override
            public void onResponse(OdooResult response) {
                findViewById(R.id.progressBar2).setVisibility(View.GONE);
                findViewById(R.id.team_invitation_container).setVisibility(View.VISIBLE);
                bindView(response.getRecords().get(0));
            }
        });
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:23,代码来源:InvitationAccept.java

示例7: onClick

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
public void onClick(View view) {
    mView = view;
    if (isValid()) {
        try {
            progressDialog = new ProgressDialog(this);
            progressDialog.setTitle("Please Wait");
            progressDialog.setMessage("Logging in..");
            progressDialog.setCancelable(false);
            progressDialog.show();
            odoo = Odoo.createInstance(this, hostURL());
            odoo.setOnConnect(this);
        } catch (OdooVersionException e) {
            Log.w(TAG, e.getMessage());
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle(R.string.error_title_odoo_version);
            builder.setMessage(R.string.msg_unsupported_odoo_version);
            builder.setPositiveButton(android.R.string.ok, null);
            builder.show();
        }
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-follow-up,代码行数:23,代码来源:LoginActivity.java

示例8: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_team_name);

    try {
        odoo = Odoo.createWithUser(this, OUser.current(this));
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }

    editTeamName = (EditText) findViewById(R.id.team_name);
    findViewById(R.id.btn_team_create).setOnClickListener(this);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:15,代码来源:WizardNewTeam.java

示例9: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_team_add_members);
    setResult(RESULT_CANCELED);
    try {
        odoo = Odoo.createWithUser(this, OUser.current(this));
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }


    findViewById(R.id.editAddMember).setOnClickListener(this);
    findViewById(R.id.btn_continue).setOnClickListener(this);
    findViewById(R.id.btn_skip).setOnClickListener(this);

    memberIds = new ArrayList<>();

    arrayAdapter = new ArrayAdapter<Bundle>(this, R.layout.member_list_item,
            R.id.textMemberName, arrayList) {
        @NonNull
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = LayoutInflater.from(WizardAddTeamMembers.this).inflate(R.layout.member_list_item, parent, false);
            }
            TextView view = (TextView) convertView.findViewById(R.id.textMemberName);
            view.setText(getItem(position).getString(SelectMembers.KEY_MEMBER_NAME, ""));
            return convertView;
        }
    };
    memberListView = (ListView) findViewById(R.id.lst_team_members);
    memberListView.setOnItemClickListener(this);

    memberListView.setAdapter(arrayAdapter);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:37,代码来源:WizardAddTeamMembers.java

示例10: onCreate

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.home_activity);
    OAppBarUtils.setHasAppBar(this, false);
    setTitle(R.string.title_dashboard);
    try {
        odoo = Odoo.createWithUser(this, OUser.current(this));
    } catch (OdooVersionException e) {
        e.printStackTrace();
    }
    init();
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:14,代码来源:HomeActivity.java

示例11: parseVersion

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
public static OdooVersion parseVersion(OdooResult result) throws OdooVersionException {
    OdooVersion version = new OdooVersion();
    version.setServerSerie(result.getString("server_serie"));
    version.setServerVersion(result.getString("server_version"));
    List<Object> version_info = result.getArray("server_version_info");
    version.setVersionNumber(((Double) version_info.get(0)).intValue());
    if (version.getVersionNumber() < 8) {
        throw new OdooVersionException("Server version is different from " +
                "the application supported version. (Only Odoo 8.0+ supported)");
    }
    String versionType = version_info.get(1) + "";
    int versionTypeNumber = 0;
    if (versionType.contains("saas")) {
        versionTypeNumber = Integer.parseInt(versionType.split("~")[1]);
        versionType = "saas";
    }
    version.setVersionTypeNumber(versionTypeNumber);
    version.setVersionType(versionType);
    version.setVersionRelease((String) version_info.get(3));

    if (version.getVersionNumber() > 9) {
        String ent = version_info.get(5) + "";
        version.setEnterprise(ent.equals("e"));
    }

    return version;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:28,代码来源:OdooVersion.java

示例12: getVersionInfo

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
public OdooResult getVersionInfo() throws OdooVersionException {
    OdooSyncResponse response = new OdooSyncResponse();
    getVersionInfo(null, response);
    OdooResult version = validateResult(response);
    mVersion = OdooVersion.parseVersion(version);
    return version;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:8,代码来源:OdooWrapper.java

示例13: quickConnect

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
public static OUser quickConnect(Context context, String url, String username,
                                 String password, String database) throws OdooVersionException {
    Odoo odoo = new Odoo(context, url).connect(true);
    return odoo.authenticate(username, password, database);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:6,代码来源:Odoo.java

示例14: createInstance

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
public static Odoo createInstance(Context context, String baseURL) throws OdooVersionException {
    return new Odoo(context, baseURL).connect(false);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:4,代码来源:Odoo.java

示例15: createQuickInstance

import com.odoo.core.rpc.handler.OdooVersionException; //导入依赖的package包/类
public static Odoo createQuickInstance(Context context, String baseURL)
        throws OdooVersionException {
    return new Odoo(context, baseURL).connect(true);
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:5,代码来源:Odoo.java


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