Skip to content

Commit

Permalink
Update stock.py
Browse files Browse the repository at this point in the history
model_create_multi warning
  • Loading branch information
andreampiovesana authored Jan 31, 2025
1 parent 6bbcf32 commit 3e9a567
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions stock_picking_line_sequence/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class StockMove(models.Model):
store=True,
)

@api.model
def create(self, values):
move = super(StockMove, self).create(values)
# 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
@api.model_create_multi
def create(self, vals_list):
moves = super(StockMove, self).create(val_list)
for move in moves:
# 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()


class StockMoveLine(models.Model):
Expand Down

0 comments on commit 3e9a567

Please sign in to comment.