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