增加排程动作对销售订单状态的修改

This commit is contained in:
mgw
2024-01-12 16:40:29 +08:00
parent b5147678b1
commit f19af2a33f
3 changed files with 20 additions and 11 deletions

View File

@@ -195,6 +195,10 @@ class sf_production_plan(models.Model):
item.date_planned_start, item.date_planned_finished
record.state = 'done'
record.production_id.schedule_state = '已排'
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to process'
sale_obj = self.env['sale.order'].search([('name', '=', record.origin)])
if 'S' in sale_obj.name:
sale_obj.schedule_status = 'to process'
mrp_production_ids = record.production_id._get_children().ids
print('mrp_production_ids', mrp_production_ids)
for i in mrp_production_ids:
@@ -276,6 +280,10 @@ class sf_production_plan(models.Model):
self.production_line_id = False
aa = self.env['mrp.production'].sudo().search([('name', '=', self.name)])
aa.schedule_state = '未排'
# self.env['sale.order'].browse(record.production_id.origin).schedule_status = 'to shedule'
sale_obj = self.env['sale.order'].search([('name', '=', self.origin)])
if 'S' in sale_obj.name:
sale_obj.schedule_status = 'to schedule'
return self.date_planned_finished
def liucheng_cs(self):