Debug-7269_lxb_commit

This commit is contained in:
lixiaobin@jikimo.com
2025-07-14 11:32:29 +08:00
parent 5a175c078f
commit 88e4cfb541

View File

@@ -344,9 +344,11 @@ class SfProductionDemandPlan(models.Model):
pro_plan.do_production_schedule()
def update_sale_order_state(self):
demand_plan = self.env['sf.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)])
demand_plan_state = demand_plan.filtered(lambda line: line.state != '40')
if not demand_plan_state:
# demand_plan = self.env['sf.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)])
# demand_plan_state = demand_plan.filtered(lambda line: line.state != '40')
production_demand_plan = self.env['sf.production.demand.plan'].sudo().search([('sale_order_id', '=', self.sale_order_id.id)])
production_demand_plan_state = production_demand_plan.filtered(lambda line: line.status in ('10', '20', '30'))
if not production_demand_plan_state:
# 修改销售订单为加工中
self.sale_order_id.state = 'processing'
@@ -675,6 +677,7 @@ class SfProductionDemandPlan(models.Model):
self._action_launch_stock_rule()
if self.supply_method in ('automation', 'manual'):
self.write({'status': '50'})
self.update_sale_order_state()
else:
self.write({'status': '60'})
self.update_sale_order_state()