修改批量大小

This commit is contained in:
胡尧
2025-06-20 13:52:37 +08:00
parent f38f60a6a8
commit 788183e239

View File

@@ -323,7 +323,7 @@ class SfProductionDemandPlan(models.Model):
date_planned_start = datetime.combine(date_part, time_part) date_planned_start = datetime.combine(date_part, time_part)
pro_plan_list.production_line_id = sf_production_line.id pro_plan_list.production_line_id = sf_production_line.id
pro_plan_list.date_planned_start = date_planned_start pro_plan_list.date_planned_start = date_planned_start
batch_size = 100 batch_size = 28
for i in range(0, len(pro_plan_list), batch_size): for i in range(0, len(pro_plan_list), batch_size):
current_time = fields.Datetime.now().strftime('%Y%m%d%H%M%S') current_time = fields.Datetime.now().strftime('%Y%m%d%H%M%S')
batch = self.env['queue.job.batch'].get_new_batch('plan-%s-%s' % (current_time, i)) batch = self.env['queue.job.batch'].get_new_batch('plan-%s-%s' % (current_time, i))