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


Java Odoo类代码示例

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


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

示例1: onCreate

import com.odoo.core.rpc.Odoo; //导入依赖的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.Odoo; //导入依赖的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.Odoo; //导入依赖的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.Odoo; //导入依赖的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.Odoo; //导入依赖的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: doInBackground

import com.odoo.core.rpc.Odoo; //导入依赖的package包/类
@Override
protected Void doInBackground(Void... voids) {
    try {
        Odoo odoo = Odoo.createWithUser(TeamDetailView.this, mUser);
        OArguments args = new OArguments();
        args.add(new JSONArray());
        args.add(teamData.getInt("id"));
        args.add(partnerId);
        odoo.callMethod(teams.getModelName(), "leave_team", args, new HashMap<String, Object>());
        if (autoCloseActivity)
            teams.delete(teamData.getInt("_id"), true);
        teams.syncData();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:18,代码来源:TeamDetailView.java

示例7: onCreate

import com.odoo.core.rpc.Odoo; //导入依赖的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

示例8: onClick

import com.odoo.core.rpc.Odoo; //导入依赖的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

示例9: onConnect

import com.odoo.core.rpc.Odoo; //导入依赖的package包/类
@Override
public void onConnect(Odoo odoo) {
    odoo.getDatabaseList(new IDatabaseListListener() {
        @Override
        public void onDatabasesLoad(List<String> list) {
            if (list.size() > 1) {
                progressDialog.hide();
                // Multiple database choice
                //FIXME: Show user dialog for choice database
                /*
                    Replace code with Alert dialog.
                        - List databases in dialog
                        - user will select one of them
                        and then process with selected database.
                 */
                LoginTo(list.get(0));
            } else {
                // Single database
                LoginTo(list.get(0));
            }
        }
    });
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-follow-up,代码行数:24,代码来源:LoginActivity.java

示例10: doInBackground

import com.odoo.core.rpc.Odoo; //导入依赖的package包/类
@Override
protected Boolean doInBackground(ListRow... files) {
    try {
        ListRow file = files[0];
        Odoo odoo = Odoo.createWithUser(mContext, irAttachment.getUser());
        ORecordValues values = new ORecordValues();
        values.put("name", file.getString("name"));
        values.put("datas_fname", file.getString("datas_fname"));
        values.put("datas", file.getString("datas"));
        values.put("company_id", irAttachment.getUser().getCompanyId());
        values.put("type", "binary");
        values.put("res_model", model.getModelName());
        values.put("res_id", server_id);
        values.put("public", false);
        OdooResult result = odoo.createRecord(irAttachment.getModelName(), values);
        Thread.sleep(1000);
        return result.containsKey("result");
    } catch (Exception e) {
        e.printStackTrace();
    }
    return false;
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-follow-up,代码行数:23,代码来源:ChatterView.java

示例11: _removeAttachment

import com.odoo.core.rpc.Odoo; //导入依赖的package包/类
private void _removeAttachment(final ListRow attachment) {
    try {
        Odoo odoo = Odoo.createWithUser(this, mUser);
        odoo.unlinkRecord(irAttachment.getModelName(), attachment.getInt("id"), new IOdooResponse() {
            @Override
            public void onResponse(OdooResult response) {
                irAttachment.delete(attachment.getInt("_id"), true);
                getSupportLoaderManager().restartLoader(0, null, AttachmentViewer.this);
            }

            @Override
            public void onError(OdooError error) {

            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-follow-up,代码行数:20,代码来源:AttachmentViewer.java

示例12: onCreate

import com.odoo.core.rpc.Odoo; //导入依赖的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

示例13: onCreate

import com.odoo.core.rpc.Odoo; //导入依赖的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

示例14: onCreate

import com.odoo.core.rpc.Odoo; //导入依赖的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

示例15: onLoginSuccess

import com.odoo.core.rpc.Odoo; //导入依赖的package包/类
@Override
public void onLoginSuccess(Odoo odoo, OUser user) {
    this.odoo = odoo;
    if (DeviceAccountUtils.get(this).createAccount(user)) {
        getUserData(user);
    }
}
 
开发者ID:odoo-mobile-intern,项目名称:odoo-work,代码行数:8,代码来源:LoginActivity.java


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