Fix for bug #1139 : port from 1.3 :)

In creating new sales/purchase orders I got a specific vendor by default. This fix also set the criteria to search only for vendor (purchase) or customer (sales) orders.