Copied from https://github.com/subteno-it/python-zpl2, as there has been
new release (1.2.1) that breaks current code without clear source (no
commit on the repo). As the amount of code is not too much, we put it on
the module itself, being able to control the whole chain, and to reduce
the code with the considerations of current Odoo version.
This commit has as author the main commmiter of the library repo.