Commit 41f6af00 by 夏超

[fix] 修改问题

parent 86b27971
...@@ -13,7 +13,7 @@ class JzjxInheritRepairOrder(models.Model): ...@@ -13,7 +13,7 @@ class JzjxInheritRepairOrder(models.Model):
class JzjxInheritRepairOrderLine(models.Model): class JzjxInheritRepairOrderLine(models.Model):
_inherit = "roke.repair.order.line" _inherit = "roke.repair.order.line"
repair_work_order_id = fields.Many2one("roke.work.order", string="返修工单", ondelete='cascade') repair_work_order_id = fields.Many2one("roke.work.order", string="返修工单", ondelete='restrict')
is_refix_auto_work_order = fields.Boolean(string="是否自动生产返修单") is_refix_auto_work_order = fields.Boolean(string="是否自动生产返修单")
reason_id = fields.Many2one("roke.scrap.reason", string="报废原因", ondelete='restrict') reason_id = fields.Many2one("roke.scrap.reason", string="报废原因", ondelete='restrict')
...@@ -13,5 +13,5 @@ class JzjxInheritScrapOrder(models.Model): ...@@ -13,5 +13,5 @@ class JzjxInheritScrapOrder(models.Model):
class JzjxInheritScrapOrderLine(models.Model): class JzjxInheritScrapOrderLine(models.Model):
_inherit = "roke.scrap.order.line" _inherit = "roke.scrap.order.line"
scrap_work_order_ids = fields.Many2many("roke.work.order", string="补件工单", ondelete='cascade') scrap_work_order_ids = fields.Many2many("roke.work.order", string="补件工单", ondelete='restrict')
is_rfe = fields.Boolean(string="是否工单补件") is_rfe = fields.Boolean(string="是否工单补件")
...@@ -94,6 +94,12 @@ class InheritWorkOrder(models.Model): ...@@ -94,6 +94,12 @@ class InheritWorkOrder(models.Model):
class InheritRokeWorkRecordModel(models.Model): class InheritRokeWorkRecordModel(models.Model):
_inherit = "roke.work.record" _inherit = "roke.work.record"
def withdraw_repair_scrap(self):
work_order = self.work_order_id
if not work_order.task_id and not work_order.record_ids and work_order.type == "生产":
# 无生产任务且当前工单下无其它报工记录时时,撤回直接删除工单
work_order.unlink()
def withdraw(self): def withdraw(self):
""" """
撤回报工 撤回报工
......
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