Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] stock_barcodes: out picking location workflow #245

Merged
merged 1 commit into from Jan 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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