ERP-Ukraine / odoo-rpc-dart

Odoo RPC Library for Dart
MIT License
43 stars 32 forks source link

Update code function : callRPC #45

Closed tarikmsr closed 4 months ago

tarikmsr commented 7 months ago

You should update this String by the param which is funcName

It looks like there might be an issue with how you're sending the request to the Odoo server. In your callRPC function, you're setting the method name as a string 'funcName' instead of the actual value of the funcName variable.

  Future<dynamic> callRPC(path, funcName, params) async {
 final uri = Uri.parse(baseURL + path);
    var body = json.encode({
      'jsonrpc': '2.0',
      'method': 'funcName',  // // Update this line by   'method': funcName,
      'params': params,
      'id': sha1.convert(utf8.encode(DateTime.now().toString())).toString()
    });

Path: line 183

link

# Error:

I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\http.py", line 1588, in _serve_db
I/flutter (21348):     return service_model.retrying(self._serve_ir_http, self.env)
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\service\model.py", line 133, in retrying
I/flutter (21348):     result = func()
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\http.py", line 1615, in _serve_ir_http
I/flutter (21348):     response = self.dispatcher.dispatch(rule.endpoint, args)
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\http.py", line 1819, in dispatch
I/flutter (21348):     result = self.request.registry['ir.http']._dispatch(endpoint)
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\addons\website\models\ir_http.py", line 237, in _dispatch
I/flutter (21348):     response = super()._dispatch(endpoint)
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\addons\base\models\ir_http.py", line 154, in _dispatch
I/flutter (21348):     result = endpoint(**request.params)
I/flutter (21348):   File "C:\Program Files\Odoo 16.0\server\odoo\http.py",
I/flutter (21348): 505-builtins.TypeError

Thank you for your effort

lem8r commented 4 months ago

Thanks for reporting!