Accept Merge Request #776: (feature/修改机床参数bug -> develop)
Merge Request: 合并后置三元和CNC工单 Created By: @龚启豪 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @龚启豪 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/776
This commit is contained in:
@@ -35,6 +35,41 @@ access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,base.group_us
|
||||
access_sf_ramping_angle,sf_ramping_angle,model_sf_ramping_angle,base.group_user,1,1,1,1
|
||||
access_sf_cutting_width_depth,sf_cutting_width_depth,model_sf_cutting_width_depth,base.group_user,1,1,1,1
|
||||
|
||||
access_sf_machine_tool,sf_machine_tool,model_sf_machine_tool,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_tool_type,sf_machine_tool_type,model_sf_machine_tool_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_brand,sf_machine_brand,model_sf_machine_brand,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_brand_tags,sf_machine_brand_tags,model_sf_machine_brand_tags,base.group_user,1,1,1,1
|
||||
access_sf_machine_control_system,sf_machine_control_system,model_sf_machine_control_system,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_processing_order,sf_processing_order,model_sf_processing_order,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_production_process,sf_production_process,model_sf_production_process,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_production_materials,sf_production_materials,model_sf_production_materials,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_materials_model,sf_materials_model,model_sf_materials_model,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_production_process_parameter,sf_production_process_parameter,model_sf_production_process_parameter,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_production_process_category,sf_production_process_category,model_sf_production_process_category,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_machine_tool_category,sf_machine_tool_category,model_sf_machine_tool_category,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_tool_material,sf_cutting_tool_material,model_sf_cutting_tool_material,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_tool_type,sf_cutting_tool_type,model_sf_cutting_tool_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_functional_cutting_tool,sf_functional_cutting_tool,model_sf_functional_cutting_tool,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_functional_cutting_tool_model,sf_functional_cutting_tool_model,model_sf_functional_cutting_tool_model,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_fixture_material,sf_fixture_material,model_sf_fixture_material,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_fixture_materials_basic_parameters,sf_fixture_materials_basic_parameters,model_sf_fixture_materials_basic_parameters,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_multi_mounting_type,sf_multi_mounting_type,model_sf_multi_mounting_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_functional_fixture_type,sf_functional_fixture_type,model_sf_functional_fixture_type,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_international_standards,sf_international_standards,model_sf_international_standards,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_material_apply,material_apply,model_material_apply,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_tool_standard_library,sf_cutting_tool_standard_library,model_sf_cutting_tool_standard_library,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_tool_groups,sf_tool_groups,model_sf_tool_groups,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_tool_materials_basic_parameters,sf_tool_materials_basic_parameters,model_sf_tool_materials_basic_parameters,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_feed_per_tooth,sf_feed_per_tooth,model_sf_feed_per_tooth,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_ramping_angle,sf_ramping_angle,model_sf_ramping_angle,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
access_sf_cutting_width_depth,sf_cutting_width_depth,model_sf_cutting_width_depth,sf_base.group_sf_mrp_user,1,0,0,0
|
||||
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_purchase_order_group_purchase,access_purchase_order_group_purchase,purchase.model_purchase_order,sf_base.group_purchase,1,1,1,0
|
||||
access_purchase_order_group_purchase_director,access_purchase_order_group_purchase_director,purchase.model_purchase_order,sf_base.group_purchase_director,1,1,1,0
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
'security/ir.model.access.csv',
|
||||
'security/ir_rule_data.xml',
|
||||
'views/maintenance_logs_views.xml',
|
||||
'views/maintenance_equipment_oee_views.xml',
|
||||
'views/maintenance_views.xml',
|
||||
'views/equipment_maintenance_standards_views.xml',
|
||||
'views/maintenance_request_views.xml',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*-coding:utf-8-*-
|
||||
from . import sf_maintenance
|
||||
from . import sf_maintenance_oee
|
||||
from . import sf_maintenance_logs
|
||||
from . import sf_equipment_maintenance_standards
|
||||
from . import sf_maintenance_requests
|
||||
|
||||
@@ -86,7 +86,7 @@ class SfSaintenanceStandards(models.Model):
|
||||
images = fields.One2many('maintenance.standard.image', 'standard_id', string='反馈图片')
|
||||
maintenance_request_ids = fields.Many2many('maintenance.request', string='维保计划')
|
||||
Period = fields.Integer('周期/频次(天)')
|
||||
remark = fields.Char('备注说明')
|
||||
remark = fields.Char('维保记录')
|
||||
|
||||
|
||||
class MaintenanceStandardImage(models.Model):
|
||||
|
||||
@@ -11,6 +11,7 @@ class SfMaintenanceLogs(models.Model):
|
||||
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
|
||||
brand = fields.Many2one('sf.machine.brand', related='maintenance_equipment_id.brand_id', string='品牌')
|
||||
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
maintenance_equipment_oee_id = fields.Many2one('maintenance.equipment.oee', string='设备oee')
|
||||
code_location = fields.Char(string='编码位置')
|
||||
fault_type = fields.Selection(
|
||||
[('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
|
||||
33
sf_maintenance/models/sf_maintenance_oee.py
Normal file
33
sf_maintenance/models/sf_maintenance_oee.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class SfMaintenanceEquipmentOEE(models.Model):
|
||||
_name = 'maintenance.equipment.oee'
|
||||
_description = '设备OEE'
|
||||
|
||||
name = fields.Char('设备oee')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', '设备',
|
||||
domain="[('category_id.equipment_type', '=', '机床'),('state_zc', '=', '已注册')]")
|
||||
type_id = fields.Many2one('sf.machine_tool.type', '型号', related='equipment_id.type_id')
|
||||
machine_tool_picture = fields.Binary('设备图片', related='equipment_id.machine_tool_picture')
|
||||
state = fields.Selection(
|
||||
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"), ("空闲", "空闲"),
|
||||
("封存(报废)", "封存(报废)")],
|
||||
default='正常', string="机床状态", related='equipment_id.state')
|
||||
run_time = fields.Float('正常运行总时长(h)')
|
||||
equipment_time = fields.Float('总时长(h)')
|
||||
done_nums = fields.Integer('累计加工总件数')
|
||||
utilization_rate = fields.Char('开动率')
|
||||
fault_time = fields.Float('故障停机总时长(h)')
|
||||
fault_nums = fields.Integer('故障次数')
|
||||
sf_maintenance_logs_ids = fields.One2many('sf.maintenance.logs', 'maintenance_equipment_oee_id', '设备故障日志',
|
||||
related='equipment_id.sf_maintenance_logs_ids')
|
||||
|
||||
def name_get(self):
|
||||
result = []
|
||||
for parameter in self:
|
||||
if parameter.equipment_id:
|
||||
name = parameter.equipment_id.name
|
||||
result.append((parameter.id, name))
|
||||
return result
|
||||
@@ -4,6 +4,9 @@ access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_grou
|
||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_equipment_oee,maintenance_equipment_oee,model_maintenance_equipment_oee,base.group_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_user,1,0,0,0
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,sf_group_equipment_manager,1,1,1,0
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_group_equipment_user,1,0,0,0
|
||||
|
||||
|
118
sf_maintenance/views/maintenance_equipment_oee_views.xml
Normal file
118
sf_maintenance/views/maintenance_equipment_oee_views.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Tree View -->
|
||||
<record id="view_maintenance_oee_tree" model="ir.ui.view">
|
||||
<field name="name">maintenance.oee.tree</field>
|
||||
<field name="model">maintenance.equipment.oee</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="equipment_id"/>
|
||||
<field name="equipment_time"/>
|
||||
<field name="run_time"/>
|
||||
<field name="done_nums"/>
|
||||
<field name="utilization_rate"/>
|
||||
<field name="fault_time"/>
|
||||
<field name="fault_nums"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Form View -->
|
||||
<record id="view_maintenance_oee_form" model="ir.ui.view">
|
||||
<field name="name">maintenance.oee.form</field>
|
||||
<field name="model">maintenance.equipment.oee</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<field name="state" widget="statusbar" readonly="1"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="equipment_id"/>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<group>
|
||||
<field name="type_id" readonly="1"/>
|
||||
<field name="equipment_time"/>
|
||||
<field name="run_time"/>
|
||||
<field name="done_nums"/>
|
||||
<field name="utilization_rate"/>
|
||||
<field name="fault_time"/>
|
||||
<field name="fault_nums"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="machine_tool_picture" widget="image" readonly="1"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search View -->
|
||||
<record id="view_maintenance_oee_search" model="ir.ui.view">
|
||||
<field name="name">maintenance.oee.search</field>
|
||||
<field name="model">maintenance.equipment.oee</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<searchpanel>
|
||||
<field name="equipment_id" icon="fa-building" enable_counters="1"/>
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Action -->
|
||||
|
||||
<record id="action_maintenance_oee" model="ir.actions.act_window">
|
||||
<field name="name">设备OEE</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">maintenance.equipment.oee</field>
|
||||
<field name="search_view_id" ref="view_maintenance_oee_search"/>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_maintenance_oee_tree"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
设备OEE
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="action_maintenance_oee_button" model="ir.actions.act_window">-->
|
||||
<!-- <field name="name">设备故障日志</field>-->
|
||||
<!-- <field name="type">ir.actions.act_window</field>-->
|
||||
<!-- <field name="res_model">sf.maintenance.oee</field>-->
|
||||
<!-- <field name="search_view_id" ref="view_maintenance_logs_search"/>-->
|
||||
<!-- <field name="view_mode">tree,form</field>-->
|
||||
<!-- <field name="view_id" ref="view_maintenance_logs_tree"/>-->
|
||||
<!-- <field name="context">{-->
|
||||
<!-- 'default_maintenance_equipment_id': active_id-->
|
||||
<!-- }</field>-->
|
||||
<!-- <field name="help" type="html">-->
|
||||
<!-- <p class="oe_view_nocontent_create">-->
|
||||
<!-- 设备故障日志-->
|
||||
<!-- </p>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- <record id="action_maintenance_logs" model="ir.actions.act_window">-->
|
||||
<!-- <field name="name">设备故障日志</field>-->
|
||||
<!-- <field name="res_model">sf.maintenance.logs</field>-->
|
||||
<!-- <field name="view_type">form</field>-->
|
||||
<!-- <field name="view_mode">tree,form</field>-->
|
||||
<!-- <field name="view_id" ref="view_maintenance_logs_tree"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!-- Menu -->
|
||||
<menuitem name="设备OEE" id="menu_maintenance_oee" parent="maintenance.menu_m_request"
|
||||
sequence="11" action="action_maintenance_oee"/>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="type" optional="hide"/>
|
||||
<field name="brand"/>
|
||||
<field name="maintenance_equipment_id"/>
|
||||
|
||||
@@ -40,3 +40,111 @@ class Manufacturing_Connect(http.Controller):
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('get_Work_Info error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
|
||||
@http.route('/AutoDeviceApi/FeedBackStart', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def button_Work_START(self, **kw):
|
||||
"""
|
||||
工单任务开始
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
logging.info('get_Work_Info:%s' % kw)
|
||||
try:
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if not ret['BillId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传制造订单号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['CraftId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传工序名称'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['DeviceId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传设备号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
production_id = ret['BillId']
|
||||
routing_type = ret['CraftId']
|
||||
workorder = request.env['mrp.workorder'].sudo().search(
|
||||
[('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1)
|
||||
workorder.button_start()
|
||||
|
||||
|
||||
except Exception as e:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('get_Work_Info error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
@http.route('/AutoDeviceApi/FeedBackEnd', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def button_Work_End(self, **kw):
|
||||
"""
|
||||
工单任务结束
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
logging.info('get_Work_Info:%s' % kw)
|
||||
try:
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if not ret['BillId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传制造订单号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['CraftId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传工序名称'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['DeviceId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传设备号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
production_id = ret['BillId']
|
||||
routing_type = ret['CraftId']
|
||||
workorder = request.env['mrp.workorder'].sudo().search(
|
||||
[('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1)
|
||||
workorder.button_finish()
|
||||
|
||||
|
||||
except Exception as e:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('get_Work_Info error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
|
||||
|
||||
@http.route('/AutoDeviceApi/QcCheck', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||
cors="*")
|
||||
def Workorder_QcCheck(self, **kw):
|
||||
"""
|
||||
零件质检
|
||||
:param kw:
|
||||
:return:
|
||||
"""
|
||||
logging.info('get_Work_Info:%s' % kw)
|
||||
try:
|
||||
res = {'Succeed': True, 'Datas': []}
|
||||
datas = request.httprequest.data
|
||||
ret = json.loads(datas)
|
||||
if not ret['BillId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传制造订单号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['CraftId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传工序名称'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['DeviceId']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传设备号'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['Quality']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传检测结果'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
if not ret['ReportPaht']:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': '未传检查报告文件(地址)'}
|
||||
return json.JSONEncoder().encode(res)
|
||||
production_id = ret['BillId']
|
||||
routing_type = ret['CraftId']
|
||||
request.env['mrp.workorder'].sudo().search(
|
||||
[('production_id', '=', production_id), ('routing_type', '=', routing_type)], limit=1)
|
||||
|
||||
except Exception as e:
|
||||
res = {'Succeed': False, 'ErrorCode': 202, 'Error': e}
|
||||
logging.info('get_Work_Info error:%s' % e)
|
||||
return json.JSONEncoder().encode(res)
|
||||
@@ -450,10 +450,10 @@ class MrpProduction(models.Model):
|
||||
|
||||
for route in routingworkcenter:
|
||||
|
||||
if route.routing_type == '后置三元质量检测':
|
||||
workorders_values.append(
|
||||
self.env['mrp.workorder'].json_workorder_str1(k, production, route)
|
||||
)
|
||||
# if route.routing_type == '后置三元质量检测':
|
||||
# workorders_values.append(
|
||||
# self.env['mrp.workorder'].json_workorder_str1(k, production, route)
|
||||
# )
|
||||
if route.routing_type == 'CNC加工':
|
||||
workorders_values.append(
|
||||
self.env['mrp.workorder'].json_workorder_str1(k, production, route))
|
||||
|
||||
@@ -11,7 +11,7 @@ class ResMrpRoutingWorkcenter(models.Model):
|
||||
('装夹预调', '装夹预调'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'),
|
||||
('切割', '切割'),
|
||||
('表面工艺', '表面工艺')
|
||||
|
||||
@@ -35,7 +35,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
('装夹预调', '装夹预调'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'),
|
||||
('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
], string="工序类型")
|
||||
@@ -216,9 +216,9 @@ class ResMrpWorkOrder(models.Model):
|
||||
elif route.routing_type == 'CNC加工':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', 'CNC加工')]).time_cycle
|
||||
elif route.routing_type == '后置三元质量检测':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '后置三元质量检测')]).time_cycle
|
||||
# elif route.routing_type == '后置三元质量检测':
|
||||
# duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
# [('name', '=', '后置三元质量检测')]).time_cycle
|
||||
elif route.routing_type == '解除装夹':
|
||||
duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', '解除装夹')]).time_cycle
|
||||
|
||||
@@ -398,6 +398,21 @@
|
||||
</xpath>
|
||||
|
||||
|
||||
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<field name="results" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<group>
|
||||
<field name="test_results" widget="selection" attrs='{"invisible":[("results","!=",False)]}'/>
|
||||
<field name="results" readonly="1" attrs='{"invisible":[("results","!=","合格")]}'/>
|
||||
</group>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="recreateManufacturingOrWorkerOrder"
|
||||
string="检测确认"
|
||||
attrs='{"invisible": ["|","|",("state","!=","progress"),("user_permissions","=",False),("results","=","合格")]}'/>
|
||||
</div>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="CNC程序" attrs='{"invisible": [("routing_type","!=","CNC加工")]}'>
|
||||
<field name="cnc_ids" widget="one2many" string="工作程序">
|
||||
@@ -423,20 +438,6 @@
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<field name="results" invisible="1"/>
|
||||
<page string="后置三元检测" attrs='{"invisible": [("routing_type","!=","后置三元质量检测")]}'>
|
||||
<group>
|
||||
<field name="test_results" widget="selection" attrs='{"invisible":[("results","!=",False)]}'/>
|
||||
<field name="results" readonly="1" attrs='{"invisible":[("results","!=","合格")]}'/>
|
||||
</group>
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<button type="object" class="oe_highlight" name="recreateManufacturingOrWorkerOrder"
|
||||
string="检测确认"
|
||||
attrs='{"invisible": ["|","|",("state","!=","progress"),("user_permissions","=",False),("results","=","合格")]}'/>
|
||||
</div>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//page[1]" position="before">
|
||||
<page string="解除装夹" attrs='{"invisible": [("routing_type","!=","解除装夹")]}'>
|
||||
<!-- <field name="tray_id" readonly="1"/>-->
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
<field name="name" string="名称"/>
|
||||
<field name="barcode" string="编码"/>
|
||||
<field name="location_type"/>
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
attrs="{'invisible': [('check_state','=', 'enable')]}"
|
||||
groups="sf_warehouse.group_sf_stock_manager"
|
||||
class="oe_highlight"/>
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- <button name="action_check" string="审核" type="object"-->
|
||||
<!-- attrs="{'invisible': [('check_state','=', 'enable')]}"-->
|
||||
<!-- groups="sf_warehouse.group_sf_stock_manager"-->
|
||||
<!-- class="oe_highlight"/>-->
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -175,17 +175,17 @@
|
||||
<!-- sequence="50" -->
|
||||
<!-- action="kanban_action_id"/> -->
|
||||
|
||||
<record id="view_location_tree2_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.location.tree.sf.inherit</field>
|
||||
<field name="model">stock.location</field>
|
||||
<field name="inherit_id" ref="stock.view_location_tree2"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_location_tree2_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.location.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.location</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_location_tree2"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--仓库根据权限增加审核按钮-->
|
||||
<record id="view_warehouse_form_sf_inherit" model="ir.ui.view">
|
||||
@@ -206,17 +206,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_warehouse_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.warehouse.tree.sf.inherit</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_warehouse_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.warehouse.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.warehouse</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_warehouse_tree"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
<!--路线根据权限增加审核按钮-->
|
||||
@@ -238,17 +238,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_route_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.route.tree.sf.inherit</field>
|
||||
<field name="model">stock.route</field>
|
||||
<field name="inherit_id" ref="stock.stock_location_route_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_route_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.route.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.route</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.stock_location_route_tree"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--规则根据权限增加审核按钮-->
|
||||
<record id="view_rule_form_sf_inherit" model="ir.ui.view">
|
||||
@@ -269,17 +269,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_rule_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.rule.tree.sf.inherit</field>
|
||||
<field name="model">stock.rule</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_rule_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_rule_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.rule.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.rule</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_stock_rule_tree"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--作业类型根据权限增加审核按钮-->
|
||||
<record id="view_picking_type_form_sf_inherit" model="ir.ui.view">
|
||||
@@ -300,18 +300,81 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_type_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.picking.type.tree.sf.inherit</field>
|
||||
<field name="model">stock.picking.type</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_type_tree"/>
|
||||
<!-- <record id="view_picking_type_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.picking.type.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.picking.type</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_picking_type_tree"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
<!--产品类别根据权限增加审核按钮-->
|
||||
<record id="view_product_category_form_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">product.category.form.sf.inherit</field>
|
||||
<field name="model">product.category</field>
|
||||
<field name="inherit_id" ref="product.product_category_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
<xpath expr="//sheet" position="before">
|
||||
<header>
|
||||
<field name="check_state" invisible="1"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
attrs="{'invisible': [('check_state','=', 'enable')]}"
|
||||
groups="sf_warehouse.group_sf_stock_manager"
|
||||
class="oe_highlight"/>
|
||||
</header>
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_product_category_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">product.category.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">product.category</field>-->
|
||||
<!-- <field name="inherit_id" ref="product.product_category_list_view"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--计量单位类别根据权限增加审核按钮-->
|
||||
<record id="view_uom_category_form_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">uom.category.form.sf.inherit</field>
|
||||
<field name="model">uom.category</field>
|
||||
<field name="inherit_id" ref="uom.product_uom_categ_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//sheet" position="before">
|
||||
<header>
|
||||
<field name="check_state" invisible="1"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
attrs="{'invisible': [('check_state','=', 'enable')]}"
|
||||
groups="sf_warehouse.group_sf_stock_manager"
|
||||
class="oe_highlight"/>
|
||||
</header>
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="view_uom_category_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">uom.category.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">uom.category</field>-->
|
||||
<!-- <field name="inherit_id" ref="uom.product_uom_categ_tree_view"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<!--条码命名规则根据权限增加审核按钮-->
|
||||
<record id="view_barcode_nomenclature_form_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">barcode.nomenclature.form.sf.inherit</field>
|
||||
@@ -331,17 +394,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_barcode_nomenclature_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">barcode.nomenclature.tree.sf.inherit</field>
|
||||
<field name="model">barcode.nomenclature</field>
|
||||
<field name="inherit_id" ref="barcodes.view_barcode_nomenclature_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_barcode_nomenclature_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">barcode.nomenclature.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">barcode.nomenclature</field>-->
|
||||
<!-- <field name="inherit_id" ref="barcodes.view_barcode_nomenclature_tree"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
<!--上架规则根据权限增加审核按钮-->
|
||||
@@ -363,40 +426,40 @@
|
||||
|
||||
|
||||
<!--重订货规则根据权限增加审核按钮-->
|
||||
<record id="view_warehouse_orderpoint_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.warehouse.orderpoint.tree.sf.inherit</field>
|
||||
<field name="model">stock.warehouse.orderpoint</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
attrs="{'invisible': [('check_state','=', 'enable')]}"
|
||||
groups="sf_warehouse.group_sf_stock_manager"
|
||||
class="oe_highlight"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_warehouse_orderpoint_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.warehouse.orderpoint.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.warehouse.orderpoint</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_warehouse_orderpoint_tree_editable"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- <button name="action_check" string="审核" type="object"-->
|
||||
<!-- attrs="{'invisible': [('check_state','=', 'enable')]}"-->
|
||||
<!-- groups="sf_warehouse.group_sf_stock_manager"-->
|
||||
<!-- class="oe_highlight"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
|
||||
<!--库存调整根据权限增加审核按钮-->
|
||||
<record id="view_quant_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.quant.tree.sf.inherit</field>
|
||||
<field name="model">stock.quant</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
<button name="action_check" string="审核" type="object"
|
||||
attrs="{'invisible': [('check_state','=', 'enable')]}"
|
||||
groups="sf_warehouse.group_sf_stock_manager"
|
||||
class="oe_highlight"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_quant_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.quant.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.quant</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- <button name="action_check" string="审核" type="object"-->
|
||||
<!-- attrs="{'invisible': [('check_state','=', 'enable')]}"-->
|
||||
<!-- groups="sf_warehouse.group_sf_stock_manager"-->
|
||||
<!-- class="oe_highlight"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
<!--报废单根据权限增加审核按钮-->
|
||||
@@ -418,17 +481,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_stock_scrap_tree_sf_inherit" model="ir.ui.view">
|
||||
<field name="name">stock.scrap.tree.sf.inherit</field>
|
||||
<field name="model">stock.scrap</field>
|
||||
<field name="inherit_id" ref="stock.stock_scrap_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[last()]" position="after">
|
||||
<field name="check_state" widget="label_selection"
|
||||
options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- <record id="view_stock_scrap_tree_sf_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">stock.scrap.tree.sf.inherit</field>-->
|
||||
<!-- <field name="model">stock.scrap</field>-->
|
||||
<!-- <field name="inherit_id" ref="stock.stock_scrap_tree_view"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//field[last()]" position="after">-->
|
||||
<!-- <field name="check_state" widget="label_selection"-->
|
||||
<!-- options="{'classes': {'unchecked':'warning','checked': 'success'}}"/>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user