backport from SimplERP