[FIX]stock:put constrain for restric view type location as destination in picking

lp bug: https://launchpad.net/bugs/780354 fixed

bzr revid: ron@tinyerp.com-20110511065746-ioojaku0d2os8gpz
This commit is contained in:
ron@tinyerp.com
2011-05-11 12:27:46 +05:30
parent 12f8701002
commit c9d436f089
+13
View File
@@ -658,6 +658,19 @@ class stock_picking(osv.osv):
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
}
def _destination_location(self, cr, uid, ids, context=None):
if context is None:
context = {}
for record in self.browse(cr, uid, ids, context=context)[0].move_lines:
if record.location_dest_id.usage == 'view':
return False
return True
_constraints = [
(_destination_location, 'You cannot put view type location as Destination location.', ['location_dest_id'])
]
def action_process(self, cr, uid, ids, context=None):
if context is None: context = {}
partial_id = self.pool.get("stock.partial.picking").create(