diff --git a/yuthon_maintain/models/processing_order_approval.py b/yuthon_maintain/models/processing_order_approval.py index 29c037659..259d2b23b 100644 --- a/yuthon_maintain/models/processing_order_approval.py +++ b/yuthon_maintain/models/processing_order_approval.py @@ -105,6 +105,8 @@ class ProcessingOrderApproval(models.Model): for rec in order_ids: if not rec.is_fee: raise UserError('只有产生收费的维修才能生成应收!') + if rec.work_end: + raise UserError('流程未结束,不能生成应收!') if rec.repair_id: contract_id = rec.env["property.lease.contract.line"].search([('address_id', '=', rec.property_id.id)], limit=1) management_type_id = rec.env["yuthon.management.type"].search([('name', '=', '人工费/日光灯款/代垫用料费')]) diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py index 8b7eef2f3..db1e0a224 100644 --- a/yuthon_maintain/models/property_device_repair.py +++ b/yuthon_maintain/models/property_device_repair.py @@ -40,6 +40,7 @@ class PropertyDeviceRelief(models.Model): def pull_order(self): + self.report_state = 'done' return { 'name': '报事报修', 'view_mode': 'form', @@ -48,6 +49,7 @@ class PropertyDeviceRelief(models.Model): 'context': {'default_device_id': self.id}, } + class PropertyDeviceLine(models.Model): _name = 'property.device.line' _description = '设备信息' diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py index b4eed329c..e82989da7 100644 --- a/yuthon_maintain/models/property_report_repair.py +++ b/yuthon_maintain/models/property_report_repair.py @@ -64,6 +64,7 @@ class PropertyRentRelief(models.Model): self.phone = False def pull_order(self): + self.report_state = 'done' return { 'name': '报事报修', 'view_mode': 'form',