Skip to content

Commit

Permalink
Synchronize destination location on package level
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen committed Dec 22, 2020
1 parent 4809a8f commit fbbec98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stock_checkout_sync/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ def sync_checkout_destination(self, location):
lambda m: (m.state == "waiting" or m.state == "assigned")
and m.location_id != location
).write({"location_id": location.id})
lines = moves.mapped("move_line_ids")
lines.filtered(

lines = moves.mapped("move_line_ids").filtered(
lambda l: l.location_dest_id != location and l.state != "done"
).write({"location_dest_id": location.id})
)
lines.write({"location_dest_id": location.id})
lines.package_level_id.write({"location_dest_id": location.id})

def _moves_to_sync_checkout(self):
selected_pickings = OrderedDict()
Expand Down

0 comments on commit fbbec98

Please sign in to comment.