Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化制造订单报废
This commit is contained in:
@@ -1260,7 +1260,6 @@ class MrpProduction(models.Model):
|
||||
重新生成制造订单
|
||||
"""
|
||||
if self.is_scrap is True:
|
||||
technology_design_values = []
|
||||
procurement_requests = []
|
||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', self.origin)])
|
||||
values = self.env['mrp.production'].create_production1_values(self)
|
||||
@@ -1352,69 +1351,6 @@ class MrpProduction(models.Model):
|
||||
productions.programming_state = '已编程'
|
||||
else:
|
||||
productions.programming_state = '编程中'
|
||||
if not technology_design_values:
|
||||
i = 0
|
||||
if self.product_id.categ_id.type == '成品':
|
||||
# 根据加工面板的面数及成品工序模板生成工序设计
|
||||
for k in (self.product_id.model_processing_panel.split(',')):
|
||||
if self.production_type == '自动化产线加工':
|
||||
product_routing_workcenter = self.env['sf.product.model.type.routing.sort'].search(
|
||||
[('product_model_type_id', '=',
|
||||
self.product_id.product_model_type_id.id)],
|
||||
order='sequence asc'
|
||||
)
|
||||
else:
|
||||
product_routing_workcenter = self.env[
|
||||
'sf.manual.product.model.type.routing.sort'].search(
|
||||
[('manual_product_model_type_id', '=',
|
||||
self.product_id.product_model_type_id.id)],
|
||||
order='sequence asc'
|
||||
)
|
||||
for route in product_routing_workcenter:
|
||||
i += 1
|
||||
technology_design_values.append(
|
||||
self.env['sf.technology.design'].json_technology_design_str(k, route, i, False))
|
||||
elif self.product_id.categ_id.type == '坯料':
|
||||
i = 0
|
||||
embryo_routing_workcenter = self.env['sf.embryo.model.type.routing.sort'].search(
|
||||
[('embryo_model_type_id', '=', self.product_id.embryo_model_type_id.id)],
|
||||
order='sequence asc'
|
||||
)
|
||||
for route_embryo in embryo_routing_workcenter:
|
||||
i += 1
|
||||
technology_design_values.append(
|
||||
self.env['sf.technology.design'].json_technology_design_str(False, route_embryo, i,
|
||||
False))
|
||||
surface_technics_arr = []
|
||||
route_workcenter_arr = []
|
||||
for item in self.product_id.product_model_type_id.surface_technics_routing_tmpl_ids:
|
||||
if item.route_workcenter_id.surface_technics_id.id:
|
||||
for process_param in self.product_id.model_process_parameters_ids:
|
||||
if item.route_workcenter_id.surface_technics_id == process_param.process_id:
|
||||
surface_technics_arr.append(
|
||||
item.route_workcenter_id.surface_technics_id.id)
|
||||
route_workcenter_arr.append(item.route_workcenter_id.id)
|
||||
if surface_technics_arr:
|
||||
production_process = self.env['sf.production.process'].search(
|
||||
[('id', 'in', surface_technics_arr)],
|
||||
order='sequence asc'
|
||||
)
|
||||
for p in production_process:
|
||||
# logging.info('production_process:%s' % p.name)
|
||||
process_parameter = self.product_id.model_process_parameters_ids.filtered(
|
||||
lambda pm: pm.process_id.id == p.id)
|
||||
if process_parameter:
|
||||
i += 1
|
||||
route_production_process = self.env[
|
||||
'mrp.routing.workcenter'].search(
|
||||
[('surface_technics_id', '=', p.id),
|
||||
('id', 'in', route_workcenter_arr)])
|
||||
technology_design_values.append(
|
||||
self.env['sf.technology.design'].json_technology_design_str(False,
|
||||
route_production_process,
|
||||
i,
|
||||
process_parameter))
|
||||
productions.technology_design_ids = technology_design_values
|
||||
return productions
|
||||
|
||||
# 在之前的销售单上重新生成制造订单
|
||||
|
||||
Reference in New Issue
Block a user