Skip to content

Commit

Permalink
Merge PR #243 into 11.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jan 30, 2020
2 parents 5468380 + 0cdc4b0 commit 903e59c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stock_barcodes/wizard/stock_barcodes_read_picking.py
Expand Up @@ -83,14 +83,22 @@ def action_manual_entry(self):
return result

def _prepare_move_line_values(self, candidate_move, available_qty):
"""When we've got an out picking, the logical workflow is that
the scanned location is the location we're getting the stock
from"""
out_move = candidate_move.picking_code == 'outgoing'
location_id = (
self.location_id if out_move else self.picking_id.location_id)
location_dest_id = (
self.picking_id.location_id if out_move else self.location_id)
return {
'picking_id': self.picking_id.id,
'move_id': candidate_move.id,
'qty_done': available_qty,
'product_uom_id': self.product_id.uom_po_id.id,
'product_id': self.product_id.id,
'location_id': self.picking_id.location_id.id,
'location_dest_id': self.location_id.id,
'location_id': location_id.id,
'location_dest_id': location_dest_id.id,
'lot_id': self.lot_id.id,
'lot_name': self.lot_id.name,
}
Expand Down

0 comments on commit 903e59c

Please sign in to comment.