diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index d7c6d53d..1a35b251 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -1302,6 +1302,7 @@ class MrpProduction(models.Model): # 对制造订单所以面的cnc工单的程序用刀进行校验 try: logging.info(f'已更新制造订单:{productions_not_delivered}') + productions = productions.env['mrp.production'].search([('production_type', '=', '自动化产线加工')]) productions.production_cnc_tool_checkout() except Exception as e: logging.info(f'对cnc工单的程序用刀进行校验报错:{e}') diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d19d7f92..986173f1 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -289,7 +289,7 @@ class StockRule(models.Model): if production_item.product_id.id in product_id_to_production_names: # 同一个产品多个制造订单对应一个编程单和模型库 # 只调用一次fetchCNC,并将所有生产订单的名称作为字符串传递 - if not production_item.programming_no and production_item.production_type == '自动化产线加工': + if not production_item.programming_no and production_item.production_type in ['自动化产线加工', '人工线下加工']: if not production_programming.programming_no: production_item.fetchCNC( ', '.join(product_id_to_production_names[production_item.product_id.id])) diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index d71ba4a5..18d42f70 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -74,7 +74,9 @@ 1 - + + + @@ -115,11 +117,11 @@ + attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/> + attrs="{'invisible': [('production_type', 'not in', ['自动化产线加工', '人工线下加工'])]}"/>