Skip to content

Commit

Permalink
[FIX] stock_picking_line_sequence: create with api.model_create_multi
Browse files Browse the repository at this point in the history
  • Loading branch information
andreampiovesana authored and StefanRijnhart committed Feb 3, 2025
1 parent eb1307f commit f17537d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions stock_picking_line_sequence/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ class StockMove(models.Model):
store=True,
)

@api.model
def create(self, values):
move = super().create(values)
@api.model_create_multi
def create(self, vals_list):
"""(re)initialize the sequences of the moves within a picking"""
moves = super().create(vals_list)
# We do not reset the sequence if we are copying a complete picking
# or creating a backorder
if not self.env.context.get("keep_line_sequence", False):
move.picking_id._reset_sequence()
return move
if not self.env.context.get("keep_line_sequence"):
moves.picking_id._reset_sequence()
return moves

0 comments on commit f17537d

Please sign in to comment.