Backport sale_order_dates from v8

This branch contains most of the improvements which got merged into v8, and that we already use in v7 on a daily basis on our instance.
It should not break any other modules as far as I know.