本文整理汇总了Java中com.odoo.core.rpc.Odoo.createRecord方法的典型用法代码示例。如果您正苦于以下问题:Java Odoo.createRecord方法的具体用法?Java Odoo.createRecord怎么用?Java Odoo.createRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.odoo.core.rpc.Odoo
的用法示例。
在下文中一共展示了Odoo.createRecord方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
}
示例2: 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();
}
}
}
示例3: 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;
}