mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Extract methods to allow more precise overrides
This commit is contained in:
committed by
Hai Lang
parent
f2553e0fc3
commit
3eaf69cc48
@@ -56,6 +56,14 @@ class VerticalLiftOperationPut(models.Model):
|
||||
def on_barcode_scanned(self, barcode):
|
||||
self.ensure_one()
|
||||
if self.step() == "scan_source":
|
||||
self._scan_source_action(barcode)
|
||||
elif self.step() in ("scan_tray_type", "save"):
|
||||
# note: we must be able to scan a different tray type when we are
|
||||
# in the save step too, in case we couldn't put it in the first one
|
||||
# for some reason.
|
||||
self._scan_tray_type_action(barcode)
|
||||
|
||||
def _scan_source_action(self, barcode):
|
||||
line = self._find_move_line(barcode)
|
||||
if line:
|
||||
self.current_move_line_id = line
|
||||
@@ -65,10 +73,7 @@ class VerticalLiftOperationPut(models.Model):
|
||||
_("No move line found for barcode {}").format(barcode)
|
||||
)
|
||||
|
||||
elif self.step() in ("scan_tray_type", "save"):
|
||||
# note: we must be able to scan a different tray type when we are
|
||||
# in the save step too, in case we couldn't put it in the first one
|
||||
# for some reason.
|
||||
def _scan_tray_type_action(self, barcode):
|
||||
tray_type = self._find_tray_type(barcode)
|
||||
if tray_type:
|
||||
if self._assign_available_cell(tray_type):
|
||||
|
||||
Reference in New Issue
Block a user