交期状态修改

This commit is contained in:
liaodanlong
2024-11-15 10:33:47 +08:00
parent 9a9bfd198b
commit 811a79c7c1
3 changed files with 18 additions and 19 deletions

View File

@@ -35,23 +35,18 @@ class MrpProduction(models.Model):
tool_state_remark2 = fields.Text(string='功能刀具状态备注(无效刀)', readonly=True)
def _compute_default_delivery_status(self):
need_list = [
'pending_cam',
'progress',
'rework',
'scrap',
'to_close',
]
try:
if self.state not in need_list:
if self.state == 'cancel':
return False
if not self.deadline_of_delivery:
return '已逾期'
return False
hours = self.get_hours_diff()
if hours >= 48:
return '正常'
elif hours > 0 and hours < 48:
elif hours > 0 and hours < 48 and self.state != 'done':
return '预警'
elif hours > 0 and hours < 48 and self.state == 'done':
return '正常'
else:
return '已逾期'
except Exception as e:
@@ -97,6 +92,9 @@ class MrpProduction(models.Model):
def _corn_update_delivery_status(self):
need_list = [
'draft',
'technology_to_confirmed',
'confirmed',
'pending_cam',
'progress',
'rework',