Commit 1f78adcf by 夏超

[fix] 修改问题

parent 334d0c01
......@@ -138,6 +138,8 @@ class InheritProductionTask(models.Model):
return res
def craft_design(self):
if self.record_ids and not self.routing_id.routing_task_id:
raise ValidationError("该任务已报工,无法生成新的工艺设计。")
if not self.routing_id:
routing_id = self.env["roke.routing"].create({
"name": f"{self.product_id.name}({self.code})" or "",
......
......@@ -2491,6 +2491,7 @@
this.routingInfoSortSaveApi(config).then(data => {
this.loading = false
this.$message.success(data.result.message)
this.workstation_work_process_check_work_order()
}).catch(error => {
this.errorHandle(error, true)
})
......
......@@ -23,8 +23,7 @@
<button name="upload_task" type="object" string="上传任务" class="btn btn-primary"
attrs="{'invisible': [('UploadMsg', '=', 'OK')]}"/>
<field name="record_ids" invisible="1"/>
<button name="craft_design" type="object" string="工艺设计" class="btn btn-primary"
attrs="{'invisible': [('record_ids', '!=', [])]}"/>
<button name="craft_design" type="object" string="工艺设计" class="btn btn-primary"/>
</xpath>
</field>
</record>
......
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