See commit messages for better description. This MR is related to https://lab.nexedi.com/nexedi/erp5/merge_requests/877