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

[16.0][FIX] stock_picking_line_sequence model_create_multi #1861

Open
wants to merge 2 commits into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(vals_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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this should be done once per picking. This should be grouped per picking.



class StockMoveLine(models.Model):
Expand Down
Loading