Skip to content

Commit

Permalink
Merge pull request #53 from adhoc-dev/8.0-fix-stock-transfer-restrict…
Browse files Browse the repository at this point in the history
…-lot

FIX stock tranfer restict lot funtion search to transfer product
  • Loading branch information
jjscarafia committed May 8, 2017
2 parents 08a780e + f818b0e commit 1613c45
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions stock_transfer_restrict_lot/stock_move.py
Expand Up @@ -24,17 +24,23 @@ def do_detailed_transfer(self):
if lot:
quants = self.env['stock.quant'].search(
[('id', 'in', lot.quant_ids.ids),
('location_id', '=', self.item_ids[0].sourceloc_id.id)])
('location_id', '=', self.item_ids[
0].sourceloc_id.id), '|',
('reservation_id', '=', False),
('reservation_id.picking_id', '=', self.
picking_id.id)])
if quants:
qty = sum([x.qty for x in quants])
else:
qty = 0.0
if qty < item['quantity']:
raise Warning(
_('Sending amount can not exceed the quantity in stock for this product in this lot. \
_('Sending amount can not exceed the quantity'
' in stock for this product in this lot. \
\n Product:%s \
\n Lot:%s \
\n Stock:%s') % (lot.product_id.name, lot.name, qty))
\n Stock:%s') % (
lot.product_id.name, lot.name, qty))

super(stock_transfer_details, self).do_detailed_transfer()
else:
Expand Down

0 comments on commit 1613c45

Please sign in to comment.