[FIX] Locations when M2O,should not be among view type
authorGPA(OpenERP) <>
Wed, 28 Apr 2010 07:49:49 +0000 (13:19 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Wed, 28 Apr 2010 07:49:49 +0000 (13:19 +0530)
lp bug: https://launchpad.net/bugs/570652 fixed

bzr revid: jvo@tinyerp.com-20100428074949-zy60xzqvly2h1muy

addons/purchase/purchase.py
addons/stock/stock.py

index 9bc1d8c..c212e38 100644 (file)
@@ -160,7 +160,7 @@ class purchase_order(osv.osv):
                 "In this case, it will remove the warehouse link and set the customer location."
         ),
         'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', states={'posted':[('readonly',True)]}),
-        'location_id': fields.many2one('stock.location', 'Destination', required=True),
+        'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]),
 
         'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
 
index 4b61a08..ccb0f5a 100644 (file)
@@ -1463,9 +1463,9 @@ class stock_warehouse(osv.osv):
         'name': fields.char('Name', size=60, required=True),
 #       'partner_id': fields.many2one('res.partner', 'Owner'),
         'partner_address_id': fields.many2one('res.partner.address', 'Owner Address'),
-        'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True),
-        'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True),
-        'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True),
+        'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True, domain=[('usage','<>','view')]),
+        'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True, domain=[('usage','<>','view')]),
+        'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True, domain=[('usage','<>','view')]),
     }
 
 stock_warehouse()