上下产线接口新增IsComplete判断

This commit is contained in:
jinling.yang
2024-04-26 18:04:30 +08:00
parent 8f9781dd13
commit 42178e3e1e
6 changed files with 87 additions and 70 deletions

View File

@@ -28,8 +28,7 @@ class Workpiece(http.Controller):
req_codes = ret['reqCode'].split(',')
for req_code in req_codes:
workpiece_delivery = request.env['sf.workpiece.delivery'].sudo().search(
[('production_id.name', '=', req_code.rsplit('-', 1)[0]),
('delivery_num', '=', req_code.strip())])
[('delivery_num', '=', req_code.strip()), ('task_completion_time', '=', False)])
if workpiece_delivery:
workpiece_delivery.write({'status': '已配送', 'task_completion_time': datetime.now()})
else: