Commit 334d0c01 by 夏超

[fix] 修改问题

parent a360f704
......@@ -283,3 +283,18 @@ class RokeWorkstationWorkOrderModel(http.Controller):
"work_order_ids": routing.routing_task_id.change_routing_id_work_order(routing)
})
return {"code": 0, "message": f"工艺路线生成工单成功!"}
@http.route('/roke/workstation/craft_design/workstation_verify_if_editable', type='json', auth='user',
csrf=False, cors="*")
def workstation_verify_if_editable(self):
"""
根据任务报工情况判断工艺设计是否可编辑
"""
_self = http.request
routing_id = _self.jsonrequest.get("routing_id", 0)
routing = _self.env["roke.routing"].search([("id", "=", routing_id)])
if not routing.routing_task_id:
return {"code": 0, "message": f"工艺没有相应的任务,不可编辑!", "editable": False}
if routing.routing_task_id.record_ids:
return {"code": 0, "message": f"绑定任务已报工,不可编辑!", "editable": False}
return {"code": 0, "message": f"获取成功!", "editable": True}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment