diff --git a/stock_barcodes/wizard/stock_barcodes_read.py b/stock_barcodes/wizard/stock_barcodes_read.py index 20a7c0ce048..0bb0d6d2cfb 100644 --- a/stock_barcodes/wizard/stock_barcodes_read.py +++ b/stock_barcodes/wizard/stock_barcodes_read.py @@ -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 diff --git a/stock_barcodes/wizard/stock_barcodes_read_picking.py b/stock_barcodes/wizard/stock_barcodes_read_picking.py index 93823667598..c55b45db29b 100644 --- a/stock_barcodes/wizard/stock_barcodes_read_picking.py +++ b/stock_barcodes/wizard/stock_barcodes_read_picking.py @@ -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)