表面工艺生成采购单

This commit is contained in:
jinling.yang
2024-11-12 11:51:18 +08:00
parent 8bbc65ef88
commit efa1e2b60f

View File

@@ -329,31 +329,31 @@ class StockRule(models.Model):
consecutive_process_parameters = [] consecutive_process_parameters = []
m = 0 m = 0
# 当前面的连续外协采购单生成再生成当前外协采购单 # 当前面的连续外协采购单生成再生成当前外协采购单
if is_purchase is False: if is_purchase is False:
self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, self.env['purchase.order'].get_purchase_order(consecutive_process_parameters,
production_item, production_item,
product_id_to_production_names) product_id_to_production_names)
if m == len(consecutive_process_parameters) - 1 and m != 0: if m == len(consecutive_process_parameters) - 1 and m != 0:
self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, self.env['purchase.order'].get_purchase_order(consecutive_process_parameters,
production_item, production_item,
product_id_to_production_names) product_id_to_production_names)
if sorted_process_parameters[i] in consecutive_process_parameters: if sorted_process_parameters[i] in consecutive_process_parameters:
is_purchase = True is_purchase = True
consecutive_process_parameters = [] consecutive_process_parameters = []
m = 0 m = 0
if m == len(consecutive_process_parameters) - 1 and m != 0: if m == len(consecutive_process_parameters) - 1 and m != 0:
self.env['purchase.order'].get_purchase_order(consecutive_process_parameters, self.env['purchase.order'].get_purchase_order(consecutive_process_parameters,
production_item, production_item,
product_id_to_production_names) product_id_to_production_names)
if is_purchase is False and m == 0: if is_purchase is False and m == 0:
if len(sorted_process_parameters) == 1: if len(sorted_process_parameters) == 1:
self.env['purchase.order'].get_purchase_order(sorted_process_parameters, self.env['purchase.order'].get_purchase_order(sorted_process_parameters,
production_item, production_item,
product_id_to_production_names) product_id_to_production_names)
else: else:
self.env['purchase.order'].get_purchase_order(sorted_process_parameters[i], self.env['purchase.order'].get_purchase_order(sorted_process_parameters[i],
production_item, production_item,
product_id_to_production_names) product_id_to_production_names)
if not technology_design_values: if not technology_design_values:
if production.product_id.categ_id.type == '成品': if production.product_id.categ_id.type == '成品':
production.product_id.model_processing_panel = 'ZM,FM' production.product_id.model_processing_panel = 'ZM,FM'