解决刀具组装时,扫描刚刚拆解完的刀柄状态没有实时更新为可用的问题。

This commit is contained in:
yuxianghui
2024-08-27 14:39:49 +08:00
parent c956b06f57
commit 069d1f50b0

View File

@@ -387,9 +387,9 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
lot_ids = self.env['stock.lot'].sudo().search([('rfid', '=', barcode)])
if lot_ids:
for lot_id in lot_ids:
if lot_id.quant_ids[-1].location_id.name in '刀具房':
if lot_id.tool_material_status == '可用':
record.handle_code_id = lot_id.id
elif lot_id.quant_ids[-1].location_id.name == '刀具组装位置':
elif lot_id.quant_ids[-1].location_id.name in ['刀具组装位置']:
raise ValidationError('该刀柄已使用,请重新扫描!!!')
else:
raise ValidationError('该刀柄未入库,请重新扫描!!!')