Skip to content

Commit

Permalink
[IMP] stock_barcodes: Performance and extra checks from 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdauden committed Nov 25, 2024
1 parent f524a02 commit 1da71e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stock_barcodes/wizard/stock_barcodes_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,9 @@ def action_create_package(self):

def action_clean_values(self):
options = self.option_group_id.option_ids
options_to_clean = options.filtered("clean_after_done")
options_to_clean = options.filtered(
lambda op: op.clean_after_done and op.field_name in self
)
for option in options_to_clean:
if option.field_name == "result_package_id" and self.keep_result_package:
continue
Expand Down
4 changes: 4 additions & 0 deletions stock_barcodes/wizard/stock_barcodes_read_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,10 @@ def _process_stock_move_line(self): # noqa: C901
domain = self._prepare_stock_moves_domain()
if self.option_group_id.barcode_guided_mode == "guided":
moves_todo = self.todo_line_id.stock_move_ids
elif self.picking_id:
moves_todo = self.picking_id.move_lines.filtered(
lambda sm: sm.product_id == self.product_id
)
else:
moves_todo = StockMove.search(domain)
if not getattr(
Expand Down

0 comments on commit 1da71e4

Please sign in to comment.