I’m writing a PHP library for accessing the Odoo XML-RPC API and I need to know the Odoo version of the server I’m talking to – but I can’t figure out how to determine the version. Is there a certain model that will tell me or how do I do that?
UPDATE
I thought I have figured it out. The ir.module.module
model will give you a list of all the installed modules. Then in the base
module you look at the installed_version
property. BUT this requires admin access! I need to do this as the regular user that is normally using the API.
But for anyone who has that kind of access this is what you would do. Using ripcord (see example here) you would use this line to retrive just the base
module:
$models->execute_kw($db, $username, $password, 'ir.module.module', 'search_read', array(array(array('name', '=', 'base'))) );
2
Answers
You can get the Odoo version even without authentication from the API common endpoint. See documentation on https://www.odoo.com/documentation/12.0/webservices/odoo.html heading ”Logging in” and the first code sample there. You can find the server_version property there.
Following code is valid and working fine tested on multiple servers.