This fixes what is explained in https://github.com/odoo/odoo/issues/20821#issuecomment-358574349 (PR #22330)