Accept Merge Request #2282: (feature/7253 -> develop)
Merge Request: Debug-7269_lxb_commit Created By: @李晓斌 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @李晓斌 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2282?initial=true
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user