Accept Merge Request #2038: (feature/tool_standard_library_process -> develop)
Merge Request: 排程产能限制问题 Created By: @廖丹龙 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @廖丹龙 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2038
This commit is contained in:
@@ -256,14 +256,12 @@ class ResWorkcenter(models.Model):
|
|||||||
date_planned_end),
|
date_planned_end),
|
||||||
('state', 'not in', ['draft', 'cancel'])])
|
('state', 'not in', ['draft', 'cancel'])])
|
||||||
|
|
||||||
if plan_ids:
|
sum_qty = sum([p.product_qty for p in plan_ids]) if plan_ids else count
|
||||||
sum_qty = sum([p.product_qty for p in plan_ids])
|
production_line_hour_capacity = self.production_line_hour_capacity
|
||||||
production_line_hour_capacity = self.production_line_hour_capacity
|
if sum_qty > production_line_hour_capacity:
|
||||||
if sum_qty >= production_line_hour_capacity:
|
message = '当前计划开始时间不能预约排程,超过生产线小时产能(%d件)%d件' % (
|
||||||
message = '当前计划开始时间不能预约排程,超过生产线小时产能(%d件)%d件' % (
|
production_line_hour_capacity, count)
|
||||||
production_line_hour_capacity, count)
|
raise UserError(message)
|
||||||
raise UserError(message)
|
|
||||||
return False
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ class sf_production_plan(models.Model):
|
|||||||
"""
|
"""
|
||||||
排程方法
|
排程方法
|
||||||
"""
|
"""
|
||||||
|
self.deal_processing_schedule(self.date_planned_start)
|
||||||
for record in self:
|
for record in self:
|
||||||
if not record.production_line_id:
|
if not record.production_line_id:
|
||||||
raise ValidationError("未选择生产线")
|
raise ValidationError("未选择生产线")
|
||||||
|
|||||||
@@ -40,6 +40,5 @@ class Action_Plan_All_Wizard(models.TransientModel):
|
|||||||
self.plan_ids.date_planned_start = self.date_planned_start
|
self.plan_ids.date_planned_start = self.date_planned_start
|
||||||
# 在这里添加您的逻辑来处理这些ID
|
# 在这里添加您的逻辑来处理这些ID
|
||||||
# 判断能否排成
|
# 判断能否排成
|
||||||
self.plan_ids.deal_processing_schedule(self.date_planned_start)
|
|
||||||
self.plan_ids.do_production_schedule()
|
self.plan_ids.do_production_schedule()
|
||||||
_logger.info('处理计划: %s 完成', self.plan_ids.ids)
|
_logger.info('处理计划: %s 完成', self.plan_ids.ids)
|
||||||
|
|||||||
Reference in New Issue
Block a user