zhixiao jiang
zhixiao jiang

Reputation: 141

odoo mobile framework call method on odoo 10

can anyone help me out with my issue? i define a method called get_order_no on odoo 10

@api.one
@api.returns('self')
def get_order_no(self):
    order_no = self.env['ir.sequence'].next_by_code('car.seat')
    return order_no

then i call it on mobile side,here is code block

ServerDataHelper helper = getServerDataHelper();
OArguments oArguments = new OArguments();
oArguments.add(new JSONArray().put(2));
Object billno = helper.callMethod("get_order_no", oArguments);

finaly i got an exception from odoo 10.

TypeError:Mixing apples and oranger:car.seat().concat(170108027)

170108027 is generated by next_by_code method.

Another strange thing is: only first time call the get_order_no method success. when i debug the app again,can't call success,even not go into breakpoint in get_order_no method. only when i reinstall the app.the method can be called with the error above.

Upvotes: 0

Views: 372

Answers (1)

zhixiao jiang
zhixiao jiang

Reputation: 141

the problem was resolved .i made big mistake. when call server method .the android code should be write in AsyncTask method .

Upvotes: 0

Related Questions