优化代码

This commit is contained in:
mgw
2023-11-08 11:24:05 +08:00
parent 7f5ac4ef90
commit c0b759aa9d

View File

@@ -102,12 +102,6 @@ class sf_production_plan(models.Model):
self.date_planned_finished = None
self.state = 'draft'
# @api.model
# def create(self, vals):
# if 'sequence' not in vals:
# vals['sequence'] = self.env['sf.production.plan'].search_count([]) + 1
# return super().create(vals)
def unlink(self):
sequence_to_reorder = self.mapped('sequence')
res = super().unlink()
@@ -169,6 +163,9 @@ class sf_production_plan(models.Model):
# 当不设置计划结束时间时,增加计算计划结束时间的方法,根据采购周期加缓冲期两个值来算就可以了
def do_production_schedule(self):
"""
排程方法
"""
if not self.production_line_id:
raise ValidationError("未选择生产线")
else: