修复工单开始
This commit is contained in:
@@ -388,9 +388,12 @@ class MrpProduction(models.Model):
|
|||||||
def technology_confirm(self):
|
def technology_confirm(self):
|
||||||
process_parameters = []
|
process_parameters = []
|
||||||
account_moves = []
|
account_moves = []
|
||||||
|
parameters_not = []
|
||||||
special_design = self.technology_design_ids.filtered(
|
special_design = self.technology_design_ids.filtered(
|
||||||
lambda a: a.routing_tag == 'special' and a.is_auto is False)
|
lambda a: a.routing_tag == 'special' and a.is_auto is False)
|
||||||
for special in special_design:
|
for special in special_design:
|
||||||
|
if special.route_id.routing_type == '表面工艺' and not special.process_parameters_id:
|
||||||
|
parameters_not.append(special.route_id.name)
|
||||||
if special.process_parameters_id:
|
if special.process_parameters_id:
|
||||||
product_production_process = self.env['product.template'].search(
|
product_production_process = self.env['product.template'].search(
|
||||||
[('server_product_process_parameters_id', '=', special.process_parameters_id.id)])
|
[('server_product_process_parameters_id', '=', special.process_parameters_id.id)])
|
||||||
@@ -404,6 +407,8 @@ class MrpProduction(models.Model):
|
|||||||
account_moves.append(purchase.name)
|
account_moves.append(purchase.name)
|
||||||
if account_moves:
|
if account_moves:
|
||||||
raise UserError(_("请联系工厂生产经理对采购订单为%s生成的账单进行取消", ", ".join(account_moves)))
|
raise UserError(_("请联系工厂生产经理对采购订单为%s生成的账单进行取消", ", ".join(account_moves)))
|
||||||
|
if parameters_not:
|
||||||
|
raise UserError(_("【工艺设计】-【工序】为%s未选择参数,请选择", ", ".join(parameters_not)))
|
||||||
if process_parameters:
|
if process_parameters:
|
||||||
raise UserError(_("【工艺设计】-【参数】为%s的在【产品】中不存在,请先创建", ", ".join(process_parameters)))
|
raise UserError(_("【工艺设计】-【参数】为%s的在【产品】中不存在,请先创建", ", ".join(process_parameters)))
|
||||||
# 判断同一个加工面的标准工序的顺序是否依次排序
|
# 判断同一个加工面的标准工序的顺序是否依次排序
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
# if technology_design.is_auto is False:
|
# if technology_design.is_auto is False:
|
||||||
# domain = [('origin', '=', order.production_id.name)]
|
# domain = [('origin', '=', order.production_id.name)]
|
||||||
# else:
|
# else:
|
||||||
domain = [('purchase_type', '=', 'consignment'),('origin', '=', ','.join(production_list))]
|
domain = [('purchase_type', '=', 'consignment'), ('origin', '=', ','.join(production_list))]
|
||||||
purchase = self.env['purchase.order'].search(domain)
|
purchase = self.env['purchase.order'].search(domain)
|
||||||
if not purchase:
|
if not purchase:
|
||||||
order.surface_technics_purchase_count = 0
|
order.surface_technics_purchase_count = 0
|
||||||
@@ -1195,11 +1195,12 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
|
raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
|
||||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||||
# cnc校验
|
# cnc校验
|
||||||
cnc_workorder = self.search(
|
if self.production_id.production_type == '自动化产线加工':
|
||||||
[('production_id', '=', self.production_id.id), ('routing_type', '=', 'CNC加工')],
|
cnc_workorder = self.search(
|
||||||
limit=1, order='id asc')
|
[('production_id', '=', self.production_id.id), ('routing_type', '=', 'CNC加工')],
|
||||||
if not cnc_workorder.cnc_ids:
|
limit=1, order='id asc')
|
||||||
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
if not cnc_workorder.cnc_ids:
|
||||||
|
raise UserError(_('该制造订单还未下发CNC程序,请稍后再试'))
|
||||||
else:
|
else:
|
||||||
if self.production_id.tool_state in ['1', '2']:
|
if self.production_id.tool_state in ['1', '2']:
|
||||||
if self.production_id.tool_state == '1':
|
if self.production_id.tool_state == '1':
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError
|
|||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|
||||||
|
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
import requests
|
import requests
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.http import request
|
from odoo.http import request
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
from odoo.exceptions import ValidationError, UserError
|
from odoo.exceptions import ValidationError, UserError
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import requests
|
|||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
from OCC.Extend.DataExchange import read_step_file
|
# from OCC.Extend.DataExchange import read_step_file
|
||||||
from OCC.Extend.DataExchange import write_stl_file
|
# from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
Reference in New Issue
Block a user