Skip to content

Commit

Permalink
fixup! [FIX] stock_location_orderpoint_source_relocate
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaudoux committed Sep 19, 2023
1 parent d9b0d0e commit c969825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions stock_location_orderpoint/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ def _create_orderpoint(self, **kwargs):
return location_orderpoint.save()

@classmethod
def _create_move(cls, name, qty, location, location_dest):
move = cls.env["stock.move"].create(
def _create_move(cls, name, qty, location, location_dest, defaults=None):
vals = defaults or {}
vals.update(
{
"name": name,
"date": datetime.today(),
Expand All @@ -89,6 +90,7 @@ def _create_move(cls, name, qty, location, location_dest):
"location_dest_id": location_dest.id,
}
)
move = cls.env["stock.move"].create(vals)
move._write({"create_date": datetime.now()})
move._action_confirm()
return move
Expand All @@ -111,12 +113,13 @@ def _create_incoming_move(cls, qty, location):
move._action_done()
return move

def _create_outgoing_move(self, qty, location=None):
def _create_outgoing_move(self, qty, location=None, defaults=None):
move = self._create_move(
"Delivery",
qty,
location or self.location_dest,
self.env.ref("stock.stock_location_customers"),
defaults=defaults,
)
move._action_assign()
return move
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ def _apply_source_relocate(self):

def _after_apply_source_relocate_rule(self):
super()._after_apply_source_relocate_rule()
self = self.with_context(skip_auto_replenishment=False)
self._prepare_auto_replenishment_for_waiting_moves()

0 comments on commit c969825

Please sign in to comment.