feat: route update 时from_route存在则不可修改关键信息

This commit is contained in:
caoqianming 2025-09-02 15:16:55 +08:00
parent ba0e86d834
commit a6b320bad6
1 changed files with 1 additions and 1 deletions

View File

@ -378,7 +378,7 @@ class RouteViewSet(CustomModelViewSet):
if routepack and routepack.state != RoutePack.RP_S_CREATE: if routepack and routepack.state != RoutePack.RP_S_CREATE:
raise ParseError('该工艺路线非创建中不可编辑') raise ParseError('该工艺路线非创建中不可编辑')
ins_n:Route = serializer.save() ins_n:Route = serializer.save()
if ins_n.material_in != old_m_in or ins_n.material_out != old_m_out or ins_n.process != process: if ins.from_route and ins_n.material_in != old_m_in or ins_n.material_out != old_m_out or ins_n.process != process:
raise ParseError("该工艺步骤被其他步骤引用, 无法修改关键信息") raise ParseError("该工艺步骤被其他步骤引用, 无法修改关键信息")
def perform_destroy(self, instance:Route): def perform_destroy(self, instance:Route):