Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v13>...]Calling method with positionnal arguments don't work #18

Open
flotho opened this issue Oct 19, 2021 · 0 comments
Open

[v13>...]Calling method with positionnal arguments don't work #18

flotho opened this issue Oct 19, 2021 · 0 comments
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@flotho
Copy link

flotho commented Oct 19, 2021

try to call a simple message_post in v13 (signature has changed with the * ) : https://github.com/odoo/odoo/blob/13.0/addons/mail/models/mail_thread.py#L1812

example that worked for v<13.0

Long picking_id = (long) 1;
String errorMessage = "test message";
errorMessage = "'<ul>" + errorMessage + "</ul>'";

Object[] prepare1 = session.executeCommand("stock.picking", "message_post", new Object[] {
    new Object[]{ picking_id.intValue(), }, 
errorMessage				
}
);

causes :

021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 88, in x
mlrpc_2
2021/10/08 10:55:38 - send error messages to pickings.0 -     response = self._xmlrpc(service)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 68, in _
xmlrpc
2021/10/08 10:55:38 - send error messages to pickings.0 -     result = dispatch_rpc(service, method, params)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/http.py", line 141, in dispatch_rpc
2021/10/08 10:55:38 - send error messages to pickings.0 -     result = dispatch(method, params)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/service/model.py", line 41, in dispatch
2021/10/08 10:55:38 - send error messages to pickings.0 -     res = fn(db, uid, *params)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/service/model.py", line 168, in execute_kw
2021/10/08 10:55:38 - send error messages to pickings.0 -     return execute(db, uid, obj, method, *args, **kw or {})
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
2021/10/08 10:55:38 - send error messages to pickings.0 -     return f(dbname, *args, **kwargs)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/service/model.py", line 175, in execute
2021/10/08 10:55:38 - send error messages to pickings.0 -     res = execute_cr(cr, uid, obj, method, *args, **kw)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/service/model.py", line 159, in execute_cr
2021/10/08 10:55:38 - send error messages to pickings.0 -     result = odoo.api.call_kw(recs, method, args, kw)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/api.py", line 396, in call_kw
2021/10/08 10:55:38 - send error messages to pickings.0 -     result = _call_kw_multi(method, model, args, kwargs)
2021/10/08 10:55:38 - send error messages to pickings.0 -   File "/opt/odoo/odoo-server/odoo/api.py", line 383, in _call_kw_multi
2021/10/08 10:55:38 - send error messages to pickings.0 -     result = method(recs, *args, **kwargs)
2021/10/08 10:55:38 - send error messages to pickings.0 - TypeError: message_post() takes 1 positional argument but 2 were given

didn't find a way to pass body='messagevalue' as parameter thanks to java

@flotho flotho added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant