Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/生产排程
This commit is contained in:
0
jikimo_frontend/__init__.py
Normal file
0
jikimo_frontend/__init__.py
Normal file
32
jikimo_frontend/__manifest__.py
Normal file
32
jikimo_frontend/__manifest__.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
{
|
||||
'name': '机企猫智能工厂 样式调整',
|
||||
'version': '1.0',
|
||||
'summary': '机企猫智能工厂 样式调整',
|
||||
'sequence': 1,
|
||||
'description': """
|
||||
在本模块,定义了样式的修改
|
||||
""",
|
||||
'category': 'sf',
|
||||
'website': 'https://www.sf.jikimo.com',
|
||||
'depends': ['account', 'base', 'mrp_workorder', 'sale'],
|
||||
'data': [
|
||||
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'assets': {
|
||||
|
||||
'web.assets_qweb': [
|
||||
],
|
||||
'web.assets_backend': [
|
||||
'jikimo_frontend/static/src/scss/test.scss',
|
||||
],
|
||||
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
}
|
||||
151
jikimo_frontend/static/src/scss/custom_style.scss
Normal file
151
jikimo_frontend/static/src/scss/custom_style.scss
Normal file
@@ -0,0 +1,151 @@
|
||||
.test_model {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
.test_model > .o_form_label {
|
||||
margin-left: 20px;
|
||||
margin-right: 0px !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div:has(.o_required_modifier) > label::before {
|
||||
content: '*' !important;
|
||||
color: red !important;
|
||||
padding: 0 4px !important;
|
||||
vertical-align: top !important;
|
||||
font-size: 1.5rem !important;
|
||||
}
|
||||
|
||||
.my-image div {
|
||||
width: 110px !important;
|
||||
height: 110px !important;
|
||||
}
|
||||
|
||||
.add_flex {
|
||||
padding: 5px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.maintenance_name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_has_image_fill .o_kanban_image_fill_left {
|
||||
flex: unset !important;
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||
margin-top: 5px;
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
td.o_required_modifier {
|
||||
display: table-cell !important;
|
||||
}
|
||||
|
||||
.show_state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 8px;
|
||||
margin: auto;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.show_state > div {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border: 1px solid #000
|
||||
}
|
||||
|
||||
.show_state > div:nth-child(2) {
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_2 {
|
||||
background-color: #FF4343 !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_1 {
|
||||
background-color: #27FEA9 !important;
|
||||
opacity: 0.7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_3 {
|
||||
background-color: rgb(255, 150, 0) !important;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.my-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.color_1 {
|
||||
background-color: #27FEA9;
|
||||
}
|
||||
|
||||
.color_2 {
|
||||
background-color: #FF4343;
|
||||
}
|
||||
|
||||
.color_3 {
|
||||
background-color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.font_color_1 {
|
||||
color: rgb(0, 183, 0);
|
||||
}
|
||||
|
||||
.font_color_2 {
|
||||
color: #FF4343;
|
||||
}
|
||||
|
||||
.font_color_3 {
|
||||
color: rgb(255, 150, 0);
|
||||
}
|
||||
|
||||
.o_kanban_card_header_title {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.o_kanban_record_bottom {
|
||||
font-family: '华文中宋';
|
||||
//font-weight: bold;
|
||||
}
|
||||
|
||||
.text-truncate {
|
||||
overflow: unset !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: unset !important;
|
||||
}
|
||||
|
||||
.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) {
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.o_status {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.czyg {
|
||||
font-size: 12px;
|
||||
margin-right: 10px;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.o_kanban_primary_left {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
@@ -18,7 +18,7 @@
|
||||
'views/common_view.xml',
|
||||
'views/fixture_view.xml',
|
||||
'views/functional_fixture_view.xml',
|
||||
# 'views/quick_easy_order_view.xml',
|
||||
'views/tool_other_features_view.xml',
|
||||
'views/menu_view.xml',
|
||||
"views/tool_views.xml",
|
||||
"views/tool_menu.xml",
|
||||
|
||||
@@ -3,7 +3,8 @@ from . import common
|
||||
from . import tool_base_new
|
||||
from . import fixture
|
||||
from . import functional_fixture
|
||||
# from . import quick_easy_order
|
||||
from . import tool_other_features
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class MachineBrand(models.Model):
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
tag_ids = fields.Many2many('sf.machine.brand.tags', 'rel_machine_brand_tags', string='类别')
|
||||
image_brand = fields.Image("品牌图片")
|
||||
image_brand = fields.Image("图片")
|
||||
remark = fields.Text('备注')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@@ -118,7 +118,7 @@ class MachineTool(models.Model):
|
||||
supplier_id = fields.Many2one('res.partner', string='制造商',
|
||||
domain="[('is_vendor', '=', True)]")
|
||||
registration_date = fields.Date('注册日期')
|
||||
state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册', tracking=True)
|
||||
state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.constrains('rotate_speed')
|
||||
@@ -279,7 +279,7 @@ class MachineToolType(models.Model):
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MAX(mm)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
torque = fields.Char('主轴电机扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
|
||||
@@ -179,3 +179,9 @@ class MrsProductionProcessParameter(models.Model):
|
||||
def get_gain_way(self, item):
|
||||
process_parameter = self.env['sf.production.process.parameter'].search([('id', '=', item.id)])
|
||||
return process_parameter
|
||||
|
||||
def _json_production_process_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.parameter_ids:
|
||||
code_arr.append(i.code)
|
||||
return code_arr
|
||||
|
||||
@@ -26,7 +26,6 @@ class FixtureModel(models.Model):
|
||||
_name = 'sf.fixture.model'
|
||||
_description = "夹具型号"
|
||||
|
||||
code = fields.Char(string='编码')
|
||||
name = fields.Char(string="名称", size=15)
|
||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", )
|
||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name', store=True)
|
||||
@@ -35,28 +34,58 @@ class FixtureModel(models.Model):
|
||||
clamping_way = fields.Char(string="装夹方式")
|
||||
port_type = fields.Char(string="接口类型")
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
length = fields.Char(string="长度[mm]", size=6)
|
||||
width = fields.Char(string="宽度[mm]", size=6)
|
||||
height = fields.Char(string="高度[mm]", size=6)
|
||||
weight = fields.Char(string="重量[kg]", size=4)
|
||||
clamp_workpiece_length_max = fields.Integer(string="夹持工件长度MAX[mm]", size=6)
|
||||
clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度MAX[mm]", size=6)
|
||||
clamp_workpiece_height_max = fields.Integer(string="夹持工件高度MAX[mm]", size=6)
|
||||
clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径MAX[mm]", size=6)
|
||||
maximum_carrying_weight = fields.Float(string="最大承载重量[kg]", size=4)
|
||||
maximum_clamping_force = fields.Integer(string="最大夹持力[n]", size=8)
|
||||
|
||||
length = fields.Char(string="长度(mm)")
|
||||
width = fields.Char(string="宽度(mm)")
|
||||
height = fields.Char(string="高度(mm)")
|
||||
weight = fields.Char(string="重量(kg)")
|
||||
clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)")
|
||||
maximum_carrying_weight = fields.Float(string="最大承载重量(kg)")
|
||||
maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
|
||||
materials_model_id = fields.Many2one('sf.materials.model', string="材料型号")
|
||||
driving_way = fields.Selection([('气动', '气动'), ('液压', '液压'), ('机械', '机械')], string="驱动方式")
|
||||
apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_fixture_model_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
through_hole_size = fields.Integer(string="过孔大小[mm]", size=6)
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
|
||||
through_hole_size = fields.Integer(string="过孔大小[mm]")
|
||||
screw_size = fields.Integer(string="螺牙大小[mm]")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
# obj = super(FixtureModel, self).create(vals)
|
||||
# return obj
|
||||
def _get_code(self, fixture_model_type_code):
|
||||
fixture_model = self.env['sf.fixture.model'].sudo().search(
|
||||
[('code', 'ilike', fixture_model_type_code)],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not fixture_model:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(fixture_model.code[-3:]) + 1
|
||||
num = "%03d" % m
|
||||
return "%s%s" % (fixture_model_type_code, num)
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
|
||||
def _onchange_fixture_material_id(self, fixture_material_id):
|
||||
if fixture_material_id:
|
||||
if fixture_material_id.name == "气动夹具":
|
||||
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
elif fixture_material_id.name == "转接板(锁板)夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJBJJ-")
|
||||
elif fixture_material_id.name == "磁吸夹具":
|
||||
code = self._get_code("JKM-C-JJWL-CXJJ-")
|
||||
elif fixture_material_id.name == "虎钳夹具":
|
||||
code = self._get_code("JKM-C-JJWL-HQJJ-")
|
||||
else:
|
||||
code = self._get_code("JKM-C-JJWL-LDKP-")
|
||||
return code
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals):
|
||||
obj = super(FixtureModel, self).create(vals)
|
||||
if obj.fixture_material_id:
|
||||
code = self._onchange_fixture_material_id(obj.fixture_material_id)
|
||||
obj.code = code
|
||||
return obj
|
||||
|
||||
@@ -36,7 +36,7 @@ class FunctionalFixture(models.Model):
|
||||
domain=[('fixture_material_type', '=', '磁吸托盘')])
|
||||
vice_tray_model_ids = fields.Many2many('sf.fixture.model', 'rel_fixture_model_vice_tray', string="虎钳托盘型号",
|
||||
domain=[('fixture_material_type', '=', '虎钳托盘')])
|
||||
registration_status = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册', tracking=True)
|
||||
registration_status = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.onchange('type_id')
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
from odoo import models, fields
|
||||
import datetime
|
||||
import base64
|
||||
|
||||
|
||||
class QuickEasyOrder(models.Model):
|
||||
_name = 'quick.easy.order'
|
||||
_description = '简易下单'
|
||||
|
||||
name = fields.Char('订单编号', default=lambda self: self.env['ir.sequence'].next_by_code('quick.easy.order'))
|
||||
machining_precision = fields.Selection([
|
||||
('0.10', '±0.10mm'),
|
||||
('0.05', '±0.05mm'),
|
||||
('0.03', '±0.03mm'),
|
||||
('0.02', '±0.02mm'),
|
||||
('0.01', '±0.01mm')], string='加工精度')
|
||||
material_id = fields.Many2one('sf.production.materials', '材料')
|
||||
material_model_id = fields.Many2one('sf.materials.model', '型号')
|
||||
process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
|
||||
quantity = fields.Integer('数量')
|
||||
price = fields.Float('总价')
|
||||
model_file = fields.Binary('模型文件')
|
||||
upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='上传模型文件')
|
||||
delivery_time = fields.Date('交货日期')
|
||||
customer_id = fields.Many2one('res.partner', string='客户', default=lambda self: self.env.user.partner_id.id)
|
||||
@@ -1,5 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
# from datetime import datetime
|
||||
# from odoo.exceptions import ValidationError
|
||||
|
||||
@@ -95,18 +97,18 @@ class CuttingToolModel(models.Model):
|
||||
_description = '刀具型号'
|
||||
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char('编码')
|
||||
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
|
||||
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
|
||||
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='刀具类型',
|
||||
)
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
tool_length = fields.Integer('长度(mm)', size=6)
|
||||
tool_width = fields.Integer('宽度(mm)', size=6)
|
||||
tool_height = fields.Integer('高度(mm)', size=6)
|
||||
tool_thickness = fields.Integer('厚度(mm)', size=6)
|
||||
tool_weight = fields.Float('重量(kg)', size=4)
|
||||
tool_length = fields.Integer('长度(mm)')
|
||||
tool_width = fields.Integer('宽度(mm)')
|
||||
tool_height = fields.Integer('高度(mm)')
|
||||
tool_thickness = fields.Integer('厚度(mm)')
|
||||
tool_weight = fields.Float('重量(kg)')
|
||||
coating_material = fields.Char('涂层材质')
|
||||
|
||||
# 整体式刀具参数
|
||||
total_length = fields.Float('总长度(mm)')
|
||||
shank_length = fields.Float('柄部长度(mm)')
|
||||
@@ -177,12 +179,43 @@ class CuttingToolModel(models.Model):
|
||||
)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
# @api.model
|
||||
# def create(self, vals):
|
||||
# if vals.get('name', '/') == '/' or vals.get('name', '/') is False:
|
||||
# vals['name'] = '/'
|
||||
# obj = super(CuttingToolModel, self).create(vals)
|
||||
# return obj
|
||||
def _get_code(self, cutting_tool_type_code):
|
||||
cutting_tool_model = self.search(
|
||||
[('code', 'ilike', cutting_tool_type_code)],
|
||||
limit=1,
|
||||
order="id desc")
|
||||
if not cutting_tool_model:
|
||||
num = "%03d" % 1
|
||||
else:
|
||||
m = int(cutting_tool_model.code[-3:]) + 1
|
||||
num = "%03d" % m
|
||||
return "%s%s" % (cutting_tool_type_code, num)
|
||||
|
||||
code = fields.Char(string='编码', readonly=True)
|
||||
|
||||
def _onchange_cutting_tool_material_id(self, cutting_tool_material_id):
|
||||
if cutting_tool_material_id:
|
||||
if cutting_tool_material_id.name == "整体式刀具":
|
||||
code = self._get_code("JKM-T-DJWL-ZTDJ-")
|
||||
elif cutting_tool_material_id.name == "刀片":
|
||||
code = self._get_code("JKM-T-DJWL-DPIA-")
|
||||
elif cutting_tool_material_id.name == "刀杆":
|
||||
code = self._get_code("JKM-T-DJWL-DGAN-")
|
||||
elif cutting_tool_material_id.name == "刀盘":
|
||||
code = self._get_code("JKM-T-DJWL-DPAN-")
|
||||
elif cutting_tool_material_id.name == "夹头":
|
||||
code = self._get_code("JKM-T-DJWL-DJIA-")
|
||||
else:
|
||||
code = self._get_code("JKM-T-DJWL-DBIN-")
|
||||
return code
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals):
|
||||
obj = super(CuttingToolModel, self).create(vals)
|
||||
if obj.cutting_tool_material_id:
|
||||
code = self._onchange_cutting_tool_material_id(obj.cutting_tool_material_id)
|
||||
obj.code = code
|
||||
return obj
|
||||
|
||||
|
||||
# 刀具类型
|
||||
|
||||
73
sf_base/models/tool_other_features.py
Normal file
73
sf_base/models/tool_other_features.py
Normal file
@@ -0,0 +1,73 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SuitableMachiningMethod(models.Model):
|
||||
_name = 'sf.suitable.machining.method'
|
||||
_description = '适合加工方式'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class BladeTipCharacteristics(models.Model):
|
||||
_name = 'sf.blade.tip.characteristics'
|
||||
_description = '刀尖特征'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class HandleType(models.Model):
|
||||
_name = 'sf.handle.type'
|
||||
_description = '柄部类型'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class CuttingDirection(models.Model):
|
||||
_name = 'sf.cutting.direction'
|
||||
_description = '走刀方向'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class SuitableCoolant(models.Model):
|
||||
_name = 'sf.suitable.coolant'
|
||||
_description = '适合冷却液'
|
||||
|
||||
name = fields.Char('名称')
|
||||
image = fields.Image('图片')
|
||||
|
||||
|
||||
class CuttingSpeed(models.Model):
|
||||
_name = 'sf.cutting.speed'
|
||||
_description = '切削速度Vc'
|
||||
|
||||
# def _get_order(self):
|
||||
# last_tool = self.search([], order='id desc', limit=1)
|
||||
# if last_tool:
|
||||
# last_order = int(last_tool.order)
|
||||
# new_order = last_order + 1
|
||||
# else:
|
||||
# new_order = '1'
|
||||
# return new_order
|
||||
#
|
||||
# order = fields.Char('序', default=_get_order, readonly=True)
|
||||
|
||||
execution_standard_id = fields.Char('执行标准')
|
||||
material_code = fields.Char('材料代号')
|
||||
material_name = fields.Char('材料名称')
|
||||
material_grade = fields.Char('材料牌号')
|
||||
tensile_strength = fields.Char('拉伸强度 (N/mm²)')
|
||||
hardness = fields.Char('硬度(HRC)')
|
||||
|
||||
cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc')
|
||||
cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc')
|
||||
cutting_speed_n3 = fields.Char('径向切宽 ae=25%D1 ap=L1max 切削速度Vc')
|
||||
cutting_speed_n4 = fields.Char('径向切宽 ae=15%D1 ap=L1max 切削速度Vc')
|
||||
cutting_speed_n5 = fields.Char('径向切宽 ae=5%D1 ap=L1max 切削速度Vc')
|
||||
rough_machining = fields.Char('粗加工 Vc(m/min)')
|
||||
precision_machining = fields.Char('精加工 Vc(m/min)')
|
||||
application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用')
|
||||
@@ -23,6 +23,13 @@ access_sf_multi_mounting_type,sf_multi_mounting_type,model_sf_multi_mounting_typ
|
||||
access_sf_fixture_model,sf_fixture_model,model_sf_fixture_model,base.group_user,1,1,1,1
|
||||
access_sf_functional_fixture_type,sf_functional_fixture_type,model_sf_functional_fixture_type,base.group_user,1,1,1,1
|
||||
access_sf_functional_fixture,sf_functional_fixture,model_sf_functional_fixture,base.group_user,1,1,1,1
|
||||
access_sf_sync_common,sf_sync_common,model_sf_sync_common,base.group_user,1,1,1,1
|
||||
access_sf_suitable_machining_method,sf_suitable_machining_method,model_sf_suitable_machining_method,base.group_user,1,1,1,1
|
||||
access_sf_blade_tip_characteristics,sf_blade_tip_characteristics,model_sf_blade_tip_characteristics,base.group_user,1,1,1,1
|
||||
access_sf_handle_type,sf_handle_type,model_sf_handle_type,base.group_user,1,1,1,1
|
||||
access_sf_cutting_direction,sf_cutting_direction,model_sf_cutting_direction,base.group_user,1,1,1,1
|
||||
access_sf_suitable_coolant,sf_suitable_coolant,model_sf_suitable_coolant,base.group_user,1,1,1,1
|
||||
access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -119,4 +119,31 @@ td.o_required_modifier {
|
||||
.o_kanban_record_bottom {
|
||||
font-family: '华文中宋';
|
||||
//font-weight: bold;
|
||||
}
|
||||
|
||||
.text-truncate {
|
||||
overflow: unset !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: unset !important;
|
||||
}
|
||||
|
||||
.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector):not(.o_handle_cell):not(.o_list_button):not(.o_list_record_remove) {
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.o_status {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
.czyg {
|
||||
font-size: 12px;
|
||||
margin-right: 10px;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.o_kanban_primary_left {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
@@ -29,8 +29,8 @@
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="tag_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="remark"/>
|
||||
<field name="image_brand" widget="image"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -95,8 +95,8 @@
|
||||
<field name="name" string="名称"/>
|
||||
<field name="machine_tool_category"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="remark"/>
|
||||
<field name="machine_tool_picture" widget="image"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -159,11 +159,11 @@
|
||||
<field name="feed_speed" required="1"/>
|
||||
<label for="precision_min" string="X轴定位精度(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="precision_min" string="最小(min)"/>
|
||||
<label for="precision_min" string="最小"/>
|
||||
<field name="precision_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="precision_max" string="最大(max)"/>
|
||||
<label for="precision_max" string="最大"/>
|
||||
<field name="precision_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
@@ -210,27 +210,28 @@
|
||||
<field name="motor_power" required="1"/>
|
||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="distance_min" string="最小(min)"/>
|
||||
<label for="distance_min" string="最小"/>
|
||||
<field name="distance_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="distance_max" string="最大(max)"/>
|
||||
<label for="distance_max" string="最大"/>
|
||||
<field name="distance_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="guide_rail" required="1"/>
|
||||
</group>
|
||||
<group></group>
|
||||
<group string="刀具">
|
||||
<field name="knife_type" required="1"/>
|
||||
<field name="tool_speed" required="1"/>
|
||||
<field name="tool_long_max" required="1"/>
|
||||
<label for="tool_diameter_min" string="刀具刀径(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="tool_diameter_min" string="最小(min)"/>
|
||||
<label for="tool_diameter_min" string="最小"/>
|
||||
<field name="tool_diameter_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>Φ
|
||||
<span>&nbsp;</span>
|
||||
<label for="tool_diameter_max" string="最大(max)"/>
|
||||
<label for="tool_diameter_max" string="最大"/>
|
||||
<field name="tool_diameter_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>Φ
|
||||
</div>
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<record model="ir.ui.view" id="sf_production_process_form">
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="表面工艺" create="0" edit="0" delete="1">
|
||||
<form string="表面工艺" create="0" edit="1" delete="1">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
@@ -350,7 +350,7 @@
|
||||
<field name="name">加工工艺</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.processing.technology</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_production_process_category" model="ir.actions.act_window">
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
<field name="name">夹具型号</field>
|
||||
<field name="model">sf.fixture.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="夹具型号" create="0" edit="0" delete="1">
|
||||
<tree string="夹具型号" create="0" edit="0" delete="1">
|
||||
<field name="code"/>
|
||||
<field name="name" string="名称"/>
|
||||
<field name="brand_id"/>
|
||||
@@ -177,11 +177,11 @@
|
||||
<field name="name">夹具型号</field>
|
||||
<field name="model">sf.fixture.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="夹具型号" create="0" edit="0" delete="1" >
|
||||
<form string="夹具型号" create="0" edit="0" delete="1">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" />
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
@@ -229,7 +229,8 @@
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="driving_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘"))]}'/>
|
||||
<field name="apply_machine_tool_type_ids" widget="many2many_tags" options="{'no_create': True}"
|
||||
<field name="apply_machine_tool_type_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("零点卡盘"))]}'/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
name="功能夹具类型"
|
||||
sequence="3"
|
||||
/>
|
||||
<menuitem id="menu_sf_functional_fixture"
|
||||
parent="menu_sf_fixture"
|
||||
action="sf_functional_fixture_view_act"
|
||||
name="功能夹具"
|
||||
<!-- <menuitem id="menu_sf_functional_fixture"-->
|
||||
<!-- parent="menu_sf_fixture"-->
|
||||
<!-- action="sf_functional_fixture_view_act"-->
|
||||
<!-- name="功能夹具"-->
|
||||
sequence="4"
|
||||
/>
|
||||
</odoo>
|
||||
File diff suppressed because one or more lines are too long
@@ -109,13 +109,13 @@
|
||||
</record>
|
||||
|
||||
<!-- 功能刀具 -->
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool"
|
||||
parent="menu_sf_base"
|
||||
name="功能刀具"
|
||||
sequence="3"
|
||||
action="action_sf_functional_cutting_tool"
|
||||
/>
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||
<!-- parent="menu_sf_base"-->
|
||||
<!-- name="功能刀具"-->
|
||||
<!-- sequence="3"-->
|
||||
<!-- action="action_sf_functional_cutting_tool"-->
|
||||
<!-- />-->
|
||||
<!-- 刀具物料 -->
|
||||
<menuitem
|
||||
id="menu_sf_cutting_tool_material"
|
||||
|
||||
@@ -70,13 +70,13 @@
|
||||
action="action_sf_cutting_tool"
|
||||
/>
|
||||
<!-- 功能刀具 -->
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool"
|
||||
parent="menu_sf_cutting_tool"
|
||||
name="功能刀具"
|
||||
sequence="5"
|
||||
action="action_sf_functional_cutting_tool"
|
||||
/>
|
||||
<!-- <menuitem-->
|
||||
<!-- id="menu_sf_functional_cutting_tool"-->
|
||||
<!-- parent="menu_sf_cutting_tool"-->
|
||||
<!-- name="功能刀具"-->
|
||||
<!-- sequence="5"-->
|
||||
<!-- action="action_sf_functional_cutting_tool"-->
|
||||
<!-- />-->
|
||||
<!-- 功能刀具类型 -->
|
||||
<menuitem
|
||||
id="menu_sf_functional_cutting_tool_model_type"
|
||||
|
||||
134
sf_base/views/tool_other_features_view.xml
Normal file
134
sf_base/views/tool_other_features_view.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- ======================================== 适合加工方式========================================-->
|
||||
<record model="ir.ui.view" id="sf_suitable_machining_method_tree">
|
||||
<field name="name">适合加工方式</field>
|
||||
<field name="model">sf.suitable.machining.method</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_suitable_machining_method_act" model="ir.actions.act_window">
|
||||
<field name="name">适合加工方式</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.suitable.machining.method</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 刀尖特征========================================-->
|
||||
<record model="ir.ui.view" id="sf_blade_tip_characteristics_tree">
|
||||
<field name="name">刀尖特征</field>
|
||||
<field name="model">sf.blade.tip.characteristics</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_blade_tip_characteristics_act" model="ir.actions.act_window">
|
||||
<field name="name">刀尖特征</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.blade.tip.characteristics</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 柄部类型========================================-->
|
||||
<record model="ir.ui.view" id="sf_handle_type_tree">
|
||||
<field name="name">柄部类型</field>
|
||||
<field name="model">sf.handle.type</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_handle_type_act" model="ir.actions.act_window">
|
||||
<field name="name">柄部类型</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.handle.type</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 走刀方向========================================-->
|
||||
<record model="ir.ui.view" id="sf_cutting_direction_tree">
|
||||
<field name="name">走刀方向</field>
|
||||
<field name="model">sf.cutting.direction</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_cutting_direction_act" model="ir.actions.act_window">
|
||||
<field name="name">走刀方向</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting.direction</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 适合冷却液========================================-->
|
||||
<record model="ir.ui.view" id="sf_suitable_coolant_tree">
|
||||
<field name="name">适合冷却液</field>
|
||||
<field name="model">sf.suitable.coolant</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="image" widget="image"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_suitable_coolant_act" model="ir.actions.act_window">
|
||||
<field name="name">适合冷却液</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.suitable.coolant</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ======================================== 切削速度Vc========================================-->
|
||||
<record id="sf_cutting_speed_tree" model="ir.ui.view">
|
||||
<field name="name">切削速度Vc</field>
|
||||
<field name="model">sf.cutting.speed</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="切削速度Vc" editable="bottom">
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="execution_standard_id"/>
|
||||
<field name="material_code"/>
|
||||
<field name="material_name"/>
|
||||
<field name="material_grade"/>
|
||||
<field name="tensile_strength"/>
|
||||
<field name="hardness"/>
|
||||
<field name="cutting_speed_n1"/>
|
||||
<field name="cutting_speed_n2"/>
|
||||
<field name="cutting_speed_n3"/>
|
||||
<field name="cutting_speed_n4"/>
|
||||
<field name="cutting_speed_n5"/>
|
||||
<field name="rough_machining"/>
|
||||
<field name="precision_machining"/>
|
||||
<field name="application"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="sf_cutting_speed_act" model="ir.actions.act_window">
|
||||
<field name="name">切削速度Vc</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sf.cutting.speed</field>
|
||||
<field name="view_mode">tree</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -243,6 +243,7 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
@@ -288,7 +289,7 @@
|
||||
<field name="blade_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="chuck_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄','整体式刀具'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="handle_ids" widget="many2many_tags"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))]}"/>
|
||||
</group>
|
||||
@@ -306,7 +307,7 @@
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '刀柄')]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄'))]}"/>
|
||||
<field name="working_hardness"/>
|
||||
<field name="wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄','刀杆','刀盘' ))]}"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="detailed_type" position="before">
|
||||
<field name="list_price" position="before">
|
||||
<field name='categ_type' invisible="1"/>
|
||||
<field name="upload_model_file"
|
||||
widget="many2many_binary"
|
||||
@@ -15,6 +15,7 @@
|
||||
attrs="{'invisible': ['|','|', ('categ_type', '!=', '成品'),('categ_type', '=', False),('model_file', '=', False)]}"/>
|
||||
</field>
|
||||
<field name="invoice_policy" position="after">
|
||||
<!-- <field name='categ_id'/>-->
|
||||
<field name='cutting_tool_type' invisible="1"/>
|
||||
<field name="fixture_material_type" invisible="1"/>
|
||||
<field name="embryo_model_type_id" string="模型类型"
|
||||
@@ -29,13 +30,18 @@
|
||||
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
|
||||
<field name="cutting_tool_material_id" attrs="{'invisible': [('categ_type', '!=', '刀具')]}"/>
|
||||
<field name="cutting_tool_model_id"
|
||||
context="{'default_cutting_tool_material_id': cutting_tool_material_id,'default_cutting_tool_type_id': cutting_tool_type_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')]}"
|
||||
domain="[('cutting_tool_material_id','=',cutting_tool_material_id)]"/>
|
||||
<field name="fixture_material_id" attrs="{'invisible': [('categ_type', '!=', '夹具')]}"/>
|
||||
<field name="fixture_model_id" string="型号"
|
||||
context="{'default_fixture_material_id': fixture_material_id,'default_multi_mounting_type_id': fixture_multi_mounting_type_id}"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||
</field>
|
||||
<!-- <field name="categ_id" position="replace">-->
|
||||
<!-- <field name='categ_id' invisible="1"/>-->
|
||||
<!-- </field>-->
|
||||
<xpath expr="//label[@for='volume']" position="before">
|
||||
<label for="length" string="尺寸"
|
||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||
@@ -78,17 +84,21 @@
|
||||
<xpath expr="//page[last()-1]" position="after">
|
||||
<page string="刀具物料参数" attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<group>
|
||||
<!--整体式刀具-->
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}" col="1">
|
||||
<field name="brand_id" options="{'no_create': True}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="cutting_tool_type_id" options="{'no_create': True}"/>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="cutting_tool_total_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀柄'))]}"/>
|
||||
<field name="cutting_tool_shank_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_blade_length"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_type" string="刃部类型"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<!--刀片-->
|
||||
<label for="tool_length" string="尺寸(mm)"
|
||||
attrs='{"invisible": [("cutting_tool_type","not in",("刀片","刀杆","刀盘"))]}'/>
|
||||
@@ -105,7 +115,7 @@
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<field name="cutting_tool_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片','刀杆','刀盘'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片','刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_diameter"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_blade_number"
|
||||
@@ -137,33 +147,86 @@
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘'))]}"/>
|
||||
<field name="cutting_tool_chuck_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄','整体式刀具'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀杆','刀盘','刀柄'))]}"/>
|
||||
<field name="cutting_tool_handle_ids" widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头'))]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('categ_type', '!=', '刀具')]}">
|
||||
<!--整体式刀具-->
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精"
|
||||
attrs="{'required': [('cutting_tool_type','=','整体式刀具')],'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}"/>
|
||||
|
||||
<field name="cutting_tool_jump_accuracy"
|
||||
attrs="{'invisible': [('cutting_tool_type', '!=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_front_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_top_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_rear_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="cutting_tool_main_included_angle"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
<field name="coating_material"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
<field name="cutting_tool_accuracy_level"
|
||||
attrs="{'invisible': [('cutting_tool_type', '=', '刀柄')]}"/>
|
||||
<field name="cutting_tool_working_hardness"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'in', ('刀柄', '整体式刀具'))]}"/>
|
||||
<field name="cutting_tool_working_hardness" attrs="{'invisible': [('cutting_tool_type', '=', '整体式刀具')]}"/>
|
||||
<field name="cutting_tool_wrench"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄','刀杆','刀盘' ))]}"/>
|
||||
<field name="cutting_tool_screw"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('夹头','刀柄'))]}"/>
|
||||
<field name="cutting_tool_nut"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}"/>
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('刀片'))]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('cutting_tool_type', '!=', '整体式刀具')]}">
|
||||
<group>
|
||||
<group>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度:"/>
|
||||
<div class="test_model">
|
||||
<label for="integral_run_out_accuracy_min" string="最小(min)"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大(max)"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
</group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string=""/>
|
||||
</group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string=""/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string=""/>
|
||||
</group>
|
||||
<group string="切削速度Vc">
|
||||
<field name="cutting_speed_ids" string=""/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -58,6 +58,15 @@ class SfSaintenanceStandards(models.Model):
|
||||
maintenance_standards = fields.Char('维保标准')
|
||||
equipment_maintenance_standards_id = fields.Many2one('equipment.maintenance.standards', string='设备维保标准')
|
||||
maintenance_request_id = fields.Many2one('maintenance.request', string='设备维保计划')
|
||||
images = fields.One2many('maintenance.standard.image', 'standard_id', string='反馈图片')
|
||||
|
||||
|
||||
class MaintenanceStandardImage(models.Model):
|
||||
_name = 'maintenance.standard.image'
|
||||
_description = 'maintenance.standard.image'
|
||||
|
||||
image = fields.Binary(string='维保图片')
|
||||
standard_id = fields.Many2one('maintenance.standards', string='Standard')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,7 +66,14 @@ class SfMaintenanceEquipment(models.Model):
|
||||
|
||||
MTcode = fields.Char("编码", default=get_no)
|
||||
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
equipment_type = fields.Selection([('机床', '机床')], related='category_id.equipment_type')
|
||||
equipment_type = fields.Selection([('机床', '机床')], compute='_compute_category_id')
|
||||
|
||||
@api.depends('category_id')
|
||||
def _compute_category_id(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.equipment_type = record.category_id.equipment_type
|
||||
|
||||
code = fields.Char('机台号')
|
||||
name = fields.Char('名称')
|
||||
knife_type = fields.Selection(
|
||||
@@ -114,7 +121,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
feed_speed = fields.Char('进给速度(mm/min)')
|
||||
tool_speed = fields.Char('刀具速度(m/min)')
|
||||
distance_min = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MIN(mm)')
|
||||
distance_max = fields.Char('主轴端面至工作台面距离MAX(mm)')
|
||||
taper = fields.Char('主轴锥度(°)')
|
||||
torque = fields.Char('主轴电机扭矩(n/m)')
|
||||
motor_power = fields.Char('主轴电机功率(kw)')
|
||||
|
||||
@@ -8,7 +8,7 @@ class SfMaintenanceLogs(models.Model):
|
||||
code = fields.Char(string='编码')
|
||||
name = fields.Char(string='名称')
|
||||
type = fields.Selection([('type1', '类型1'), ('type2', '类型2')], string='类型')
|
||||
brand = fields.Many2one('sf.machine.brand', relared='model.brand_id', string='品牌')
|
||||
brand = fields.Many2one('sf.machine.brand', related='maintenance_equipment_id.brand_id', string='品牌')
|
||||
maintenance_equipment_id = fields.Many2one('maintenance.equipment', string='设备')
|
||||
code_location = fields.Char(string='编码位置')
|
||||
fault_type = fields.Selection([('电气类', '电气类'), ('机械类', '机械类'), ('程序类', '程序类'), ('系统类', '系统类')], string='故障类型')
|
||||
|
||||
@@ -25,7 +25,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
if not record.equipment_maintenance_id:
|
||||
record.equipment_maintenance_id = False
|
||||
|
||||
maintenance_standards = fields.One2many('maintenance.standards','maintenance_request_id', string='维保标准')
|
||||
maintenance_standards = fields.One2many('maintenance.standards', 'maintenance_request_id', string='维保标准')
|
||||
|
||||
@api.constrains('equipment_maintenance_id')
|
||||
def _check_equipment_maintenance_id(self):
|
||||
|
||||
@@ -3,7 +3,7 @@ access_equipment_maintenance_standards,equipment_maintenance_standards,model_equ
|
||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,base.group_user,1,1,1,1
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,base.group_user,1,1,1,1
|
||||
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -8,8 +8,10 @@
|
||||
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='archive_equipment_request']" position="before">
|
||||
<button name="confirm_maintenance" string="确认维保计划" type="object" class="btn-primary" attrs="{'invisible': [('stage_id', '!=', 1)]}" />
|
||||
<button name="confirm_maintenance_done" string="标记已完成" type="object" class="btn-primary" attrs="{'invisible': [('stage_id', '!=', 2)]}" />
|
||||
<button name="confirm_maintenance" string="确认维保计划" type="object" class="btn-primary"
|
||||
attrs="{'invisible': [('stage_id', '!=', 1)]}"/>
|
||||
<button name="confirm_maintenance_done" string="标记已完成" type="object" class="btn-primary"
|
||||
attrs="{'invisible': [('stage_id', '!=', 2)]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='maintenance_type']" position="replace">
|
||||
<field name="sf_maintenance_type" widget="radio"/>
|
||||
@@ -20,12 +22,13 @@
|
||||
|
||||
<notebook>
|
||||
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}">
|
||||
<field name="maintenance_standards" widget="ony2many">
|
||||
<tree editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="maintenance_standards" widget="ony2many">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
<field name="images"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -45,7 +48,7 @@
|
||||
<field name="context">{'default_user_id': uid}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
添加维保计划
|
||||
添加维保计划
|
||||
</p>
|
||||
<p>
|
||||
跟进请求的处理,并且和合作者沟通。
|
||||
@@ -66,5 +69,32 @@
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- 维保项目表单视图-->
|
||||
|
||||
<record id="view_maintenance_standards_form" model="ir.ui.view">
|
||||
<field name="name">maintenance.standards.form</field>
|
||||
<field name="model">maintenance.standards</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="设备维保项目">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="maintenance_standards"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="上传图片">
|
||||
<field name="images" widget="one2many">
|
||||
<tree editable="bottom">
|
||||
<field name="image" widget="image" options="{'size': [100, 100], 'click enlarge': True}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -171,12 +171,7 @@
|
||||
|
||||
|
||||
</page>
|
||||
<page string="其他" attrs="{'invisible': [('type_id', '=', False)]}">
|
||||
<group string="其他">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
</xpath>
|
||||
@@ -187,7 +182,7 @@
|
||||
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//div[@class='o_row'][field[@name='maintenance_duration']]" position="after">
|
||||
<xpath expr="//div[hasclass('o_row')][field[@name='maintenance_duration']]" position="after">
|
||||
|
||||
|
||||
<field name='overhaul_id'/>
|
||||
@@ -206,6 +201,23 @@
|
||||
<field name='equipment_maintenance_standards_ids' widget="many2many_tags" invisible="1"/>
|
||||
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='description']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//page[@name='product_information']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//page[@name='maintenance']" position="after">
|
||||
<page string="其他" attrs="{'invisible': [('type_id', '=', False)]}">
|
||||
<group string="其他">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
<button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
@@ -286,7 +298,7 @@
|
||||
</xpath>
|
||||
|
||||
|
||||
<xpath expr="//templates" position="inside">
|
||||
<xpath expr="//templates" position="inside">
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_global_click o_kanban_record_has_image_fill o_hr_kanban_record oe_kanban_card oe_kanban_global_click">
|
||||
|
||||
@@ -303,7 +315,7 @@
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="state_zc"/>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="technician_user_id"/>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from odoo import fields, models
|
||||
from odoo import fields, models,api
|
||||
|
||||
|
||||
class ResProductCategory(models.Model):
|
||||
@@ -32,14 +32,26 @@ class ProductModelTypeRoutingSort(models.Model):
|
||||
sequence = fields.Integer('Sequence')
|
||||
route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
|
||||
is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
|
||||
routing_type = fields.Selection([
|
||||
('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹', '装夹'),
|
||||
('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
], string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
# routing_type = fields.Selection([
|
||||
# ('获取CNC加工程序', '获取CNC加工程序'),
|
||||
# ('装夹', '装夹'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
# ('CNC加工', 'CNC加工'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
# ('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
# ], string="工序类型", compute='_compute_route_workcenter_id')
|
||||
#
|
||||
# @api.depends('route_workcenter_id')
|
||||
# def _compute_route_workcenter_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
product_model_type_id = fields.Many2one('sf.model.type')
|
||||
|
||||
@@ -55,14 +67,25 @@ class EmbryoModelTypeRoutingSort(models.Model):
|
||||
sequence = fields.Integer('Sequence')
|
||||
route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
|
||||
is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
|
||||
routing_type = fields.Selection([
|
||||
('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹', '装夹'),
|
||||
('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
], string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
# routing_type = fields.Selection([
|
||||
# ('获取CNC加工程序', '获取CNC加工程序'),
|
||||
# ('装夹', '装夹'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
# ('CNC加工', 'CNC加工'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
# ('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
# ], string="工序类型", compute='_compute_route_workcenter_id')
|
||||
#
|
||||
# @api.depends('route_workcenter_id')
|
||||
# def _compute_route_workcenter_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
embryo_model_type_id = fields.Many2one('sf.model.type')
|
||||
|
||||
@@ -78,14 +101,25 @@ class SurfaceTechnicsModelTypeRoutingSort(models.Model):
|
||||
sequence = fields.Integer('Sequence')
|
||||
route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
|
||||
is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
|
||||
routing_type = fields.Selection([
|
||||
('获取CNC加工程序', '获取CNC加工程序'),
|
||||
('装夹', '装夹'),
|
||||
('前置三元定位检测', '前置三元定位检测'),
|
||||
('CNC加工', 'CNC加工'),
|
||||
('后置三元质量检测', '后置三元质量检测'),
|
||||
('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
], string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
# routing_type = fields.Selection([
|
||||
# ('获取CNC加工程序', '获取CNC加工程序'),
|
||||
# ('装夹', '装夹'),
|
||||
# ('前置三元定位检测', '前置三元定位检测'),
|
||||
# ('CNC加工', 'CNC加工'),
|
||||
# ('后置三元质量检测', '后置三元质量检测'),
|
||||
# ('解除装夹', '解除装夹'), ('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
# ], string="工序类型", compute='_compute_route_workcenter_id')
|
||||
#
|
||||
# @api.depends('route_workcenter_id')
|
||||
# def _compute_route_workcenter_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.routing_type = record.route_workcenter_id.routing_type
|
||||
|
||||
|
||||
routing_type = fields.Selection(string="工序类型", related='route_workcenter_id.routing_type')
|
||||
|
||||
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
|
||||
surface_technics_model_type_id = fields.Many2one('sf.model.type')
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class ResWorkcenter(models.Model):
|
||||
_inherit = "mrp.workcenter"
|
||||
|
||||
# 生产线显示
|
||||
production_line_show = fields.Char(string='生产线')
|
||||
production_line_show = fields.Char(string='生产线名称')
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', string='机床')
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
@@ -20,7 +20,13 @@ class ResWorkcenter(models.Model):
|
||||
|
||||
equipment_status = fields.Selection(
|
||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||
string="设备状态", related='equipment_id.state')
|
||||
string="设备状态", compute='_compute_equipment_id')
|
||||
|
||||
@api.depends('equipment_id')
|
||||
def _compute_equipment_id(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.equipment_status = record.equipment_id.state
|
||||
|
||||
equipment_image = fields.Binary('设备图片', related='equipment_id.machine_tool_picture')
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ class ResMrpWorkOrder(models.Model):
|
||||
_order = 'sequence asc,create_date desc'
|
||||
|
||||
product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True,
|
||||
check_company=True, string="坯料长度(mm)")
|
||||
string="坯料长度(mm)")
|
||||
product_tmpl_id_width = fields.Float(related='production_id.product_tmpl_id.width', readonly=True, store=True,
|
||||
check_company=True, string="坯料宽度(mm)")
|
||||
string="坯料宽度(mm)")
|
||||
product_tmpl_id_height = fields.Float(related='production_id.product_tmpl_id.height', readonly=True, store=True,
|
||||
check_company=True, string="坯料高度(mm)")
|
||||
string="坯料高度(mm)")
|
||||
product_tmpl_id_materials_id = fields.Many2one(related='production_id.product_tmpl_id.materials_id', readonly=True,
|
||||
store=True, check_company=True, string="材料")
|
||||
product_tmpl_id_materials_type_id = fields.Many2one(related='production_id.product_tmpl_id.materials_type_id',
|
||||
@@ -41,7 +41,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
('解除装夹', '解除装夹'),
|
||||
('切割', '切割'), ('表面工艺', '表面工艺')
|
||||
], string="工序类型")
|
||||
results = fields.Char('检测结果')
|
||||
results = fields.Char('结果')
|
||||
|
||||
@api.onchange('users_ids')
|
||||
def get_user_permissions(self):
|
||||
@@ -118,7 +118,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
chuck_brand_id = fields.Many2one('sf.machine.brand', string="卡盘品牌")
|
||||
chuck_type_id = fields.Char(string="卡盘类型")
|
||||
chuck_model_id = fields.Char(string="卡盘型号")
|
||||
tray_serial_number = fields.Char(string="卡盘序列号")
|
||||
tray_serial_number = fields.Char(string="托盘序列号")
|
||||
tray_name = fields.Char(string="托盘名称")
|
||||
tray_brand_id = fields.Many2one('sf.machine.brand', string="托盘品牌")
|
||||
tray_type_id = fields.Char(string="托盘类型")
|
||||
@@ -135,7 +135,6 @@ class ResMrpWorkOrder(models.Model):
|
||||
self.functional_fixture_code = self.functional_fixture_id.code
|
||||
self.functional_fixture_type_id = self.functional_fixture_id.type_id.id
|
||||
|
||||
|
||||
def get_no_data(self, production_id):
|
||||
process_parameter_workorder = self.search(
|
||||
[('surface_technics_parameters_id', '!=', False), ('production_id', '=', production_id)])
|
||||
@@ -338,19 +337,19 @@ class ResMrpWorkOrder(models.Model):
|
||||
# tray.unclamp()
|
||||
# self.tray_id = False
|
||||
|
||||
# return {
|
||||
# 'name': _('New Maintenance Request'),
|
||||
# 'view_mode': 'form',
|
||||
# 'res_model': 'maintenance.request',
|
||||
# 'res_id':self.id,
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# 'context': {
|
||||
# 'default_company_id': self.company_id.id,
|
||||
# 'default_production_id': self.id,
|
||||
# },
|
||||
# 'domain': [('production_id', '=', self.id)],
|
||||
# 'target':'new'
|
||||
# }
|
||||
# return {
|
||||
# 'name': _('New Maintenance Request'),
|
||||
# 'view_mode': 'form',
|
||||
# 'res_model': 'maintenance.request',
|
||||
# 'res_id':self.id,
|
||||
# 'type': 'ir.actions.act_window',
|
||||
# 'context': {
|
||||
# 'default_company_id': self.company_id.id,
|
||||
# 'default_production_id': self.id,
|
||||
# },
|
||||
# 'domain': [('production_id', '=', self.id)],
|
||||
# 'target':'new'
|
||||
# }
|
||||
|
||||
def recreateManufacturingOrWorkerOrder(self):
|
||||
"""
|
||||
@@ -400,20 +399,6 @@ class ResMrpWorkOrder(models.Model):
|
||||
try:
|
||||
cnc = self.env['mrp.workorder'].search(
|
||||
[('routing_type', '=', 'CNC加工'), ('production_id', '=', self.production_id.id)], limit=1)
|
||||
logging.info('fetchCNC-cnc:%s' % cnc)
|
||||
# if cnc.product_id.upload_model_file:
|
||||
# logging.info('fetchCNC-upload_model_file:%s' % cnc.product_id.upload_model_file)
|
||||
# attachments = cnc.product_id.upload_model_file[0]
|
||||
# logging.info('fetchCNC-attachment1:%s' % attachments)
|
||||
# logging.info('fetchCNC-attachment1:%s' % cnc.product_id.upload_model_file[0])
|
||||
# logging.info('fetchCNC-attachment2:%s' % cnc.product_id.upload_model_file[0].datas)
|
||||
# logging.info('fetchCNC-attachment:%s' % attachments.datas)
|
||||
# base64_data = base64.b64encode(attachments.datas)
|
||||
# logging.info('fetchCNC-attachment1:%s' % attachments)
|
||||
# base64_datas = base64_data.decode('utf-8')
|
||||
# model_code = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
# logging.info('fetchCNC-model_code:%s' % model_code)
|
||||
logging.info('fetchCNC-model_code1:%s' % cnc.product_id.model_code)
|
||||
res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code,
|
||||
'production_no': self.production_id.name,
|
||||
'machine_tool_code': cnc.workcenter_id.machine_tool_id.code,
|
||||
@@ -427,6 +412,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height,
|
||||
'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width,
|
||||
'order_no': cnc.production_id.origin,
|
||||
'model_order_no': cnc.product_id.default_code.rsplit('-', 1)[0],
|
||||
'user': self.env.user.name,
|
||||
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
|
||||
cnc.product_id.model_file).decode('utf-8')
|
||||
|
||||
@@ -12,11 +12,22 @@ import os
|
||||
class ResProductMo(models.Model):
|
||||
_inherit = 'product.template'
|
||||
model_file = fields.Binary('模型文件')
|
||||
categ_type = fields.Selection(
|
||||
[("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||
("夹具", "夹具")],
|
||||
string='产品的类别', related='categ_id.type',
|
||||
store=True)
|
||||
|
||||
# categ_type = fields.Selection(
|
||||
# [("成品", "成品"), ("坯料", "坯料"), ("原材料", "原材料"), ("表面工艺", "表面工艺"), ("刀具", "刀具"),
|
||||
# ("夹具", "夹具")],
|
||||
# string='产品的类别', compute='_compute_categ_id',
|
||||
# store=True)
|
||||
#
|
||||
# @api.depends('categ_id')
|
||||
# def _compute_categ_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.categ_type = record.categ_id.type
|
||||
|
||||
|
||||
categ_type = fields.Selection(string='产品的类别', related='categ_id.type', store=True)
|
||||
|
||||
model_name = fields.Char('模型名称')
|
||||
model_long = fields.Float('模型长(mm)', digits=(16, 3))
|
||||
model_width = fields.Float('模型宽(mm)', digits=(16, 3))
|
||||
@@ -56,18 +67,116 @@ class ResProductMo(models.Model):
|
||||
domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]")
|
||||
|
||||
brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
tool_length = fields.Integer('长度(mm)', size=6)
|
||||
tool_width = fields.Integer('宽度(mm)', size=6)
|
||||
tool_height = fields.Integer('高度(mm)', size=6)
|
||||
tool_thickness = fields.Integer('厚度(mm)', size=6)
|
||||
tool_weight = fields.Float('重量(kg)', size=4)
|
||||
tool_length = fields.Integer('长度(mm)')
|
||||
tool_width = fields.Integer('宽度(mm)')
|
||||
tool_height = fields.Integer('高度(mm)')
|
||||
tool_thickness = fields.Integer('厚度(mm)')
|
||||
tool_weight = fields.Float('重量(kg)')
|
||||
|
||||
coating_material = fields.Char('涂层材质')
|
||||
# 整体式刀具参数
|
||||
cutting_tool_total_length = fields.Float('总长度(mm)')
|
||||
cutting_tool_shank_length = fields.Float('柄部长度(mm)')
|
||||
cutting_tool_blade_length = fields.Float('刃部长度(mm)')
|
||||
# 整体式刀具特有字段
|
||||
cutting_tool_total_length = fields.Float('总长度(mm)', digits=(6, 1))
|
||||
cutting_tool_shank_length = fields.Float('柄部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_blade_length = fields.Float('刃部长度(mm)', digits=(6, 1))
|
||||
cutting_tool_blade_number = fields.Integer('刃数(个)')
|
||||
# 整体式刀具新增字段
|
||||
integral_neck_length = fields.Float('整体式刀具颈部长度(mm)', digits=(6, 1))
|
||||
integral_shank_diameter = fields.Float('整体式刀具柄部直径(mm)', digits=(6, 1))
|
||||
integral_blade_diameter = fields.Float('整体式刀具刃部直径(mm)', digits=(6, 1))
|
||||
integral_neck_diameter = fields.Float('整体式刀具颈部直径(mm)', digits=(6, 1))
|
||||
integral_blade_tip_diameter = fields.Float('整体式刀具刀尖直径(mm)', digits=(6, 1))
|
||||
integral_blade_tip_taper = fields.Float('整体式刀具刀尖锥度(°)', digits=(6, 1))
|
||||
integral_blade_helix_angle = fields.Float('整体式刀具刃部螺旋角(°)', digits=(6, 1))
|
||||
integral_blade_type = fields.Char('整体式刀具刃部类型')
|
||||
integral_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '整体式刀具粗/中/精')
|
||||
integral_hardness = fields.Integer('整体式刀具硬度(HRC)')
|
||||
integral_run_out_accuracy_max = fields.Float('整体式刀具端跳精度max', digits=(6, 1))
|
||||
integral_run_out_accuracy_min = fields.Float('整体式刀具端跳精度min', digits=(6, 1))
|
||||
suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method',
|
||||
'rel_suitable_machining_method_product_template', '适合加工方式')
|
||||
blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics',
|
||||
'rel_blade_tip_characteristics_product_template', '刀尖特征')
|
||||
handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type_product_template', '柄部类型')
|
||||
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction_product_template', '走刀方向')
|
||||
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant_product_template', '适合冷却液')
|
||||
|
||||
cutting_speed_ids = fields.Many2many('sf.cutting.speed', 'rel_sf_cutting_speed', '切削速度Vc')
|
||||
|
||||
@api.constrains('suitable_machining_method_ids')
|
||||
def _check_suitable_machining_method_ids(self):
|
||||
for record in self:
|
||||
if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合加工方式不能为空!")
|
||||
|
||||
@api.constrains('blade_tip_characteristics_ids')
|
||||
def _check_blade_tip_characteristics_ids(self):
|
||||
for record in self:
|
||||
if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征不能为空!")
|
||||
if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征只能单选!")
|
||||
|
||||
@api.constrains('handle_type_ids')
|
||||
def _check_handle_type_ids(self):
|
||||
for record in self:
|
||||
if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型不能为空!")
|
||||
if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型只能单选!")
|
||||
|
||||
@api.constrains('cutting_direction_ids')
|
||||
def _check_cutting_direction_ids(self):
|
||||
for record in self:
|
||||
if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("走刀方向不能为空!")
|
||||
|
||||
@api.constrains('suitable_coolant_ids')
|
||||
def _check_suitable_coolant_ids(self):
|
||||
for record in self:
|
||||
if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合冷却液不能为空!")
|
||||
|
||||
@api.constrains('cutting_tool_total_length')
|
||||
def _check_cutting_tool_total_length(self):
|
||||
if self.cutting_tool_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("总长度不能为0")
|
||||
|
||||
@api.constrains('cutting_tool_shank_length')
|
||||
def _check_cutting_tool_shank_length(self):
|
||||
if self.cutting_tool_shank_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部长度不能为0")
|
||||
|
||||
@api.constrains('cutting_tool_blade_length')
|
||||
def _check_cutting_tool_blade_length(self):
|
||||
if self.cutting_tool_blade_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部长度不能为0")
|
||||
|
||||
@api.constrains('cutting_tool_blade_number')
|
||||
def _check_cutting_tool_blade_number(self):
|
||||
if self.cutting_tool_blade_number <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃数不能为0")
|
||||
|
||||
@api.constrains('integral_shank_diameter')
|
||||
def _check_integral_shank_diameter(self):
|
||||
if self.integral_shank_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部直径不能为0")
|
||||
|
||||
@api.constrains('integral_blade_diameter')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_blade_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部直径不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_min')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最小(min)不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_max')
|
||||
def _check_integral_run_out_accuracy_max(self):
|
||||
if self.integral_run_out_accuracy_max <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最大(max)不能为0")
|
||||
|
||||
cutting_tool_diameter = fields.Float('直径(mm)')
|
||||
cutting_tool_blade_number = fields.Integer('刃数')
|
||||
cutting_tool_front_angle = fields.Float('前角(°)')
|
||||
cutting_tool_rear_angle = fields.Float('后角(°)')
|
||||
cutting_tool_main_included_angle = fields.Float('主偏角(°)')
|
||||
@@ -138,22 +247,75 @@ class ResProductMo(models.Model):
|
||||
fixture_clamping_way = fields.Char(string="装夹方式")
|
||||
fixture_port_type = fields.Char(string="接口类型")
|
||||
fixture_model_file = fields.Binary(string="3D模型图")
|
||||
fixture_clamp_workpiece_length_max = fields.Integer(string="夹持工件长度MAX(mm)", size=6)
|
||||
fixture_clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度MAX(mm)", size=6)
|
||||
fixture_clamp_workpiece_height_max = fields.Integer(string="夹持工件高度MAX(mm)", size=6)
|
||||
fixture_clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径MAX(mm)", digits=(16, 6))
|
||||
|
||||
fixture_clamp_workpiece_length_max = fields.Integer(string="夹持工件长度max(mm)")
|
||||
fixture_clamp_workpiece_width_max = fields.Integer(string="夹持工件宽度max(mm)")
|
||||
fixture_clamp_workpiece_height_max = fields.Integer(string="夹持工件高度max(mm)")
|
||||
fixture_clamp_workpiece_diameter_max = fields.Float(string="夹持工件直径max(mm)", digits=(16, 6))
|
||||
|
||||
fixture_maximum_carrying_weight = fields.Float(string="最大承载重量(kg)", digits=(16, 4))
|
||||
fixture_maximum_clamping_force = fields.Integer(string="最大夹持力(n)", size=8)
|
||||
fixture_maximum_clamping_force = fields.Integer(string="最大夹持力(n)")
|
||||
fixture_driving_way = fields.Char(string="驱动方式")
|
||||
fixture_apply_machine_tool_type_ids = fields.Many2many('sf.machine_tool.type', 'rel_product_machine_tool_type',
|
||||
string="适用机床型号")
|
||||
fixture_through_hole_size = fields.Integer(string="过孔大小(mm)", size=6)
|
||||
fixture_screw_size = fields.Integer(string="螺牙大小(mm)", size=6)
|
||||
fixture_through_hole_size = fields.Integer(string="过孔大小(mm)")
|
||||
fixture_screw_size = fields.Integer(string="螺牙大小(mm)")
|
||||
|
||||
# 注册状态
|
||||
register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')],
|
||||
string='注册状态', default='未注册')
|
||||
industry_code = fields.Char('行业编码', readonly=True)
|
||||
|
||||
@api.constrains('tool_length')
|
||||
def _check_tool_length_size(self):
|
||||
if self.tool_length > 1000000:
|
||||
raise ValidationError("长度不能超过1000000")
|
||||
|
||||
@api.constrains('tool_width')
|
||||
def _check_tool_width_size(self):
|
||||
if self.tool_width > 1000000:
|
||||
raise ValidationError("宽度不能超过1000000")
|
||||
|
||||
@api.constrains('tool_height')
|
||||
def _check_tool_height_size(self):
|
||||
if self.tool_height > 1000000:
|
||||
raise ValidationError("高度不能超过1000000")
|
||||
|
||||
@api.constrains('tool_thickness')
|
||||
def _check_tool_thickness_size(self):
|
||||
if self.tool_thickness > 1000000:
|
||||
raise ValidationError("厚度不能超过1000000")
|
||||
|
||||
@api.constrains('fixture_clamp_workpiece_length_max')
|
||||
def _check_fixture_clamp_workpiece_length_max_size(self):
|
||||
if self.fixture_clamp_workpiece_length_max > 1000000:
|
||||
raise ValidationError("夹持工件长度MAX不能超过1000000")
|
||||
|
||||
@api.constrains('fixture_clamp_workpiece_width_max')
|
||||
def _check_fixture_clamp_workpiece_width_max_size(self):
|
||||
if self.fixture_clamp_workpiece_width_max > 1000000:
|
||||
raise ValidationError("夹持工件宽度MAX不能超过1000000")
|
||||
|
||||
@api.constrains('fixture_clamp_workpiece_height_max')
|
||||
def _check_fixture_clamp_workpiece_height_max_size(self):
|
||||
if self.fixture_clamp_workpiece_height_max > 1000000:
|
||||
raise ValidationError("夹持工件高度MAX不能超过1000000")
|
||||
|
||||
@api.constrains('fixture_maximum_clamping_force')
|
||||
def _check_fixture_maximum_clamping_force_size(self):
|
||||
if self.fixture_maximum_clamping_force > 100000000:
|
||||
raise ValidationError("最大夹持力不能超过100000000")
|
||||
|
||||
@api.constrains('fixture_through_hole_size')
|
||||
def _check_fixture_through_hole_size_size(self):
|
||||
if self.fixture_through_hole_size > 1000000:
|
||||
raise ValidationError("过孔大小不能超过1000000")
|
||||
|
||||
@api.constrains('fixture_screw_size')
|
||||
def _check_fixture_through_hole_size_size(self):
|
||||
if self.fixture_screw_size > 1000000:
|
||||
raise ValidationError("螺牙大小不能超过1000000")
|
||||
|
||||
def _json_apply_machine_tool_type_item_code(self, item):
|
||||
code_arr = []
|
||||
for i in item.product_id.fixture_apply_machine_tool_type_ids:
|
||||
@@ -261,7 +423,6 @@ class ResProductMo(models.Model):
|
||||
item.coating_material = item.cutting_tool_model_id.coating_material
|
||||
item.cutting_tool_total_length = item.cutting_tool_model_id.total_length
|
||||
item.cutting_tool_shank_length = item.cutting_tool_model_id.shank_length
|
||||
item.cutting_tool_blade_length = item.cutting_tool_model_id.blade_length
|
||||
item.cutting_tool_diameter = item.cutting_tool_model_id.diameter
|
||||
item.cutting_tool_blade_number = item.cutting_tool_model_id.blade_number
|
||||
item.cutting_tool_front_angle = item.cutting_tool_model_id.front_angle
|
||||
@@ -368,7 +529,8 @@ class ResProductMo(models.Model):
|
||||
'materials_type_id': self.env['sf.materials.model'].search(
|
||||
[('materials_no', '=', item['texture_type_code'])]).id,
|
||||
# 'model_surface_process_ids': self.get_production_process_id(item['surface_process_code']),
|
||||
'model_process_parameters_ids': [(6, 0, [])] if not item.get('process_parameters_code') else self.get_process_parameters_id(item['process_parameters_code']),
|
||||
'model_process_parameters_ids': [(6, 0, [])] if not item.get(
|
||||
'process_parameters_code') else self.get_process_parameters_id(item['process_parameters_code']),
|
||||
'model_remark': item['remark'],
|
||||
'default_code': '%s-%s' % (order_number, i),
|
||||
# 'barcode': item['barcode'],
|
||||
|
||||
@@ -497,3 +497,22 @@ class ReStockMove(models.Model):
|
||||
item.product_id.write({'register_state': '注册失败'})
|
||||
except Exception as e:
|
||||
raise UserError("注册刀具到云端失败,请联系管理员!")
|
||||
|
||||
|
||||
class ReStockQuant(models.Model):
|
||||
_inherit = 'stock.quant'
|
||||
|
||||
def action_apply_inventory(self):
|
||||
inventory_diff_quantity = self.inventory_diff_quantity
|
||||
super(ReStockQuant, self).action_apply_inventory()
|
||||
if inventory_diff_quantity >= 1:
|
||||
stock = self.env['stock.move'].search([('product_id', '=', self.product_id.id), ('is_inventory', '=', True),
|
||||
('reference', '=', '更新的产品数量'), ('state', '=', 'done')],
|
||||
limit=1, order='id desc')
|
||||
if self.product_id.categ_type == '夹具':
|
||||
stock._register_fixture()
|
||||
elif self.product_id.categ_type == '刀具':
|
||||
stock._register_cutting_tool()
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
<field name="equipment_image" widget="image" />
|
||||
|
||||
|
||||
</xpath>
|
||||
<xpath expr='(//a[@name="unblock"])' position="after">
|
||||
|
||||
<div class="czyg">绿色:正常,红色:故障,黄色:下线/暂停</div>
|
||||
|
||||
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -24,7 +24,7 @@ class WorkLogSetting(models.Model):
|
||||
return num
|
||||
|
||||
code = fields.Char(string='序号', default=_get_code)
|
||||
name = fields.Char(string='工作日历名称', required=True, size=15, length=30)
|
||||
name = fields.Char(string='工作日历名称', required=True, size=15)
|
||||
|
||||
working_shift_ids = fields.Many2many('sf.working.shift', string='班次', required=True)
|
||||
start_time = fields.Datetime(string='日开始时间', readonly=True, compute='_compute_working_shift_ids')
|
||||
@@ -106,12 +106,12 @@ class WorkLogSetting(models.Model):
|
||||
# 'calendar_code': self.code,
|
||||
# 'date_time': target_date})
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
"""
|
||||
创建记录时,生成工作日历
|
||||
"""
|
||||
record = super(WorkLogSetting, self).create(vals)
|
||||
record = super(WorkLogSetting, self).create(vals_list)
|
||||
record.generate_work_calendar()
|
||||
return record
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from. import sale_order
|
||||
from. import quick_easy_order
|
||||
from . import sale_order
|
||||
from . import quick_easy_order
|
||||
from . import auto_quatotion_common
|
||||
|
||||
|
||||
|
||||
@@ -32,16 +32,16 @@ class QuickEasyOrder(models.Model):
|
||||
('0.01', '±0.01mm')], string='加工精度', default='0.10')
|
||||
material_id = fields.Many2one('sf.production.materials', '材料', compute='_compute_material_model', store=True)
|
||||
material_model_id = fields.Many2one('sf.materials.model', '型号', compute='_compute_material_model', store=True)
|
||||
process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
|
||||
# process_id = fields.Many2one('sf.production.process', string='表面工艺')
|
||||
parameter_ids = fields.Many2many('sf.production.process.parameter', 'process_item_order_rel', string='可选参数')
|
||||
quantity = fields.Integer('数量', default=1)
|
||||
unit_price = fields.Float('单价')
|
||||
price = fields.Float('总价')
|
||||
model_file = fields.Binary('模型文件')
|
||||
upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='模型文件')
|
||||
model_file = fields.Binary('glb模型文件')
|
||||
upload_model_file = fields.Many2many('ir.attachment', 'upload_qf_model_file_attachment_ref', string='上传模型文件')
|
||||
delivery_time = fields.Date('交货日期')
|
||||
customer_id = fields.Many2one('res.partner', string='客户', default=lambda self: self.env.user.partner_id.id)
|
||||
state = fields.Selection([('草稿', '草稿'), ('待付款', '待付款'), ('待派单', '待派单'),
|
||||
state = fields.Selection([('草稿', '草稿'), ('待派单', '待派单'),
|
||||
('待接单', '待接单'), ('加工中', '加工中'),
|
||||
('物流中', '物流中'), ('已交付', '已交付')], string='订单状态', default='草稿',
|
||||
readonly=True)
|
||||
@@ -49,6 +49,11 @@ class QuickEasyOrder(models.Model):
|
||||
('success', '成功'),
|
||||
('fail', '失败')], string='模型上色状态')
|
||||
|
||||
@api.depends('unit_price', 'quantity')
|
||||
def _compute_total_amount(self):
|
||||
for item in self:
|
||||
item.price = item.unit_price * item.quantity
|
||||
|
||||
@api.depends('material_id', 'material_model_id')
|
||||
def _compute_material_model(self):
|
||||
for item in self:
|
||||
@@ -75,20 +80,21 @@ class QuickEasyOrder(models.Model):
|
||||
logging.info('create-model_file:%s' % len(vals['model_file']))
|
||||
|
||||
obj = super(QuickEasyOrder, self).create(vals)
|
||||
self.model_coloring()
|
||||
self.model_coloring(obj)
|
||||
self.distribute_to_factory(obj)
|
||||
obj.state = '待接单'
|
||||
return obj
|
||||
|
||||
# 将attach的datas内容转为glb文件
|
||||
def transition_glb_file(self, report_path, model_code):
|
||||
shapes = read_step_file(report_path)
|
||||
output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||
# output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||
# output_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.stl')
|
||||
output_file = os.path.join('/tmp', str(model_code) + '.stl')
|
||||
write_stl_file(shapes, output_file, 'binary', 0.03, 0.5)
|
||||
# 转化为glb
|
||||
output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||
# output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||
util_path = get_resource_path('mrs_base', 'static/util')
|
||||
# output_glb_file = os.path.join('C:/Users/43484/Desktop/机企猫工作文档', str(model_code) + '.glb')
|
||||
output_glb_file = os.path.join('/tmp', str(model_code) + '.glb')
|
||||
util_path = get_resource_path('sf_dlm', 'static/util')
|
||||
cmd = 'python3 %s/stl2gltf.py %s %s -b' % (util_path, output_file, output_glb_file)
|
||||
os.system(cmd)
|
||||
# 转base64
|
||||
@@ -96,6 +102,7 @@ class QuickEasyOrder(models.Model):
|
||||
image_data = fileObj.read()
|
||||
base64_data = base64.b64encode(image_data)
|
||||
return base64_data
|
||||
|
||||
# return False
|
||||
|
||||
@api.onchange('upload_model_file')
|
||||
@@ -137,62 +144,106 @@ class QuickEasyOrder(models.Model):
|
||||
派单到工厂
|
||||
:return:
|
||||
"""
|
||||
web_base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', default='')
|
||||
logging.info("自动报价返回值: %s" % ret)
|
||||
url = '/api/bfm_process_order/list'
|
||||
res = {'order_number': obj.name, 'delivery_end_date': str(datetime.now()),
|
||||
'delivery_name': 'XXXXX', 'delivery_telephone': 'XXXXX',
|
||||
'delivery_address': 'XXXXX',
|
||||
'bfm_process_order_list': []}
|
||||
factory = self.env['res.partner'].sudo().search([], limit=1, order='id desc')
|
||||
config_header = Common.get_headers(self, factory.sf_token, factory.sf_secret_key)
|
||||
for item in obj:
|
||||
attachment = item.upload_model_file[0]
|
||||
base64_data = base64.b64encode(attachment.datas)
|
||||
base64_datas = base64_data.decode('utf-8')
|
||||
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
logging.info('model_file-size: %s' % len(item.model_file))
|
||||
val = {
|
||||
'model_long': 100,
|
||||
'model_width': 100,
|
||||
'model_height': 100,
|
||||
'model_volume': 300,
|
||||
'model_machining_precision': item.machining_precision,
|
||||
'model_name': attachment.name,
|
||||
'model_data': base64_datas,
|
||||
'model_file': base64.b64encode(item.model_file).decode('utf-8'),
|
||||
'texture_code': item.material_id.materials_no,
|
||||
'texture_type_code': item.material_model_id.materials_no,
|
||||
# 'surface_process_code': self.env['jikimo.surface.process']._json_surface_process_code(item),
|
||||
# 'process_parameters_code': self.env['jikimo.surface.process.item']._json_surface_process_item_code(
|
||||
# item),
|
||||
'price': item.price,
|
||||
'number': item.quantity,
|
||||
'total_amount': item.price,
|
||||
'remark': '',
|
||||
'barcode': barcode
|
||||
}
|
||||
res['bfm_process_order_list'].append(val)
|
||||
res['bfm_process_order_list'] = json.dumps(res['bfm_process_order_list'])
|
||||
try:
|
||||
ret = requests.post((web_base_url[0] + url), json={}, data=res,
|
||||
headers=config_header)
|
||||
ret = ret.json()
|
||||
if ret['status'] == 1:
|
||||
self.write(
|
||||
{'state': '待接单'})
|
||||
else:
|
||||
raise UserError(ret['message'])
|
||||
res = {'bfm_process_order_list': []}
|
||||
for item in obj:
|
||||
attachment = item.upload_model_file[0]
|
||||
base64_data = base64.b64encode(attachment.datas)
|
||||
base64_datas = base64_data.decode('utf-8')
|
||||
barcode = hashlib.sha1(base64_datas.encode('utf-8')).hexdigest()
|
||||
logging.info('model_file-size: %s' % len(item.model_file))
|
||||
res['bfm_process_order_list'].append({
|
||||
'model_long': item.model_length,
|
||||
'model_width': item.model_width,
|
||||
'model_height': item.model_height,
|
||||
'model_volume': item.model_volume,
|
||||
'model_machining_precision': item.machining_precision,
|
||||
'model_name': attachment.name,
|
||||
'model_data': base64_datas,
|
||||
'model_file': base64.b64encode(item.model_file).decode('utf-8'),
|
||||
'texture_code': item.material_id.materials_no,
|
||||
'texture_type_code': item.material_model_id.materials_no,
|
||||
# 'surface_process_code': self.env['jikimo.surface.process']._json_surface_process_code(item),
|
||||
'process_parameters_code': self.env[
|
||||
'sf.production.process.parameter']._json_production_process_item_code(
|
||||
item),
|
||||
'price': item.price,
|
||||
'number': item.quantity,
|
||||
'total_amount': item.price,
|
||||
'remark': '',
|
||||
'barcode': barcode
|
||||
})
|
||||
# res['bfm_process_order_list'] = json.dumps(res['bfm_process_order_list'])
|
||||
product_id = self.env.ref('sf_dlm.product_template_sf').sudo()
|
||||
self_machining_id = self.env.ref('sf_dlm.product_embryo_sf_self_machining').sudo()
|
||||
outsource_id = self.env.ref('sf_dlm.product_embryo_sf_outsource').sudo()
|
||||
purchase_id = self.env.ref('sf_dlm.product_embryo_sf_purchase').sudo()
|
||||
company_id = self.env.ref('base.main_company').sudo()
|
||||
# user_id = request.env.ref('base.user_admin').sudo()
|
||||
order_id = self.env['sale.order'].sale_order_create(company_id, 'XXXXX', 'XXXXX', 'XXXXX',
|
||||
str(datetime.now()))
|
||||
i = 1
|
||||
# 给sale_order的default_code字段赋值
|
||||
aa = self.env['sale.order'].sudo().search([('name', '=', order_id.name)])
|
||||
aa.default_code = obj.name
|
||||
for item in res['bfm_process_order_list']:
|
||||
product = self.env['product.template'].sudo().product_create(product_id, item, order_id,
|
||||
obj.name, i)
|
||||
bom_data = self.env['mrp.bom'].get_bom(product)
|
||||
logging.info('bom_data:%s' % bom_data)
|
||||
if bom_data:
|
||||
bom = self.env['mrp.bom'].bom_create(product, 'normal', False)
|
||||
bom.bom_create_line_has(bom_data)
|
||||
else:
|
||||
if product.materials_type_id.gain_way == '自加工':
|
||||
# 创建坯料
|
||||
self_machining_embryo = self.env['product.template'].sudo().no_bom_product_create(
|
||||
self_machining_id,
|
||||
item, order_id,
|
||||
'self_machining',
|
||||
i)
|
||||
# 创建坯料的bom
|
||||
self_machining_bom = self.env['mrp.bom'].bom_create(self_machining_embryo, 'normal', False)
|
||||
# 创建坯料里bom的组件
|
||||
self_machining_bom_line = self_machining_bom.bom_create_line(self_machining_embryo)
|
||||
if self_machining_bom_line == False:
|
||||
self.cr.rollback()
|
||||
return UserError('该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配')
|
||||
# 产品配置bom
|
||||
product_bom_self_machining = self.env['mrp.bom'].bom_create(product, 'normal', False)
|
||||
product_bom_self_machining.bom_create_line_has(self_machining_embryo)
|
||||
elif product.materials_type_id.gain_way == '外协':
|
||||
# 创建坯料
|
||||
outsource_embryo = self.env['product.template'].sudo().no_bom_product_create(outsource_id, item,
|
||||
order_id,
|
||||
'subcontract', i)
|
||||
# 创建坯料的bom
|
||||
outsource_bom = self.env['mrp.bom'].bom_create(outsource_embryo, 'subcontract', True)
|
||||
# 创建坯料的bom的组件
|
||||
outsource_bom_line = outsource_bom.with_user(
|
||||
self.env.ref("base.user_admin")).bom_create_line(outsource_embryo)
|
||||
if outsource_bom_line == False:
|
||||
self.cr.rollback()
|
||||
return UserError('该订单模型的材料型号在您分配的工厂里暂未有原材料,请先配置再进行分配')
|
||||
# 产品配置bom
|
||||
product_bom_outsource = self.env['mrp.bom'].bom_create(product, 'normal', False)
|
||||
product_bom_outsource.bom_create_line_has(outsource_embryo)
|
||||
elif product.materials_type_id.gain_way == '采购':
|
||||
purchase_embryo = self.env['product.template'].sudo().no_bom_product_create(purchase_id, item,
|
||||
order_id,
|
||||
'purchase', i)
|
||||
# 产品配置bom
|
||||
product_bom_purchase = self.env['mrp.bom'].bom_create(product, 'normal', False)
|
||||
product_bom_purchase.bom_create_line_has(purchase_embryo)
|
||||
order_id.with_user(self.env.ref("base.user_admin")).sale_order_create_line(product, item)
|
||||
except Exception as e:
|
||||
if ret['status'] != 1:
|
||||
raise UserError(e)
|
||||
else:
|
||||
raise UserError("分配工厂失败,请联系管理员")
|
||||
self.cr.rollback()
|
||||
return UserError('工厂创建销售订单和产品失败,请联系管理员')
|
||||
|
||||
# 特征识别
|
||||
|
||||
# 特征识别
|
||||
def feature_recognition(self, report_path, model_code):
|
||||
feature_path = self.env['sf.auto_quatotion.common'].sudo().get_feature_full_path()
|
||||
# price_path = self.env['jikimo.auto_quatotion.common'].get_price_full_path()
|
||||
process_time_db_path = self.env['sf.auto_quatotion.common'].sudo().get_process_time_db_path()
|
||||
ret = self.env['sf.auto_quatotion.common'].sudo().get_auto_quatotion(report_path, feature_path,
|
||||
process_time_db_path,
|
||||
@@ -200,11 +251,10 @@ class QuickEasyOrder(models.Model):
|
||||
return ret
|
||||
|
||||
# 模型上色
|
||||
def model_coloring(self):
|
||||
def model_coloring(self, order):
|
||||
url = '/api/library_of_models/create'
|
||||
config = self.env['res.config.settings'].get_values()
|
||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
||||
order = self.search([('id', '=', self.id)])
|
||||
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
logging.info('order: %s' % order.name)
|
||||
if order:
|
||||
attachment = order.upload_model_file[0]
|
||||
@@ -240,24 +290,25 @@ class QuickEasyOrder(models.Model):
|
||||
|
||||
# 自动报价
|
||||
def _get_price(self, order):
|
||||
|
||||
url = '/api/automatic_quotes'
|
||||
config = self.env['res.config.settings'].sudo().get_values()
|
||||
config_header = Common.get_headers(self, config['sf_token'], config['sf_key_secret'])
|
||||
config_header = Common.get_headers(self, config['token'], config['sf_secret_key'])
|
||||
logging.info("报价接口..........% s" % order.name)
|
||||
try:
|
||||
if order:
|
||||
vals = {}
|
||||
# mrs合作伙伴token
|
||||
vals['token'] = config['sf_token']
|
||||
vals['token'] = config['token']
|
||||
vals['accuracy'] = order.machining_precision
|
||||
vals['number'] = order.quantity
|
||||
vals['process_code'] = 0
|
||||
vals['texture_code'] = order.material_model_id.code
|
||||
vals['texture_code'] = order.material_model_id.materials_no
|
||||
vals['delivery_days'] = 15
|
||||
if order.model_file:
|
||||
attachment = self.env['ir.attachment'].sudo().search(
|
||||
[('id', '=', order.upload_model_file[0])])
|
||||
for item in order.upload_model_file:
|
||||
if item.ids[0]:
|
||||
logging.info('create-attachment:%s' % int(item.ids[0]))
|
||||
attachment = self.env['ir.attachment'].sudo().search([('id', '=', int(item.ids[0]))])
|
||||
vals['attachment_id'] = attachment.id
|
||||
else:
|
||||
vals['attachment_id'] = ''
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_quick_easy_order,quick_easy_order,model_quick_easy_order,base.group_user,1,1,1,1
|
||||
access_sf_auto_quatotion_common,sf_auto_quatotion_common,model_sf_auto_quatotion_common,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
<field name="code">quick.easy.order</field>
|
||||
<field name="prefix">FP-%(year)s-%(month)s%(day)s-</field>
|
||||
<field name="padding">4</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
# ---------- 快速订单 ------------
|
||||
@@ -15,13 +16,16 @@
|
||||
<field name="model">quick.easy.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="快速订单">
|
||||
<field optional="show" name="name" string="订单号"/>
|
||||
<field optional="show" name="customer_id" string="客户"/>
|
||||
<field optional="show" name="material_id"/>
|
||||
<field optional="show" name="material_model_id"/>
|
||||
<field optional="show" name="process_id"/>
|
||||
<field optional="show" name="quantity"/>
|
||||
<field optional="show" name="price"/>
|
||||
<field name="state" widget="label_selection"
|
||||
options="{'classes': {'待接单': 'default', '加工中':'primary','物流中':'warning','已交付': 'success'}}"/>
|
||||
<field name="name" string="订单号"/>
|
||||
<field name="customer_id" string="客户"/>
|
||||
<field name="material_id"/>
|
||||
<field name="material_model_id"/>
|
||||
<field name="parameter_ids" string="表面工艺参数" widget="many2many_tags"/>
|
||||
<field name="quantity"/>
|
||||
<field name="unit_price"/>
|
||||
<field name="price"/>
|
||||
<field optional="hide" name="delivery_time"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -32,6 +36,9 @@
|
||||
<field name="model">quick.easy.order</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="快速订单">
|
||||
<header>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<h1>
|
||||
<field name="name" readonly="True"/>
|
||||
@@ -41,8 +48,8 @@
|
||||
<field name="customer_id" readonly="1" force_save="1"/>
|
||||
<field name="material_id"/>
|
||||
<field name="material_model_id"/>
|
||||
<field name="process_id"/>
|
||||
<field name="parameter_ids" widget="many2many_tags"/>
|
||||
<!-- <field name="process_id"/>-->
|
||||
<field name="parameter_ids" widget="many2many_tags" string="表面工艺参数"/>
|
||||
<field name="machining_precision"/>
|
||||
<field name="quantity"/>
|
||||
<field name="unit_price"/>
|
||||
@@ -80,7 +87,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="快速订单">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|', ('name', 'ilike', self), '|', ('receive_name', 'ilike', self),'|', ('receive_phone', 'ilike', self),('customer_id', 'ilike', self)]"/>
|
||||
filter_domain="['|', ('name', 'ilike', self), '|',('customer_id', 'ilike', self)]"/>
|
||||
<separator/>
|
||||
<field name="customer_id"/>
|
||||
</search>
|
||||
|
||||
@@ -13,13 +13,13 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
_description = '功能刀具列表'
|
||||
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
name = fields.Char('名称', required=True, size=20)
|
||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', tracking=True,
|
||||
group_expand='_read_group_mrs_cutting_tool_type_ids')
|
||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型',
|
||||
group_expand='_read_group_mrs_cutting_tool_type_id', compute_sudo=True)
|
||||
|
||||
@api.model
|
||||
def _read_group_mrs_cutting_tool_type_ids(self, categories, domain, order):
|
||||
def _read_group_mrs_cutting_tool_type_id(self, categories, domain, order):
|
||||
mrs_cutting_tool_type_ids = categories._search([], order=order, access_rights_uid=SUPERUSER_ID)
|
||||
return categories.browse(mrs_cutting_tool_type_ids)
|
||||
|
||||
@@ -65,7 +65,6 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
# record.mrs_cutting_tool_cutterbar_model_ids = None
|
||||
# record.mrs_cutting_tool_cutterpad_model_ids = None
|
||||
|
||||
|
||||
diameter = fields.Float('直径(mm)')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
string='刀具等级')
|
||||
@@ -218,11 +217,11 @@ class FunctionalToolWarning(models.Model):
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
string='刀具等级', readonly=True, related='functional_cutting_tool_id.tool_grade')
|
||||
string='刀具等级', readonly=True, compute='_compute_functional_cutting_tool_id')
|
||||
machining_accuracy = fields.Float('加工精度(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.machining_accuracy')
|
||||
|
||||
tool_length = fields.Float('装刀长', readonly=True, related='functional_cutting_tool_id.tool_length')
|
||||
# tool_length = fields.Float('装刀长', readonly=True, related='functional_cutting_tool_id.tool_length')
|
||||
|
||||
tool_length = fields.Float('装刀长(mm)', readonly=True, related='functional_cutting_tool_id.tool_length')
|
||||
blade_number = fields.Integer('刃数', readonly=True, related='functional_cutting_tool_id.blade_number')
|
||||
@@ -231,16 +230,24 @@ class FunctionalToolWarning(models.Model):
|
||||
effective_blade_length = fields.Float('有效刃长(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.effective_blade_length')
|
||||
max_life = fields.Float('最大寿命值', readonly=True, related='functional_cutting_tool_id.max_life')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True, related='functional_cutting_tool_id.is_standard')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True,
|
||||
compute='_compute_functional_cutting_tool_id')
|
||||
applicable_range = fields.Char('适用范围', readonly=True, related='functional_cutting_tool_id.applicable_range')
|
||||
image = fields.Binary('图片', readonly=True, related='functional_cutting_tool_id.image')
|
||||
|
||||
# 功能刀具预警 特有字段
|
||||
image = fields.Binary('图片', readonly=True, related='functional_cutting_tool_id.image')
|
||||
install_tool_time = fields.Datetime("装刀时间", readonly=True,
|
||||
related='functional_tool_assembly_id.tool_loading_time')
|
||||
|
||||
@api.depends('functional_cutting_tool_id')
|
||||
def _compute_functional_cutting_tool_id(self):
|
||||
if self.functional_cutting_tool_id:
|
||||
self.tool_grade = self.functional_cutting_tool_id.tool_grade
|
||||
self.is_standard = self.functional_cutting_tool_id.is_standard
|
||||
|
||||
# 功能刀具预警 特有字段
|
||||
outbound_time = fields.Datetime('出库时间', readonly=True, related='functional_tool_assembly_id.receive_time')
|
||||
on_board_time = fields.Datetime('上机时间', readonly=False)
|
||||
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=True, tracking=True,
|
||||
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=True,
|
||||
group_expand='_read_group_machine_table_name_ids')
|
||||
|
||||
@api.model
|
||||
@@ -250,7 +257,7 @@ class FunctionalToolWarning(models.Model):
|
||||
|
||||
machine_tool_code = fields.Char('机台号', readonly=True, related='functional_tool_assembly_id.machine_tool_code')
|
||||
cutting_tool_code = fields.Char('刀位号', readonly=True, related='functional_tool_assembly_id.cutter_spacing_code')
|
||||
idle_time = fields.Char('闲置时长', readonly=False)
|
||||
# idle_time = fields.Char('闲置时长', readonly=False)
|
||||
idle_time = fields.Char('闲置时长(h)', readonly=False)
|
||||
alarm_value = fields.Char('报警值', readonly=False)
|
||||
used_value = fields.Char('已使用值', readonly=False)
|
||||
@@ -272,9 +279,9 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
|
||||
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
|
||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||
tracking=True, group_expand='_read_mrs_cutting_tool_type_ids',
|
||||
group_expand='_read_mrs_cutting_tool_type_ids',
|
||||
store=True,
|
||||
compute='_compute_functional_cutting_tool_id')
|
||||
compute='_compute_functional_cutting_tool_ids')
|
||||
|
||||
@api.model
|
||||
def _read_mrs_cutting_tool_type_ids(self, categories, domain, order):
|
||||
@@ -282,7 +289,7 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
return categories.browse(mrs_cutting_tool_type_ids)
|
||||
|
||||
@api.depends('functional_cutting_tool_id')
|
||||
def _compute_functional_cutting_tool_id(self):
|
||||
def _compute_functional_cutting_tool_ids(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
||||
@@ -344,7 +351,7 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
string='刀具等级', readonly=True, related='functional_cutting_tool_id.tool_grade')
|
||||
string='刀具等级', readonly=True, compute='_compute_functional_cutting_tool_id')
|
||||
machining_accuracy = fields.Float('加工精度(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.machining_accuracy')
|
||||
tool_length = fields.Float('装刀长(mm)', readonly=True, related='functional_cutting_tool_id.tool_length')
|
||||
@@ -354,10 +361,17 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
effective_blade_length = fields.Float('有效刃长(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.effective_blade_length')
|
||||
max_life = fields.Float('最大寿命值', readonly=True, related='functional_cutting_tool_id.max_life')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True, related='functional_cutting_tool_id.is_standard')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True,
|
||||
compute='_compute_functional_cutting_tool_id')
|
||||
applicable_range = fields.Char('适用范围', readonly=True, related='functional_cutting_tool_id.applicable_range')
|
||||
image = fields.Binary('图片', readonly=True, related='functional_cutting_tool_id.image')
|
||||
|
||||
@api.depends('functional_cutting_tool_id')
|
||||
def _compute_functional_cutting_tool_id(self):
|
||||
if self.functional_cutting_tool_id:
|
||||
self.tool_grade = self.functional_cutting_tool_id.tool_grade
|
||||
self.is_standard = self.functional_cutting_tool_id.is_standard
|
||||
|
||||
# 功能刀具实时分布
|
||||
tool_stock_num = fields.Integer(string='刀具房库存数量', readonly=False)
|
||||
side_shelf_num = fields.Integer(string='线边货架货架数量', readonly=False)
|
||||
@@ -395,9 +409,9 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
|
||||
functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
|
||||
mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||
tracking=True, group_expand='_read_mrs_cutting_tool_type_ids',
|
||||
group_expand='_read_mrs_cutting_tool_type_ids',
|
||||
store=True,
|
||||
compute='_compute_functional_cutting_tool_id')
|
||||
compute='_compute_functional_cutting_tool_ids')
|
||||
|
||||
@api.model
|
||||
def _read_mrs_cutting_tool_type_ids(self, categories, domain, order):
|
||||
@@ -405,7 +419,7 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
return categories.browse(mrs_cutting_tool_type_ids)
|
||||
|
||||
@api.depends('functional_cutting_tool_id')
|
||||
def _compute_functional_cutting_tool_id(self):
|
||||
def _compute_functional_cutting_tool_ids(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.mrs_cutting_tool_type_id = record.functional_cutting_tool_id.mrs_cutting_tool_type_id.id
|
||||
@@ -465,7 +479,7 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
string='刀具等级', readonly=True, related='functional_cutting_tool_id.tool_grade')
|
||||
string='刀具等级', readonly=True, compute='_compute_functional_cutting_tool_id')
|
||||
machining_accuracy = fields.Float('加工精度(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.machining_accuracy')
|
||||
tool_length = fields.Float('装刀长(mm)', readonly=True, related='functional_cutting_tool_id.tool_length')
|
||||
@@ -475,10 +489,17 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
effective_blade_length = fields.Float('有效刃长(mm)', readonly=True,
|
||||
related='functional_cutting_tool_id.effective_blade_length')
|
||||
max_life = fields.Float('最大寿命值', readonly=True, related='functional_cutting_tool_id.max_life')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True, related='functional_cutting_tool_id.is_standard')
|
||||
is_standard = fields.Selection([('1', '是'), ('0', '否')],'是否标准刀', readonly=True,
|
||||
compute='_compute_functional_cutting_tool_id')
|
||||
applicable_range = fields.Char('适用范围', readonly=True, related='functional_cutting_tool_id.applicable_range')
|
||||
image = fields.Binary('图片', readonly=True, related='functional_cutting_tool_id.image')
|
||||
|
||||
@api.depends('functional_cutting_tool_id')
|
||||
def _compute_functional_cutting_tool_id(self):
|
||||
if self.functional_cutting_tool_id:
|
||||
self.tool_grade = self.functional_cutting_tool_id.tool_grade
|
||||
self.is_standard = self.functional_cutting_tool_id.is_standard
|
||||
|
||||
# 功能刀具出入库记录 特有字段
|
||||
current_state = fields.Char(string='当前状态', readonly=False)
|
||||
current_store_area = fields.Char(string='当前库区', readonly=False)
|
||||
@@ -486,7 +507,7 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
tool_install_staff = fields.Char(string='装刀人', readonly=False)
|
||||
tool_install_time = fields.Datetime(string='装刀时间', readonly=False)
|
||||
thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
max_life_span = fields.Char(string='最大寿命值', readonly=False)
|
||||
# max_life_span = fields.Char(string='最大寿命值', readonly=False)
|
||||
alarm_value = fields.Char(string='报警值', readonly=False)
|
||||
used_value = fields.Char(string='已使用值', readonly=False)
|
||||
reason_application = fields.Char(string='申请原因', readonly=False)
|
||||
@@ -528,12 +549,11 @@ class MachineTableToolChangingApply(models.Model):
|
||||
# string='换刀需求信息',
|
||||
# attrs="{'invisible': 1}")
|
||||
|
||||
|
||||
name = fields.Many2one('maintenance.equipment', string='CNC机床',required=True, readonly=False, tracking=True,
|
||||
name = fields.Many2one('maintenance.equipment', string='CNC机床',required=True, readonly=False,
|
||||
group_expand='_read_group_names')
|
||||
machine_table_type_id = fields.Many2one('sf.machine_tool.category', string='机床类型', readonly=True,
|
||||
compute='_compute_name')
|
||||
machine_tool_code = fields.Char(string='机台号', attrs="{'invisible': 1}", readonly=True, compute='_compute_name')
|
||||
machine_tool_code = fields.Char(string='机台号', invisible=True, readonly=True, compute='_compute_name')
|
||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=False)
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True, compute='_compute_functional_tool_name_id')
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
||||
@@ -555,7 +575,7 @@ class MachineTableToolChangingApply(models.Model):
|
||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型',
|
||||
readonly=True)
|
||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
||||
string='粗/中/精', readonly=True)
|
||||
string='粗/中/精(待换)', readonly=True)
|
||||
new_former = fields.Selection([('0', '新'), ('1', '旧')], string='新/旧', readonly=True)
|
||||
applicant = fields.Char(string='申请人', readonly=True)
|
||||
used_tool_time = fields.Datetime(string='用刀时间', readonly=True)
|
||||
@@ -692,7 +712,7 @@ class CAMWorkOrderProgramKnifePlan(models.Model):
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=False)
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=False)
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False)
|
||||
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False, tracking=True,
|
||||
machine_table_name_id = fields.Many2one('maintenance.equipment', string='机床名称', readonly=False,
|
||||
group_expand='_read_group_machine_table_name_ids')
|
||||
|
||||
@api.model
|
||||
@@ -786,7 +806,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||
name = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True,
|
||||
tracking=True, group_expand='_read_group_functional_tool_type_ids')
|
||||
group_expand='_read_group_functional_tool_type_ids')
|
||||
|
||||
@api.model
|
||||
def _read_group_functional_tool_type_ids(self, categories, domain, order):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from odoo import fields, models, api, SUPERUSER_ID
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
# 刀具物料搜索
|
||||
@@ -9,23 +10,23 @@ class SfToolMaterialSearch(models.Model):
|
||||
|
||||
sequence = fields.Integer('序号')
|
||||
code = fields.Char('编码')
|
||||
name = fields.Char('名称')
|
||||
name = fields.Char('名称', required=True)
|
||||
# 关联刀具类型
|
||||
mrs_cutting_tool_type_id = fields.Many2one(
|
||||
'sf.cutting.tool.type', '刀具类型',
|
||||
domain="[('cutting_tool_material_id.name', '=', cutting_tool_material_name)]")
|
||||
domain="[('cutting_tool_material_id.name', '=', cutting_tool_material_name)]", required=True)
|
||||
# 关联刀具物料名称
|
||||
mrs_cutting_tool_material_name = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料名称',
|
||||
store=True)
|
||||
cutting_tool_type = fields.Char(related='mrs_cutting_tool_material_id.name', string='刀具物料类型', store=True)
|
||||
mrs_machine_brand_id = fields.Many2one('sf.machine.brand', '品牌')
|
||||
mrs_machine_brand_id = fields.Many2one('sf.machine.brand', '品牌', required=True)
|
||||
# 关联刀具型号
|
||||
# mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', '刀具型号')
|
||||
|
||||
# 关联刀具物料模型
|
||||
mrs_cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料',tracking=True,
|
||||
group_expand='_read_group_mrs_cutting_tool_material_ids')
|
||||
cutting_tool_material_name = fields.Char(string='物料名称',invisible=True)
|
||||
mrs_cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料',
|
||||
group_expand='_read_group_mrs_cutting_tool_material_ids', required=True)
|
||||
cutting_tool_material_name = fields.Char(string='物料名称', invisible=True)
|
||||
|
||||
@api.onchange('mrs_cutting_tool_material_id')
|
||||
def _onchange_mrs_cutting_tool_material_id(self):
|
||||
@@ -40,19 +41,19 @@ class SfToolMaterialSearch(models.Model):
|
||||
|
||||
# 刀片特有字段
|
||||
blade_code = fields.Char('刀片编码', readonly=True)
|
||||
blade_length = fields.Float('长度L(mm)')
|
||||
blade_width = fields.Float('宽度D(mm)')
|
||||
blade_height = fields.Float('高度T(mm)')
|
||||
blade_top_angle = fields.Float('顶角(°)')
|
||||
blade_front_angle = fields.Float('前角(°)')
|
||||
blade_rear_angle = fields.Float('后角(°)')
|
||||
blade_main_included_angle = fields.Float('主偏角(°)')
|
||||
blade_r_angle = fields.Float('R角(°)')
|
||||
blade_hardness = fields.Char('加工硬度')
|
||||
blade_accuracy = fields.Char('精度等级')
|
||||
blade_coating_material_id = fields.Char('涂层材质')
|
||||
blade_radius = fields.Float('刀尖半径(mm)')
|
||||
blade_nut = fields.Float('配对螺母(mm)')
|
||||
blade_length = fields.Float('刀片长度L(mm)')
|
||||
blade_width = fields.Float('刀片宽度D(mm)')
|
||||
blade_height = fields.Float('刀片高度T(mm)')
|
||||
blade_top_angle = fields.Float('刀片顶角(°)')
|
||||
blade_front_angle = fields.Float('刀片前角(°)')
|
||||
blade_rear_angle = fields.Float('刀片后角(°)')
|
||||
blade_main_included_angle = fields.Float('刀片主偏角(°)')
|
||||
blade_r_angle = fields.Float('刀片R角(°)')
|
||||
blade_hardness = fields.Char('刀片加工硬度')
|
||||
blade_accuracy = fields.Char('刀片精度等级')
|
||||
blade_coating_material_id = fields.Char('刀片涂层材质')
|
||||
blade_radius = fields.Float('刀片刀尖半径(mm)')
|
||||
blade_nut = fields.Float('刀片配对螺母(mm)')
|
||||
mrs_cutting_tool_model_blade_cutter_bar_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='sf_tool_material_search_blade_cutter_bar_rel',
|
||||
@@ -74,79 +75,175 @@ class SfToolMaterialSearch(models.Model):
|
||||
|
||||
# 整体式刀具特有字段
|
||||
integral_code = fields.Char('整体式刀具编码', readonly=True)
|
||||
integral_total_length = fields.Float('总长度(mm)')
|
||||
integral_shank_length = fields.Float('柄部长度(mm)')
|
||||
integral_blade_length = fields.Float('刃部长度(mm)')
|
||||
integral_diameter = fields.Float('直径(mm)')
|
||||
integral_blade_number = fields.Integer('刃数')
|
||||
integral_front_angle = fields.Float('前角(°)')
|
||||
integral_rear_angle = fields.Float('后角(°)')
|
||||
integral_main_included_angle = fields.Float('主偏角(°)')
|
||||
integral_accuracy = fields.Float('精度等级')
|
||||
integral_hardness = fields.Float('加工硬度(HRC)')
|
||||
integral_coating_material = fields.Char('涂层材质')
|
||||
integral_nut = fields.Float('配对螺母(mm)')
|
||||
integral_scope = fields.Char('适用范围')
|
||||
integral_total_length = fields.Float('整体式刀具总长度(mm)', digits=(6, 1))
|
||||
integral_shank_length = fields.Float('整体式刀具柄部长度(mm)', digits=(6, 1))
|
||||
integral_blade_length = fields.Float('整体式刀具刃部长度(mm)', digits=(6, 1))
|
||||
integral_neck_length = fields.Float('整体式刀具颈部长度(mm)', digits=(6, 1))
|
||||
integral_shank_diameter = fields.Float('整体式刀具柄部直径(mm)', digits=(6, 1))
|
||||
integral_blade_diameter = fields.Float('整体式刀具刃部直径(mm)', digits=(6, 1))
|
||||
integral_neck_diameter = fields.Float('整体式刀具颈部直径(mm)', digits=(6, 1))
|
||||
integral_blade_number = fields.Integer('整体式刀具刃数(个)')
|
||||
integral_blade_tip_diameter = fields.Float('整体式刀具刀尖直径(mm)', digits=(6, 1))
|
||||
integral_blade_tip_taper = fields.Float('整体式刀具刀尖锥度(°)', digits=(6, 1))
|
||||
integral_blade_helix_angle = fields.Float('整体式刀具刃部螺旋角(°)', digits=(6, 1))
|
||||
integral_blade_type = fields.Char('整体式刀具刃部类型')
|
||||
integral_coarse_medium_fine = fields.Selection([('粗', '粗'), ('中', '中'), ('精', '精')], '整体式刀具粗/中/精')
|
||||
# integral_blade_material = fields.Selection([('碳素钢', '碳素钢'), ('硬质合金', '硬质合金')], '整体式刀具刀具材质')
|
||||
integral_hardness = fields.Integer('整体式刀具硬度(HRC)')
|
||||
integral_coating_material = fields.Char('整体式刀具涂层材质')
|
||||
integral_run_out_accuracy_max = fields.Float('整体式刀具端跳精度max', digits=(6,1))
|
||||
integral_run_out_accuracy_min = fields.Float('整体式刀具端跳精度min', digits=(6, 1))
|
||||
|
||||
suitable_machining_method_ids = fields.Many2many('sf.suitable.machining.method',
|
||||
'rel_suitable_machining_method', '适合加工方式')
|
||||
blade_tip_characteristics_ids = fields.Many2many('sf.blade.tip.characteristics',
|
||||
'rel_blade_tip_characteristics', '刀尖特征')
|
||||
handle_type_ids = fields.Many2many('sf.handle.type', 'rel_handle_type', '柄部类型')
|
||||
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction', '走刀方向')
|
||||
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant', '适合冷却液')
|
||||
|
||||
@api.constrains('suitable_machining_method_ids')
|
||||
def _check_suitable_machining_method_ids(self):
|
||||
for record in self:
|
||||
if len(record.suitable_machining_method_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合加工方式不能为空!")
|
||||
|
||||
@api.constrains('blade_tip_characteristics_ids')
|
||||
def _check_blade_tip_characteristics_ids(self):
|
||||
for record in self:
|
||||
if len(record.blade_tip_characteristics_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征不能为空!")
|
||||
if len(record.blade_tip_characteristics_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刀尖特征只能单选!")
|
||||
|
||||
@api.constrains('handle_type_ids')
|
||||
def _check_handle_type_ids(self):
|
||||
for record in self:
|
||||
if len(record.handle_type_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型不能为空!")
|
||||
if len(record.handle_type_ids) > 1 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部类型只能单选!")
|
||||
|
||||
@api.constrains('cutting_direction_ids')
|
||||
def _check_cutting_direction_ids(self):
|
||||
for record in self:
|
||||
if len(record.cutting_direction_ids) == 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("走刀方向不能为空!")
|
||||
|
||||
@api.constrains('suitable_coolant_ids')
|
||||
def _check_suitable_coolant_ids(self):
|
||||
for record in self:
|
||||
if not record.suitable_coolant_ids and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("适合冷却液不能为空!")
|
||||
|
||||
@api.constrains('integral_total_length')
|
||||
def _check_integral_total_length(self):
|
||||
if self.integral_total_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("总长度不能为0")
|
||||
|
||||
@api.constrains('integral_shank_length')
|
||||
def _check_integral_shank_length(self):
|
||||
if self.integral_shank_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部长度不能为0")
|
||||
|
||||
@api.constrains('integral_blade_length')
|
||||
def _check_integral_blade_length(self):
|
||||
if self.integral_blade_length <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部长度不能为0")
|
||||
|
||||
@api.constrains('integral_blade_number')
|
||||
def _check_integral_blade_number(self):
|
||||
if self.integral_blade_number <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃数不能为0")
|
||||
|
||||
@api.constrains('integral_shank_diameter')
|
||||
def _check_integral_shank_diameter(self):
|
||||
if self.integral_shank_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("柄部直径不能为0")
|
||||
|
||||
@api.constrains('integral_blade_diameter')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_blade_diameter <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("刃部直径不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_min')
|
||||
def _check_integral_blade_diameter(self):
|
||||
if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最小(min)不能为0")
|
||||
|
||||
@api.constrains('integral_run_out_accuracy_max')
|
||||
def _check_integral_run_out_accuracy_max(self):
|
||||
if self.integral_run_out_accuracy_max <= 0 and self.cutting_tool_type == '整体式刀具':
|
||||
raise ValidationError("端跳精度最大(max)不能为0")
|
||||
|
||||
# integral_front_angle = fields.Float('整体式刀具前角(°)')
|
||||
# integral_rear_angle = fields.Float('整体式刀具后角(°)')
|
||||
# integral_main_included_angle = fields.Float('整体式刀具主偏角(°)')
|
||||
# integral_accuracy = fields.Float('整体式刀具精度等级')
|
||||
# integral_hardness = fields.Float('整体式刀具加工硬度(HRC)')
|
||||
# integral_coating_material = fields.Char('整体式刀具涂层材质')
|
||||
# integral_nut = fields.Float('整体式刀具配对螺母(mm)')
|
||||
# integral_scope = fields.Char('整体式刀具适用范围')
|
||||
|
||||
# 刀杆特有字段
|
||||
bar_code = fields.Char('刀杆编码', readonly=True)
|
||||
# bar_name = fields.Char('刀杆名称', required=True)
|
||||
bar_c_diameter = fields.Float('C柄径(mm)')
|
||||
bar_total_length = fields.Float('L总长(mm)')
|
||||
bar_blade_number = fields.Integer('刃数')
|
||||
bar_d_diameter = fields.Float('D刃径(mm)')
|
||||
bar_c_diameter = fields.Float('刀杆C柄径(mm)')
|
||||
bar_total_length = fields.Float('刀杆L总长(mm)')
|
||||
bar_blade_number = fields.Integer('刀杆刃数')
|
||||
bar_d_diameter = fields.Float('刀杆D刃径(mm)')
|
||||
mrs_cutting_tool_model_bar_blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='sf_tool_material_search_bar_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀片')]",
|
||||
string='适用刀片型号'
|
||||
string='刀杆适用刀片型号'
|
||||
)
|
||||
bar_wrench = fields.Float('配对扳手(mm)')
|
||||
bar_screw = fields.Float('配备螺丝(mm)')
|
||||
bar_radius = fields.Float('刀尖圆角半径')
|
||||
bar_accuracy = fields.Char('精度等级')
|
||||
bar_hardness = fields.Char('硬度(°)')
|
||||
bar_scope = fields.Char('适用范围')
|
||||
bar_wrench = fields.Float('刀杆配对扳手(mm)')
|
||||
bar_screw = fields.Float('刀杆配备螺丝(mm)')
|
||||
bar_radius = fields.Float('刀杆刀尖圆角半径')
|
||||
bar_accuracy = fields.Char('刀杆精度等级')
|
||||
bar_hardness = fields.Char('刀杆硬度(°)')
|
||||
bar_scope = fields.Char('刀杆适用范围')
|
||||
|
||||
# 刀盘特有字段
|
||||
pad_code = fields.Char('刀盘编码', readonly=True)
|
||||
# pad_name = fields.Char('刀盘名称', required=True)
|
||||
pad_c_diameter = fields.Float('C柄径(mm)')
|
||||
pad_total_length = fields.Float('L总长(mm)')
|
||||
pad_blade_number = fields.Integer('刃数')
|
||||
pad_d_diameter = fields.Float('D刃径(mm)')
|
||||
pad_c_diameter = fields.Float('刀盘C柄径(mm)')
|
||||
pad_total_length = fields.Float('刀盘L总长(mm)')
|
||||
pad_blade_number = fields.Integer('刀盘刃数')
|
||||
pad_d_diameter = fields.Float('刀盘D刃径(mm)')
|
||||
mrs_cutting_tool_model_pad_blade_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='sf_tool_material_search_pad_blade_rel',
|
||||
column1='model_id_1',
|
||||
column2='model_id_2',
|
||||
domain="[('cutting_tool_type', '=', '刀片')]",
|
||||
string='适用刀片型号'
|
||||
string='刀盘适用刀片型号'
|
||||
)
|
||||
pad_wrench = fields.Float('配对扳手(mm)')
|
||||
pad_screw = fields.Float('配备螺丝(mm)')
|
||||
pad_radius = fields.Float('刀尖圆角半径')
|
||||
pad_accuracy = fields.Char('精度等级')
|
||||
pad_hardness = fields.Char('硬度(°)')
|
||||
pad_scope = fields.Char('适用范围')
|
||||
pad_wrench = fields.Float('刀盘配对扳手(mm)')
|
||||
pad_screw = fields.Float('刀盘配备螺丝(mm)')
|
||||
pad_radius = fields.Float('刀盘刀尖圆角半径')
|
||||
pad_accuracy = fields.Char('刀盘精度等级')
|
||||
pad_hardness = fields.Char('刀盘硬度(°)')
|
||||
pad_scope = fields.Char('刀盘适用范围')
|
||||
|
||||
# 刀柄特有字段
|
||||
handle_code = fields.Char('刀柄编码', readonly=True)
|
||||
# 柄长L(mm)、法兰柄长L1(mm)、法兰直径D1(mm)
|
||||
handle_length = fields.Float('柄长L(mm)')
|
||||
handle_diameter = fields.Float('直径D(mm)')
|
||||
handle_flange_length = fields.Float('法兰柄长L1(mm)')
|
||||
handle_flange_diameter = fields.Float('法兰直径D1(mm)')
|
||||
handle_length = fields.Float('刀柄柄长L(mm)')
|
||||
handle_diameter = fields.Float('刀柄直径D(mm)')
|
||||
handle_flange_length = fields.Float('刀柄法兰柄长L1(mm)')
|
||||
handle_flange_diameter = fields.Float('刀柄法兰直径D1(mm)')
|
||||
# 夹持直径min、夹持直径max、径跳精度、最大转速n/min、3D模型图
|
||||
handle_clamping_diameter_min = fields.Float('夹持直径min')
|
||||
handle_clamping_diameter_max = fields.Float('夹持直径max')
|
||||
handle_jump_accuracy = fields.Float('径跳精度')
|
||||
handle_max_speed = fields.Float('最大转速n/min')
|
||||
handle_weight = fields.Float('重量(kg)')
|
||||
handle_body_accuracy = fields.Float('本体精度(mm)')
|
||||
handle_nut = fields.Float('配对螺母(mm)')
|
||||
handle_clamping_diameter_min = fields.Float('刀柄夹持直径min')
|
||||
handle_clamping_diameter_max = fields.Float('刀柄夹持直径max')
|
||||
handle_jump_accuracy = fields.Float('刀柄径跳精度')
|
||||
handle_max_speed = fields.Float('刀柄最大转速n/min')
|
||||
handle_weight = fields.Float('刀柄重量(kg)')
|
||||
handle_body_accuracy = fields.Float('刀柄本体精度(mm)')
|
||||
handle_nut = fields.Float('刀柄配对螺母(mm)')
|
||||
mrs_cutting_tool_model_handle_chuck_model_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='sf_tool_material_search_handle_chuck_rel',
|
||||
@@ -155,22 +252,22 @@ class SfToolMaterialSearch(models.Model):
|
||||
domain="[('cutting_tool_type', '=', '夹头')]",
|
||||
string='适用夹头型号'
|
||||
)
|
||||
handle_clamping_range = fields.Float('夹持范围(mm)')
|
||||
handle_detection_accuracy = fields.Float('检测精度')
|
||||
handle_detection_hardness = fields.Char('检测硬度')
|
||||
handle_standard_speed = fields.Float('标准转速')
|
||||
handle_clamping_range = fields.Float('刀柄夹持范围(mm)')
|
||||
handle_detection_accuracy = fields.Float('刀柄检测精度')
|
||||
handle_detection_hardness = fields.Char('刀柄检测硬度')
|
||||
handle_standard_speed = fields.Float('刀柄标准转速')
|
||||
|
||||
# 夹头特有字段
|
||||
chuck_code = fields.Char('夹头编码', readonly=True)
|
||||
# chuck_name = fields.Char('夹头名称', required=True)
|
||||
chuck_accuracy = fields.Float('精度(mm)')
|
||||
chuck_accuracy = fields.Float('夹头精度(mm)')
|
||||
# 夹持直径min、夹持直径max、3D模型图
|
||||
chuck_clamping_diameter_min = fields.Float('夹持直径min')
|
||||
chuck_clamping_diameter_max = fields.Float('夹持直径max')
|
||||
chuck_diameter = fields.Float('外径(mm)')
|
||||
chuck_inner_diameter = fields.Float('内径(mm)')
|
||||
chuck_height = fields.Float('高度(mm)')
|
||||
chuck_nut = fields.Float('配对螺母(mm)')
|
||||
chuck_clamping_diameter_min = fields.Float('夹头夹持直径min(mm)')
|
||||
chuck_clamping_diameter_max = fields.Float('夹头夹持直径max(mm)')
|
||||
chuck_diameter = fields.Float('夹头外径(mm)')
|
||||
chuck_inner_diameter = fields.Float('夹头内径(mm)')
|
||||
chuck_height = fields.Float('夹头高度(mm)')
|
||||
chuck_nut = fields.Float('夹头配对螺母(mm)')
|
||||
mrs_cutting_tool_model_chuck_handle_model_ids = fields.Many2many(
|
||||
'sf.cutting.tool.model',
|
||||
relation='sf_tool_material_search_chuck_handle_rel',
|
||||
@@ -179,9 +276,9 @@ class SfToolMaterialSearch(models.Model):
|
||||
domain="[('cutting_tool_type', '=', '刀柄')]",
|
||||
string='适用刀柄型号'
|
||||
)
|
||||
chuck_clamping_range = fields.Float('夹持范围(mm)')
|
||||
chuck_feature = fields.Char('特性')
|
||||
image = fields.Binary('图片')
|
||||
chuck_clamping_range = fields.Float('夹头夹持范围(mm)')
|
||||
chuck_feature = fields.Char('夹头特性')
|
||||
image = fields.Binary('夹头图片')
|
||||
|
||||
# 数量、采购入库日期、采购批次、供应商、仓库名称、库区、库位、3D模型
|
||||
number = fields.Integer('数量')
|
||||
@@ -193,4 +290,3 @@ class SfToolMaterialSearch(models.Model):
|
||||
warehouse_area = fields.Char('库区')
|
||||
warehouse_location = fields.Char('库位')
|
||||
three_d_model = fields.Many2one('ir.attachment', '3D模型')
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" invisible="False"/>
|
||||
<field name="name" invisible="False" placeholder="请输入20字以内的名称"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="code" readonly="1"/>
|
||||
<field name="code" readonly="1" nolabel="True"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
|
||||
<field name="mrs_cutting_tool_integral_model_ids"
|
||||
@@ -674,7 +674,7 @@
|
||||
<group>
|
||||
<field name="current_state"/>
|
||||
<field name="thickness"/>
|
||||
<field name="max_life_span"/>
|
||||
<!-- <field name="max_life_span"/>-->
|
||||
<field name="used_value"/>
|
||||
<field name="tool_install_time"/>
|
||||
<field name="reason_application"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">sf.tool.material.search</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="刀具物料查询">
|
||||
<field name="sequence"/>
|
||||
<field name="sequence" invisible="True"/>
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
@@ -33,19 +33,19 @@
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_bar_ids" optional="hide"/>
|
||||
|
||||
<!-- <field name="integral_code" readonly="1"/> -->
|
||||
<field name="integral_total_length" optional="hide"/>
|
||||
<field name="integral_shank_length" optional="hide"/>
|
||||
<field name="integral_blade_length" optional="hide"/>
|
||||
<field name="integral_diameter" optional="hide"/>
|
||||
<field name="integral_blade_number" optional="hide"/>
|
||||
<field name="integral_front_angle" optional="hide"/>
|
||||
<field name="integral_rear_angle" optional="hide"/>
|
||||
<field name="integral_main_included_angle" optional="hide"/>
|
||||
<field name="integral_accuracy" optional="hide"/>
|
||||
<field name="integral_hardness" optional="hide"/>
|
||||
<field name="integral_coating_material" optional="hide"/>
|
||||
<field name="integral_nut" optional="hide"/>
|
||||
<field name="integral_scope" optional="hide"/>
|
||||
<!-- <field name="integral_total_length" optional="hide"/>-->
|
||||
<!-- <field name="integral_shank_length" optional="hide"/>-->
|
||||
<!-- <field name="integral_blade_length" optional="hide"/>-->
|
||||
<!-- <field name="integral_diameter" optional="hide"/>-->
|
||||
<!-- <field name="integral_blade_number" optional="hide"/>-->
|
||||
<!-- <field name="integral_front_angle" optional="hide"/>-->
|
||||
<!-- <field name="integral_rear_angle" optional="hide"/>-->
|
||||
<!-- <field name="integral_main_included_angle" optional="hide"/>-->
|
||||
<!-- <field name="integral_accuracy" optional="hide"/>-->
|
||||
<!-- <field name="integral_hardness" optional="hide"/>-->
|
||||
<!-- <field name="integral_coating_material" optional="hide"/>-->
|
||||
<!-- <field name="integral_nut" optional="hide"/>-->
|
||||
<!-- <field name="integral_scope" optional="hide"/>-->
|
||||
|
||||
<!-- <field name="bar_code" readonly="1"/> -->
|
||||
<field name="bar_c_diameter" optional="hide"/>
|
||||
@@ -134,13 +134,13 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="mrs_cutting_tool_material_name" invisible="1"/>
|
||||
<field name="sequence"/>
|
||||
<field name="sequence" invisible="True"/>
|
||||
<field name="code"/>
|
||||
<field name="mrs_cutting_tool_material_id"/>
|
||||
<field name="mrs_cutting_tool_type_id"/>
|
||||
<field name="mrs_machine_brand_id"/>
|
||||
<!-- <field name="mrs_materials_model_id" attrs="{'invisible':[('cutting_tool_type','=','整体式刀具')]}"/>-->
|
||||
<!-- <field name="mrs_cutting_tool_model_id"/> -->
|
||||
<field name="mrs_materials_model_id"/>
|
||||
<field name="mrs_cutting_tool_material_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" widget="image"/>
|
||||
@@ -168,65 +168,95 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="blade_code" invisible="True"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="blade_width"/>
|
||||
<field name="blade_height"/>
|
||||
<field name="blade_radius"/>
|
||||
<field name="blade_hardness"/>
|
||||
<field name="blade_accuracy"/>
|
||||
<field name="blade_coating_material_id"/>
|
||||
<field name="blade_length" string="长度L(mm)"/>
|
||||
<field name="blade_width" string="宽度D(mm)"/>
|
||||
<field name="blade_height" string="高度T(mm)"/>
|
||||
<field name="blade_radius" string="刀尖半径(mm)"/>
|
||||
<field name="blade_hardness" string="加工硬度"/>
|
||||
<field name="blade_accuracy" string="精度等级"/>
|
||||
<field name="blade_coating_material_id" string="涂层材质"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_bar_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="blade_top_angle"/>
|
||||
<field name="blade_front_angle"/>
|
||||
<field name="blade_rear_angle"/>
|
||||
<field name="blade_main_included_angle"/>
|
||||
<field name="blade_r_angle"/>
|
||||
<field name="blade_nut"/>
|
||||
<field name="blade_top_angle" string="顶角(°)"/>
|
||||
<field name="blade_front_angle" string="前角(°)"/>
|
||||
<field name="blade_rear_angle" string="后角(°)"/>
|
||||
<field name="blade_main_included_angle" string="主偏角(°)"/>
|
||||
<field name="blade_r_angle" string="R角(°)"/>
|
||||
<field name="blade_nut" string="配对螺母(mm)"/>
|
||||
<field name="mrs_cutting_tool_model_blade_cutter_pad_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<!-- -->
|
||||
<page string="整体式刀具信息" attrs="{'invisible': [('cutting_tool_type','!=','整体式刀具')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="integral_code" invisible="True"/>
|
||||
<field name="integral_total_length"/>
|
||||
<field name="integral_shank_length"/>
|
||||
<field name="integral_blade_length"/>
|
||||
<field name="integral_diameter"/>
|
||||
<field name="integral_blade_number"/>
|
||||
<field name="integral_accuracy"/>
|
||||
<field name="integral_total_length" string="总长度(mm)"/>
|
||||
<field name="integral_shank_length" string="柄部长度(mm)"/>
|
||||
<field name="integral_blade_length" string="刃部长度(mm)"/>
|
||||
<field name="integral_neck_length" string="颈部长度(mm)"/>
|
||||
<field name="integral_blade_tip_taper" string="刀尖锥度(°)"/>
|
||||
<field name="integral_blade_helix_angle" string="刃部螺旋角(°)"/>
|
||||
<field name="integral_blade_type" string="刃部类型"/>
|
||||
<field name="mrs_materials_model_id" string="刀具材质" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<label for="integral_run_out_accuracy_min" string="端跳精度:"/>
|
||||
<div class="test_model">
|
||||
<label for="integral_run_out_accuracy_min" string="最小(min)"/>
|
||||
<field name="integral_run_out_accuracy_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
<label for="integral_run_out_accuracy_max" string="最大(max)"/>
|
||||
<field name="integral_run_out_accuracy_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<span>(mm)&nbsp;</span>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="integral_front_angle"/>
|
||||
<field name="integral_rear_angle"/>
|
||||
<field name="integral_main_included_angle"/>
|
||||
<field name="integral_nut"/>
|
||||
<field name="integral_hardness"/>
|
||||
<field name="integral_coating_material"/>
|
||||
<field name="integral_scope"/>
|
||||
<field name="integral_blade_number" string="刃数(个)"/>
|
||||
<field name="integral_shank_diameter" string="柄部直径(mm)"/>
|
||||
<field name="integral_blade_diameter" string="刃部直径(mm)"/>
|
||||
<field name="integral_neck_diameter" string="颈部直径(mm)"/>
|
||||
<field name="integral_blade_tip_diameter" string="刀尖直径(mm)"/>
|
||||
<field name="integral_hardness" string="刀具硬度(HRC)"/>
|
||||
<field name="integral_coarse_medium_fine" string="粗/中/精" attrs="{'required': [('cutting_tool_type','=','整体式刀具')]}"/>
|
||||
<field name="integral_coating_material" string="涂层材质"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""/>
|
||||
</group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string=""/>
|
||||
</group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string=""/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string=""/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="刀杆信息" attrs="{'invisible': [('cutting_tool_type','!=','刀杆')]}">
|
||||
<group>
|
||||
<group>
|
||||
<field name="bar_code" invisible="True"/>
|
||||
<field name="bar_c_diameter"/>
|
||||
<field name="bar_total_length"/>
|
||||
<field name="bar_blade_number"/>
|
||||
<field name="bar_d_diameter"/>
|
||||
<field name="bar_scope"/>
|
||||
<field name="mrs_cutting_tool_model_bar_blade_ids" widget="many2many_tags"/>
|
||||
<field name="bar_c_diameter" string="C柄径(mm)"/>
|
||||
<field name="bar_total_length" string="L总长(mm)"/>
|
||||
<field name="bar_blade_number" string="刃数"/>
|
||||
<field name="bar_d_diameter" string="D刃径(mm)"/>
|
||||
<field name="bar_scope" string="适用范围"/>
|
||||
<field name="mrs_cutting_tool_model_bar_blade_ids" string="适用刀片型号" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bar_wrench"/>
|
||||
<field name="bar_screw"/>
|
||||
<field name="bar_radius"/>
|
||||
<field name="bar_accuracy"/>
|
||||
<field name="bar_hardness"/>
|
||||
<field name="bar_wrench" string="配对扳手(mm)"/>
|
||||
<field name="bar_screw" string="配备螺丝(mm)"/>
|
||||
<field name="bar_radius" string="刀尖圆角半径"/>
|
||||
<field name="bar_accuracy" string="精度等级"/>
|
||||
<field name="bar_hardness" string="硬度(°)"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -234,19 +264,19 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="pad_code" invisible="True"/>
|
||||
<field name="pad_c_diameter"/>
|
||||
<field name="pad_total_length"/>
|
||||
<field name="pad_blade_number"/>
|
||||
<field name="pad_d_diameter"/>
|
||||
<field name="pad_scope"/>
|
||||
<field name="mrs_cutting_tool_model_pad_blade_ids" widget="many2many_tags"/>
|
||||
<field name="pad_c_diameter" string="C柄径(mm)"/>
|
||||
<field name="pad_total_length" string="L总长(mm)"/>
|
||||
<field name="pad_blade_number" string="刃数"/>
|
||||
<field name="pad_d_diameter" string="D刃径(mm)"/>
|
||||
<field name="pad_scope" string="适用范围"/>
|
||||
<field name="mrs_cutting_tool_model_pad_blade_ids" string="适用刀片型号" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="pad_wrench"/>
|
||||
<field name="pad_screw"/>
|
||||
<field name="pad_radius"/>
|
||||
<field name="pad_accuracy"/>
|
||||
<field name="pad_hardness"/>
|
||||
<field name="pad_wrench" string="配对扳手(mm)"/>
|
||||
<field name="pad_screw" string="配备螺丝(mm)"/>
|
||||
<field name="pad_radius" string="刀尖圆角半径"/>
|
||||
<field name="pad_accuracy" string="精度等级"/>
|
||||
<field name="pad_hardness" string="硬度(°)"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -254,23 +284,25 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="handle_code" invisible="True"/>
|
||||
<field name="handle_diameter"/>
|
||||
<field name="handle_flange_length"/>
|
||||
<field name="handle_flange_diameter"/>
|
||||
<field name="handle_clamping_diameter_min"/>
|
||||
<field name="handle_clamping_diameter_max"/>
|
||||
<field name="handle_clamping_range"/>
|
||||
<field name="handle_detection_accuracy"/>
|
||||
<field name="handle_length" string="柄长L(mm)"/>
|
||||
<field name="handle_diameter" string="直径D(mm)"/>
|
||||
<field name="handle_flange_length" string="法兰柄长L1(mm)"/>
|
||||
<field name="handle_flange_diameter" string="法兰直径D1(mm)"/>
|
||||
<field name="handle_clamping_diameter_min" string="夹持直径min(mm)"/>
|
||||
<field name="handle_clamping_diameter_max" string="夹持直径max(mm)"/>
|
||||
<field name="handle_clamping_range" string="夹持范围(mm)"/>
|
||||
<field name="handle_detection_accuracy" string="检测精度"/>
|
||||
<field name="mrs_cutting_tool_model_handle_chuck_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="handle_jump_accuracy"/>
|
||||
<field name="handle_max_speed"/>
|
||||
<field name="handle_standard_speed"/>
|
||||
<field name="handle_weight"/>
|
||||
<field name="handle_body_accuracy"/>
|
||||
<field name="handle_nut"/>
|
||||
<field name="handle_detection_hardness"/>
|
||||
<field name="handle_jump_accuracy" string="径跳精度"/>
|
||||
<field name="handle_standard_speed" string="标准转速"/>
|
||||
<field name="handle_max_speed" string="最大转速n/min"/>
|
||||
<field name="handle_standard_speed" string=""/>
|
||||
<field name="handle_weight" string="重量(kg)"/>
|
||||
<field name="handle_body_accuracy" string="本体精度(mm)"/>
|
||||
<field name="handle_nut" string="配对螺母(mm)"/>
|
||||
<field name="handle_detection_hardness" string="检测硬度"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -278,19 +310,19 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="chuck_code" invisible="True"/>
|
||||
<field name="chuck_clamping_diameter_min"/>
|
||||
<field name="chuck_clamping_diameter_max"/>
|
||||
<field name="chuck_diameter"/>
|
||||
<field name="chuck_inner_diameter"/>
|
||||
<field name="chuck_feature"/>
|
||||
<field name="chuck_clamping_diameter_min" string="夹持直径min(mm)"/>
|
||||
<field name="chuck_clamping_diameter_max" string="夹持直径max(mm)"/>
|
||||
<field name="chuck_diameter" string="外径(mm)"/>
|
||||
<field name="chuck_inner_diameter" string="内径(mm)"/>
|
||||
<field name="chuck_feature" string="特性"/>
|
||||
<field name="mrs_cutting_tool_model_chuck_handle_model_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="chuck_accuracy"/>
|
||||
<field name="chuck_height"/>
|
||||
<field name="chuck_nut"/>
|
||||
<field name="chuck_clamping_range"/>
|
||||
<field name="image"/>
|
||||
<field name="chuck_accuracy" string="精度(mm)"/>
|
||||
<field name="chuck_height" string="高度(mm)"/>
|
||||
<field name="chuck_nut" string="配对螺母(mm)"/>
|
||||
<field name="chuck_clamping_range" string="夹持范围(mm)"/>
|
||||
<field name="image" string="图片"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -91,7 +91,6 @@ class ToolTransferRequestInformation(models.TransientModel):
|
||||
cutter_spacing_code = fields.Char(string='刀位号', readonly=True)
|
||||
functional_tool_code = fields.Char(string='功能刀具编码', readonly=True)
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具名称', readonly=True)
|
||||
# todo 功能刀具类型为 Many2one
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||
transfer_target = fields.Selection([('机台', '机台'),
|
||||
('线边刀库', '线边刀库'),
|
||||
@@ -99,13 +98,13 @@ class ToolTransferRequestInformation(models.TransientModel):
|
||||
|
||||
new_cnc_machine_table_id = fields.Many2one('sf.machine_tool', string='机床名称')
|
||||
new_machine_tool_code = fields.Char(string='机床号')
|
||||
new_cutter_spacing_code = fields.Char(string='刀位号')
|
||||
new_cutter_spacing_code = fields.Char(string='目标刀位号')
|
||||
|
||||
magazine_tool_warehouse_district = fields.Char(string='库区')
|
||||
magazine_tool_warehouse_position = fields.Char(string='库位')
|
||||
magazine_tool_warehouse_district = fields.Char(string='线边刀库库区')
|
||||
magazine_tool_warehouse_position = fields.Char(string='线边刀库库位')
|
||||
|
||||
tool_room_warehouse_district = fields.Char(string='库区')
|
||||
tool_room_warehouse_position = fields.Char(string='库位')
|
||||
tool_room_warehouse_district = fields.Char(string='刀具房库区')
|
||||
tool_room_warehouse_position = fields.Char(string='刀具房库位')
|
||||
|
||||
def tool_transfer_apply(self):
|
||||
"""
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<group>
|
||||
<field name="new_cnc_machine_table_id" attrs="{'invisible': [('transfer_target', '!=', '机台')]}"/>
|
||||
<field name="new_machine_tool_code" attrs="{'invisible': [('transfer_target', '!=', '机台')]}"/>
|
||||
<field name="new_cutter_spacing_code" attrs="{'invisible': [('transfer_target', '!=', '机台')]}"/>
|
||||
<field name="new_cutter_spacing_code" string="刀位号" attrs="{'invisible': [('transfer_target', '!=', '机台')]}"/>
|
||||
<field name="magazine_tool_warehouse_district" attrs="{'invisible': [('transfer_target', '!=', '线边刀库')]}"/>
|
||||
<field name="magazine_tool_warehouse_position" attrs="{'invisible': [('transfer_target', '!=', '线边刀库')]}"/>
|
||||
<field name="tool_room_warehouse_district" attrs="{'invisible': [('transfer_target', '!=', '刀具房')]}"/>
|
||||
|
||||
@@ -10,7 +10,7 @@ class SfLocation(models.Model):
|
||||
|
||||
# 重写字段定义
|
||||
name = fields.Char('Location Name', required=True, size=20)
|
||||
barcode = fields.Char('Barcode', copy=False, required=True, size=15)
|
||||
barcode = fields.Char('Barcode', copy=False, size=15)
|
||||
|
||||
# 仓库类别(selection:库区、库位、货位)
|
||||
location_type = fields.Selection([
|
||||
@@ -34,14 +34,14 @@ class SfLocation(models.Model):
|
||||
# 产品类别 (关联:product.category)
|
||||
product_type = fields.Many2many('product.category', string='产品类别')
|
||||
# 货架独有字段:通道、方向、货架高度(m)、货架层数、层数容量
|
||||
channel = fields.Char(string='通道', required=True)
|
||||
channel = fields.Char(string='通道')
|
||||
direction = fields.Selection([
|
||||
('R', 'R'),
|
||||
('L', 'L')
|
||||
], string='方向', required=True)
|
||||
], string='方向')
|
||||
shelf_height = fields.Float(string='货架高度(m)')
|
||||
shelf_layer = fields.Integer(string='货架层数', required=True)
|
||||
layer_capacity = fields.Integer(string='层数容量', required=True)
|
||||
shelf_layer = fields.Integer(string='货架层数')
|
||||
layer_capacity = fields.Integer(string='层数容量')
|
||||
|
||||
# 货位独有字段:货位状态、产品(关联产品对象)、产品序列号(关联产品序列号对象)
|
||||
location_status = fields.Selection([
|
||||
@@ -54,9 +54,9 @@ class SfLocation(models.Model):
|
||||
product_sn_id = fields.Many2one('stock.lot', string='产品序列号')
|
||||
# time_test = fields.Char(string='time')
|
||||
# 添加SQL约束
|
||||
_sql_constraints = [
|
||||
('name_uniq', 'unique(name)', '位置名称必须唯一!'),
|
||||
]
|
||||
# _sql_constraints = [
|
||||
# ('name_uniq', 'unique(name)', '位置名称必须唯一!'),
|
||||
# ]
|
||||
|
||||
hide_location_type = fields.Boolean(compute='_compute_hide_what', string='隐藏仓库')
|
||||
hide_area = fields.Boolean(compute='_compute_hide_what', string='隐藏库区')
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"description": "3D模型展示模块(限odoo16)",
|
||||
"author": "Van",
|
||||
"website": "https://jikimo.com",
|
||||
"license": "LGPL-3",
|
||||
"category": "Tutorials",
|
||||
"version": "16.0.0.1",
|
||||
"depends": ['web'],
|
||||
@@ -18,5 +19,6 @@
|
||||
'web.assets_backend': [
|
||||
'web_widget_model_viewer/static/src/js/*',
|
||||
],
|
||||
}
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
'jikimo_sfs/zpl_print/static/src/scss/changes.scss'
|
||||
]
|
||||
},
|
||||
'license': 'LGPL-3',
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'auto_install': False,
|
||||
|
||||
Reference in New Issue
Block a user