Skip to content

Wrong version check with last version #31

Open
@quentinsup

Description

@quentinsup

To begin, I really thank you for your works on this lib !

I've tried to use it with the version 17 (using lib in development from the branch V17), but there is a check version compability from the startSession() which fail. I've extract the source code and saw that there is an issue by extraction the major and minor version.

For example, my version is "saas~17.4+pre" and the Version class is looking for a '-' into the version string to split and extract the major and minor, which appears -1 in my situation.

I've modified the source code to extract the major / minor value from the new version tag and everything is working well after that.

I recommand to update the Version class extraction method, and maybe change the checkVersionCompatibility() too to be more permissive on major upper version.

    private void checkVersionCompatibility() throws XmlRpcException, OdooApiException {
        if (this.getServerVersion().getMajor() < 8) {
            throw new OdooApiException("Only Odoo Version from v8.x to 17.x are maintained. "
                    + "Please choose another version of the library");
        }
        if (this.getServerVersion().getMajor() > 17) {
            System.out.println("Only Odoo Version from v8.x to 17.x are maintained. Some features should not work properly. Please upgrade the version of the library");
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions