[FIX] procurement: User belonging to the company other then the 'Your Company' would...
[odoo/odoo.git] / addons / procurement / procurement.py
index cc43bbb..78786cb 100644 (file)
@@ -551,7 +551,7 @@ class stock_warehouse_orderpoint(osv.osv):
         res = super(stock_warehouse_orderpoint, self).default_get(cr, uid, fields, context)
         # default 'warehouse_id' and 'location_id'
         if 'warehouse_id' not in res:
-            warehouse_ids = warehouse_obj.search(cr, uid, [('company_id', '=', res.get('company_id'))], context=context)
+            warehouse_ids = warehouse_obj.search(cr, uid, [('company_id', '=', res['company_id'])], context=context)
             res['warehouse_id'] = warehouse_ids and warehouse_ids[0] or False
         if 'location_id' not in res:
             res['location_id'] = False if not res.get('warehouse_id') else warehouse_obj.browse(cr, uid, res['warehouse_id'], context).lot_stock_id.id