单击项目时如何将状态从发送更改为读取

时间:2018-05-09 20:03:15

标签: odoo odoo-10 odoo-mobile

当我点击项目列表视图但我不能

时,我需要更新销售状态

这是我的代码

public void onItemClick(AdapterView<?> parent, View view, int 
 position, long id) {
  ODataRow row = OCursorUtils.toDatarow((Cursor)mAdapter.getItem(position));


OValues values =new OValues();
);

enter image description here

2 个答案:

答案 0 :(得分:0)

您可以调用update方法更改state的值,但我强烈建议您对Odoo使用相同的逻辑。

此示例显示如何将销售订单状态更改为progress

SaleOrder saleOrder = new SaleOrder(getContext(), null);
OValues values = new OValues();
values.put("state", "progress");
saleOrder.update(row.getInt(OColumn.ROW_ID), values);

答案 1 :(得分:0)

您好,尝试直接调用“ mark_as_read”。 例如,我正在从“ sale.order”模型中调用该action_confirm方法

odoo.callMethod("sale.order",//model name "action_confirm",//method name new OArguments() {{add(id);}},//id if particular record null);