1、采购入库,选取目标货位去重校验优化;2、添加功能刀具自动计算当前目标货位的值;

This commit is contained in:
yuxianghui
2024-12-26 10:01:42 +08:00
parent 0f4d25abb4
commit 06842c6df9
2 changed files with 9 additions and 5 deletions

View File

@@ -888,12 +888,11 @@ class SfStockMoveLine(models.Model):
def _check_destination_location_id(self):
for item in self:
if item:
i = 0
barcode = item.destination_location_id.barcode
for line in item.picking_id.move_line_ids_without_package:
if barcode and barcode == line.destination_location_id.barcode:
i += 1
if i > 1:
if line.destination_location_id:
if (barcode and barcode == line.destination_location_id.barcode
and item.product_id != line.product_id):
raise ValidationError(
'%s】货位已经被占用,请重新选择!!!' % item.destination_location_id.barcode)