增加坯料冗余量,调整坯料客供料的名称
This commit is contained in:
@@ -1331,17 +1331,17 @@ class MrpProduction(models.Model):
|
||||
return production_values_str
|
||||
|
||||
# 增加制造订单类型
|
||||
production_type = fields.Selection(
|
||||
[('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
|
||||
string='制造类型',
|
||||
compute='_compute_production_type',
|
||||
store=True
|
||||
)
|
||||
# production_type = fields.Selection(
|
||||
# [('自动化产线加工', '自动化产线加工'), ('人工线下加工', '人工线下加工')],
|
||||
# string='制造类型',
|
||||
# compute='_compute_production_type',
|
||||
# store=True
|
||||
# )
|
||||
|
||||
@api.depends('product_id.is_manual_processing')
|
||||
def _compute_production_type(self):
|
||||
for production in self:
|
||||
production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工'
|
||||
# @api.depends('product_id.is_manual_processing')
|
||||
# def _compute_production_type(self):
|
||||
# for production in self:
|
||||
# production.production_type = '自动化产线加工' if not production.product_id.is_manual_processing else '人工线下加工'
|
||||
|
||||
|
||||
class sf_detection_result(models.Model):
|
||||
|
||||
@@ -356,14 +356,21 @@ class StockRule(models.Model):
|
||||
product_id_to_production_names)
|
||||
if not technology_design_values:
|
||||
if production.product_id.categ_id.type == '成品':
|
||||
production.product_id.model_processing_panel = 'ZM,FM'
|
||||
# production.product_id.model_processing_panel = 'ZM,FM'
|
||||
# 根据加工面板的面数及成品工序模板生成工序设计
|
||||
i = 0
|
||||
for k in (production.product_id.model_processing_panel.split(',')):
|
||||
# 根据制造类型来选择成品工序模板
|
||||
# if production.production_type == '自动化产线加工':
|
||||
product_routing_workcenter = self.env['sf.product.model.type.routing.sort'].search(
|
||||
[('product_model_type_id', '=', production.product_id.product_model_type_id.id)],
|
||||
order='sequence asc'
|
||||
)
|
||||
# elif production.production_type == '人工线下加工':
|
||||
# product_routing_workcenter = self.env['sf.manual.product.model.type.routing.sort'].search(
|
||||
# [('manual_product_model_type_id', '=', production.product_id.product_model_type_id.id)],
|
||||
# order='sequence asc'
|
||||
# )
|
||||
for route in product_routing_workcenter:
|
||||
i += 1
|
||||
technology_design_values.append(
|
||||
@@ -407,7 +414,6 @@ class StockRule(models.Model):
|
||||
product_production_process,
|
||||
i))
|
||||
productions.technology_design_ids = technology_design_values
|
||||
|
||||
# # 同一个产品多个制造订单对应一个编程单和模型库
|
||||
# # 只调用一次fetchCNC,并将所有生产订单的名称作为字符串传递
|
||||
# if not production_item.programming_no:
|
||||
|
||||
Reference in New Issue
Block a user