Skip to content

Commit

Permalink
[FIX] stock_barcodes: Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdauden committed Oct 8, 2024
1 parent 95e44ab commit 0d46d36
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
14 changes: 0 additions & 14 deletions stock_barcodes/wizard/stock_barcodes_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,20 +662,6 @@ def action_clean_values(self):
def action_manual_entry(self):
return True

def _prepare_scan_log_values(self, log_detail=False):
return {
"name": self.barcode,
"location_id": self.location_id.id,
"product_id": self.product_id.id,
"packaging_id": self.packaging_id.id,
"lot_id": self.lot_id.id,
"packaging_qty": self.packaging_qty,
"product_qty": self.product_qty,
"manual_entry": self.manual_entry,
"res_model_id": self.res_model_id.id,
"res_id": self.res_id,
}

# TODO: To remove when stock_move_location uses action_clean_values
def reset_qty(self):
self.product_qty = 0
Expand Down
32 changes: 0 additions & 32 deletions stock_barcodes/wizard/stock_barcodes_read_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,38 +715,6 @@ def check_done_conditions(self):
return False
return res

def _prepare_scan_log_values(self, log_detail=False):
# Store in read log line each line added with the quantities assigned
vals = super()._prepare_scan_log_values(log_detail=log_detail)
vals["picking_id"] = self.picking_id.id
if log_detail:
vals["log_line_ids"] = [
(0, 0, {"move_line_id": x[0], "product_qty": x[1]})
for x in log_detail.items()
]
return vals

def remove_scanning_log(self, scanning_log):
for log in scanning_log:
for log_scan_line in log.log_line_ids:
sml = log_scan_line.move_line_id
if sml.state not in ["draft", "assigned", "confirmed"]:
raise ValidationError(
_(
"You cannot remove an entry linked to a operation "
"in state new, assigned or confirmed"
)
)
qty = sml.qty_done - log_scan_line.product_qty
log_scan_line.move_line_id.qty_done = max(qty, 0.0)
if sml.state == "draft" and sml.move_id.quantity_done == 0.0:
# This move has been created by the last scan, remove it.
sml.move_id.unlink()
self.picking_product_qty = sum(
log.log_line_ids.mapped("move_line_id.move_id.quantity_done")
)
log.unlink()

def get_lot_by_removal_strategy(self):
quants = first(
self.env["stock.quant"]._gather(self.product_id, self.location_id)
Expand Down

0 comments on commit 0d46d36

Please sign in to comment.