添加工艺退回调整
This commit is contained in:
@@ -257,6 +257,33 @@ class MrpProduction(models.Model):
|
||||
if production.tool_state == '2':
|
||||
production.state = 'rework'
|
||||
|
||||
def technology_back_adjust(self):
|
||||
special_design = self.technology_design_ids.filtered(
|
||||
lambda a: a.routing_tag == 'special' and a.is_auto is False and a.active in [True,False])
|
||||
workorders_values = []
|
||||
for item in special_design:
|
||||
if item.active is False:
|
||||
domain = [('production_id','=',self.id)]
|
||||
if item.surface_technics_parameters_id:
|
||||
domain += [('surface_technics_parameters_id', '=', item.process_parameters_id)]
|
||||
else:
|
||||
domain += [('name', '=', item.route_id.name)]
|
||||
workorder = self.env['mrp.workorder'].search(domain)
|
||||
if workorder:
|
||||
workorder.write({'state': 'cancel'})
|
||||
else:
|
||||
workorder = self.env['mrp.workorder'].search([('name', '=', item.route_id.name)])
|
||||
if not workorder:
|
||||
workorders_values.append(
|
||||
self.env[
|
||||
'mrp.workorder']._json_workorder_surface_process_str(
|
||||
production, route, product_production_process.seller_ids[0].partner_id.id))
|
||||
if workorders_values:
|
||||
self.workorders.write({})
|
||||
|
||||
|
||||
|
||||
|
||||
# 工艺确认
|
||||
def technology_confirm(self):
|
||||
process_parameters = []
|
||||
|
||||
@@ -38,13 +38,10 @@ class ResMrpWorkOrder(models.Model):
|
||||
processing_panel = fields.Char('加工面')
|
||||
sequence = fields.Integer(string='工序')
|
||||
routing_type = fields.Selection([
|
||||
# ('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹预调', '装夹预调'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'),
|
||||
('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
('切割', '切割'), ('表面工艺', '表面工艺'), ('线切割', '线切割')
|
||||
], string="工序类型")
|
||||
results = fields.Char('结果')
|
||||
state = fields.Selection([
|
||||
|
||||
@@ -9,8 +9,8 @@ from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.modules import get_resource_path
|
||||
|
||||
|
||||
from OCC.Extend.DataExchange import read_step_file
|
||||
from OCC.Extend.DataExchange import write_stl_file
|
||||
# from OCC.Extend.DataExchange import read_step_file
|
||||
# from OCC.Extend.DataExchange import write_stl_file
|
||||
|
||||
|
||||
class ResProductMo(models.Model):
|
||||
|
||||
@@ -20,7 +20,7 @@ class sf_technology_design(models.Model):
|
||||
workorders_values_str = [0, '', {
|
||||
'route_id': route.id,
|
||||
'panel': k,
|
||||
'process_parameters_id': False if route.routing_type.id != '表面工艺' else self.env[
|
||||
'process_parameters_id': False if route.routing_type != '表面工艺' else self.env[
|
||||
'sf.production.process.parameter'].search(
|
||||
[('process_id', '=', route.surface_technics_id.id)]).id,
|
||||
'sequence': i,
|
||||
|
||||
Reference in New Issue
Block a user