Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

How to use 'read_group' method in mobile application ? #390

Open naitikvithlani opened 5 years ago

naitikvithlani commented 5 years ago

I am able to call search_read, create, unlink, write methods of odoo.

When I try to call 'read_group' at the same way like other methods using URL ending with "web/dataset/call_kw" getting below error.

URL: http://192.168.0.114:9090/web/dataset/call_kw

Header Params:

X-Openerp-Session-Id: fab3bXXXXXXXXXXXXXXb6fe72e4164fe956cd7
Content-Type: application/json

Body Params:

{
    "jsonrpc": "2.0",
    "method": "call_kw",
    "params": {
        "method": "read_group",
        "model": "sale.order",
        "fields": [
            "user_id", "amount_total"
        ],
        "domain": null,
        "offset": 0,
        "limit": 0
    }
}

Error response :

{
    "jsonrpc": "2.0",
    "id": null,
    "error": {
        "message": "Odoo Server Error",
        "code": 200,
        "data": {
            "debug": "Traceback (most recent call last):\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/evo8/odoo10c+e/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/evo8/odoo10c+e/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\nTypeError: call_kw() got an unexpected keyword argument 'domain'\n",
            "exception_type": "internal_error",
            "message": "call_kw() got an unexpected keyword argument 'domain'",
            "name": "exceptions.TypeError",
            "arguments": [
                "call_kw() got an unexpected keyword argument 'domain'"
            ]
        }
    }
}

Any can suggest how to implement this method.