Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化刀具基本参数同步
# Conflicts: # sf_dlm_management/views/product_template_management_view.xml
This commit is contained in:
@@ -132,11 +132,11 @@ td.o_required_modifier {
|
|||||||
//font-weight: bold;
|
//font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-truncate {
|
//.text-truncate {
|
||||||
overflow: unset !important;
|
// overflow: unset !important;
|
||||||
text-overflow: unset !important;
|
// text-overflow: unset !important;
|
||||||
white-space: nowrap!important;
|
// white-space: nowrap!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) {
|
.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;
|
white-space: nowrap !important;
|
||||||
@@ -383,7 +383,9 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.oe_kanban_details li.o_text_overflow {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.o_stock_kanban .o_kanban_card_content {
|
.o_stock_kanban .o_kanban_card_content {
|
||||||
.row {
|
.row {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -412,3 +414,18 @@ div:has(.o_required_modifier) > label::before {
|
|||||||
grid-template-columns: auto;
|
grid-template-columns: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置所有表格序号列padding为0
|
||||||
|
.o_form_view .o_notebook > .tab-content > .tab-pane > :first-child:not(.o_group) .o_field_x2many.o_field_x2many_list tr > :first-child, .o_form_view .o_notebook > .tab-content > .tab-pane > :first-child.o_invisible_modifier + .o_field_widget .o_field_x2many.o_field_x2many_list tr > :first-child {
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置剩余number类型数据表格列 left
|
||||||
|
.o_list_renderer .o_list_table thead .o_list_number_th {
|
||||||
|
text-align:left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.o_list_renderer .flex-row-reverse {
|
||||||
|
flex-direction: unset!important;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.row_no {
|
.row_no {
|
||||||
width: 3.2% !important;
|
width: 35px !important;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
'views/tool_basic_param.xml',
|
'views/tool_basic_param.xml',
|
||||||
'views/tool_menu.xml',
|
'views/tool_menu.xml',
|
||||||
'views/menu_fixture_view.xml',
|
'views/menu_fixture_view.xml',
|
||||||
|
'views/change_base_view.xml',
|
||||||
|
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class MachineTool(models.Model):
|
|||||||
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
||||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
|
||||||
default='正常', string="机床状态")
|
default='正常', string="机床状态")
|
||||||
# 0606新增字段
|
# 0606新增字段
|
||||||
machine_tool_picture = fields.Binary('图片')
|
machine_tool_picture = fields.Binary('图片')
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class BasicParametersFixture(models.Model):
|
|||||||
weight = fields.Float('重量(mm)', digits=(16, 2))
|
weight = fields.Float('重量(mm)', digits=(16, 2))
|
||||||
orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2))
|
orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2))
|
||||||
clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2))
|
clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2))
|
||||||
clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='夹装单元数')
|
clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='装夹单元数')
|
||||||
chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2))
|
chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2))
|
||||||
repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20)
|
repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20)
|
||||||
boolean_transposing_hole = fields.Boolean('是否有转位孔')
|
boolean_transposing_hole = fields.Boolean('是否有转位孔')
|
||||||
@@ -66,3 +66,176 @@ class BasicParametersFixture(models.Model):
|
|||||||
# '三爪卡盘' 字段
|
# '三爪卡盘' 字段
|
||||||
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||||
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
def _json_zero_chuck_param(self, obj):
|
||||||
|
zero_chuck_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'diameter': obj['diameter'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'orientation_dish_diameter': obj['orientation_dish_diameter'],
|
||||||
|
'clamping_diameter': obj['clamping_diameter'],
|
||||||
|
'clamping_num': obj['clamping_num'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'repeated_positioning_accuracy': obj['repeated_positioning_accuracy'],
|
||||||
|
'boolean_transposing_hole': obj['boolean_transposing_hole'],
|
||||||
|
'unlocking_method': obj['unlocking_method'],
|
||||||
|
'boolean_chip_blowing_function': obj['boolean_chip_blowing_function'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'machine_tool_type_id': obj['machine_tool_type_id'],
|
||||||
|
})
|
||||||
|
return zero_chuck_param_str
|
||||||
|
|
||||||
|
def _json_zero_tray_param(self, obj):
|
||||||
|
zero_tray_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'diameter': obj['diameter'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'clamping_diameter': obj['clamping_diameter'],
|
||||||
|
'connector_diameter': obj['connector_diameter'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'repeated_positioning_accuracy': obj['repeated_positioning_accuracy'],
|
||||||
|
'boolean_chip_blowing_function': obj['boolean_chip_blowing_function'],
|
||||||
|
'way_to_install': obj['way_to_install'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
})
|
||||||
|
return zero_tray_param_str
|
||||||
|
|
||||||
|
def _json_pneumatic_fixture_param(self, obj):
|
||||||
|
pneumatic_fixture_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'gripper_length_min': obj['gripper_length_min'],
|
||||||
|
'gripper_width_min': obj['gripper_width_min'],
|
||||||
|
'gripper_height_min': obj['gripper_height_min'],
|
||||||
|
'gripper_diameter_min': obj['gripper_diameter_min'],
|
||||||
|
'gripper_length_max': obj['gripper_length_max'],
|
||||||
|
'gripper_width_max': obj['gripper_width_max'],
|
||||||
|
'gripper_height_max': obj['gripper_height_max'],
|
||||||
|
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'rated_air_pressure': obj['rated_air_pressure'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
})
|
||||||
|
return pneumatic_fixture_param_str
|
||||||
|
|
||||||
|
def _json_jaw_vice_fixture_param(self, obj):
|
||||||
|
jaw_vice_fixture_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'gripper_length_min': obj['gripper_length_min'],
|
||||||
|
'gripper_width_min': obj['gripper_width_min'],
|
||||||
|
'gripper_height_min': obj['gripper_height_min'],
|
||||||
|
'gripper_diameter_min': obj['gripper_diameter_min'],
|
||||||
|
'gripper_length_max': obj['gripper_length_max'],
|
||||||
|
'gripper_width_max': obj['gripper_width_max'],
|
||||||
|
'gripper_height_max': obj['gripper_height_max'],
|
||||||
|
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'transverse_groove': obj['transverse_groove'],
|
||||||
|
'longitudinal_fitting_groove': obj['longitudinal_fitting_groove'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
})
|
||||||
|
return jaw_vice_fixture_param_str
|
||||||
|
|
||||||
|
def _json_magnet_fixture_param(self, obj):
|
||||||
|
magnet_fixture_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'height_tolerance_value': obj['height_tolerance_value'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'gripper_length_min': obj['gripper_length_min'],
|
||||||
|
'gripper_width_min': obj['gripper_width_min'],
|
||||||
|
'gripper_height_min': obj['gripper_height_min'],
|
||||||
|
'gripper_diameter_min': obj['gripper_diameter_min'],
|
||||||
|
'gripper_length_max': obj['gripper_length_max'],
|
||||||
|
'gripper_width_max': obj['gripper_width_max'],
|
||||||
|
'gripper_height_max': obj['gripper_height_max'],
|
||||||
|
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||||
|
'rated_adsorption_force': obj['rated_adsorption_force'],
|
||||||
|
'magnetic_field_height': obj['magnetic_field_height'],
|
||||||
|
'magnetic_pole_plate_grinding_allowance': obj['magnetic_pole_plate_grinding_allowance'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'interface_materials_model_id': obj['interface_materials_model_id'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
})
|
||||||
|
return magnet_fixture_param_str
|
||||||
|
|
||||||
|
def _json_adapter_board_fixture_param(self, obj):
|
||||||
|
adapter_board_fixture_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'gripper_length_min': obj['gripper_length_min'],
|
||||||
|
'gripper_width_min': obj['gripper_width_min'],
|
||||||
|
'gripper_height_min': obj['gripper_height_min'],
|
||||||
|
'gripper_diameter_min': obj['gripper_diameter_min'],
|
||||||
|
'gripper_length_max': obj['gripper_length_max'],
|
||||||
|
'gripper_width_max': obj['gripper_width_max'],
|
||||||
|
'gripper_height_max': obj['gripper_height_max'],
|
||||||
|
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'screw_size': obj['screw_size'],
|
||||||
|
'via_hole_diameter': obj['via_hole_diameter'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
})
|
||||||
|
return adapter_board_fixture_param_str
|
||||||
|
|
||||||
|
def _json_scroll_chuck_param(self, obj):
|
||||||
|
scroll_chuck_param_str = (0, '', {
|
||||||
|
'name': obj['name'],
|
||||||
|
'length': obj['length'],
|
||||||
|
'width': obj['width'],
|
||||||
|
'height': obj['height'],
|
||||||
|
'diameter': obj['diameter'],
|
||||||
|
'weight': obj['weight'],
|
||||||
|
'gripper_length_min': obj['gripper_length_min'],
|
||||||
|
'gripper_width_min': obj['gripper_width_min'],
|
||||||
|
'gripper_height_min': obj['gripper_height_min'],
|
||||||
|
'gripper_diameter_min': obj['gripper_diameter_min'],
|
||||||
|
'gripper_length_max': obj['gripper_length_max'],
|
||||||
|
'gripper_width_max': obj['gripper_width_max'],
|
||||||
|
'gripper_height_max': obj['gripper_height_max'],
|
||||||
|
'gripper_diameter_max': obj['gripper_diameter_max'],
|
||||||
|
'chucking_power_max': obj['chucking_power_max'],
|
||||||
|
'carrying_capacity_max': obj['carrying_capacity_max'],
|
||||||
|
'materials_model_id': obj['materials_model_id'],
|
||||||
|
'rigidity': obj['rigidity'],
|
||||||
|
'mounting_hole_depth': obj['mounting_hole_depth'],
|
||||||
|
'centering_diameter': obj['centering_diameter'],
|
||||||
|
'type_of_drive': obj['type_of_drive'],
|
||||||
|
})
|
||||||
|
return scroll_chuck_param_str
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ class FixtureModel(models.Model):
|
|||||||
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True)
|
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True)
|
||||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
||||||
model_file = fields.Binary(string="3D模型图")
|
model_file = fields.Binary(string="3D模型图")
|
||||||
|
status = fields.Boolean('状态')
|
||||||
active = fields.Boolean('有效', default=False)
|
active = fields.Boolean('有效', default=False)
|
||||||
|
|
||||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<record id="group_plan_director" model="res.groups">
|
<record id="group_plan_director" model="res.groups">
|
||||||
<field name="name">计划总监</field>
|
<field name="name">计划总监</field>
|
||||||
<field name="category_id" ref="module_category_plan"/>
|
<field name="category_id" ref="module_category_plan"/>
|
||||||
<!-- <field name="implied_ids" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>-->
|
<field name="implied_ids" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="group_purchase" model="res.groups">
|
<record id="group_purchase" model="res.groups">
|
||||||
|
|||||||
15
sf_base/views/change_base_view.xml
Normal file
15
sf_base/views/change_base_view.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
<record model="ir.ui.view" id="sf_base_res_partner_kanban_view">
|
||||||
|
<field name="name">sf.base.res.partner.kanban</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//kanban//templates//t//div//div//div//ul//li[last()]" position="after">
|
||||||
|
<li t-if="record.vat.raw_value" class="o_text_overflow"><field name="vat"/></li>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
35
sf_dlm_management/static/js/changeCss.js
Normal file
35
sf_dlm_management/static/js/changeCss.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
// 因为表格可以拖动设置宽度,所以需要用js设置初始宽度
|
||||||
|
function setBasicParamTableWidth() {
|
||||||
|
|
||||||
|
|
||||||
|
const basicParamDom = $('.fixTableCss')
|
||||||
|
let dom = []
|
||||||
|
try {
|
||||||
|
dom = basicParamDom.find('table').find('thead').children().children()
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
dom = []
|
||||||
|
}
|
||||||
|
if (!dom) return
|
||||||
|
dom.each(function () {
|
||||||
|
if ($(this).hasClass('row_no') >= 0) { // 序号列
|
||||||
|
// 不设置 通过css设置
|
||||||
|
}
|
||||||
|
const text = $(this).text()
|
||||||
|
$(this).find('span').removeClass('text-truncate')
|
||||||
|
if (text.length > 5) {
|
||||||
|
$(this).width('150px')
|
||||||
|
} else if (text.length == 5) {
|
||||||
|
$(this).width('100px')
|
||||||
|
} else if (text.length == 4) {
|
||||||
|
$(this).width('80px')
|
||||||
|
} else if (text.length == 3) {
|
||||||
|
$(this).width('65px')
|
||||||
|
} else if (text.length == 2) {
|
||||||
|
$(this).width('50px')
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(setBasicParamTableWidth, 500)
|
||||||
@@ -41,8 +41,10 @@
|
|||||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
domain="[('fixture_material_id','=',fixture_material_id)]"/>
|
||||||
|
<field name="specification_fixture_id" string="规格" placeholder="请选择"
|
||||||
|
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||||
|
domain="[('fixture_model_id','=',fixture_model_id)]"/>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<xpath expr="//label[@for='volume']" position="before">
|
<xpath expr="//label[@for='volume']" position="before">
|
||||||
<label for="length" string="尺寸"
|
<label for="length" string="尺寸"
|
||||||
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
|
||||||
@@ -86,8 +88,7 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
||||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
|
||||||
<field name="name">product.template.only.form.inherit.sf</field>
|
<field name="name">product.template.only.form.inherit.sf</field>
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||||
@@ -98,7 +99,15 @@
|
|||||||
<field name="default_code" position="replace">
|
<field name="default_code" position="replace">
|
||||||
<field name='default_code' invisible="1"/>
|
<field name='default_code' invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//page[@name='variants']" position="before">
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||||
|
<field name="name">product.template.only.form.inherit.sf</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="sf_dlm_management.view_sale_product_template_form_inherit_sf"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//page[1]" position="after">
|
||||||
<page string="刀具物料参数"
|
<page string="刀具物料参数"
|
||||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('id', '!=', False)]}">
|
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('id', '!=', False)]}">
|
||||||
<group>
|
<group>
|
||||||
@@ -413,25 +422,17 @@
|
|||||||
<page string="切削速度Vc"
|
<page string="切削速度Vc"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||||
<field name="cutting_speed_ids" string="" widget="one2many"
|
<field name="cutting_speed_ids" string="" widget="one2many"
|
||||||
attrs="{'readonly': [('id', '!=', False)]}">
|
attrs="{'readonly': [('id', '!=', False)]}" class="fixTableCss">
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<!-- <field name="order"/>-->
|
|
||||||
<field name="execution_standard_id"/>
|
<field name="execution_standard_id"/>
|
||||||
<field name="material_code"/>
|
<field name="material_code"/>
|
||||||
<!-- <field name="material_id"/>-->
|
|
||||||
<field name="material_grade"/>
|
<field name="material_grade"/>
|
||||||
<field name="tensile_strength"/>
|
<field name="tensile_strength"/>
|
||||||
<field name="hardness"/>
|
<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"/>
|
<field name="application"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
<script src="/sf_dlm_management/static/js/changeCss.js"></script>
|
||||||
</page>
|
</page>
|
||||||
<page string="每齿走刀量fz"
|
<page string="每齿走刀量fz"
|
||||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}">
|
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}">
|
||||||
@@ -449,64 +450,106 @@
|
|||||||
</notebook>
|
</notebook>
|
||||||
</page>
|
</page>
|
||||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘","零点托盘"))]}'>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="brand_id"/>
|
<field name="brand_id" placeholder="请选择"/>
|
||||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"/>
|
<field name="multi_mounting_type_id" placeholder="请选择"/>
|
||||||
<label for="tool_length" string="尺寸(mm)"/>
|
<field name="length" string="长度(mm)"/>
|
||||||
<div class="o_address_format">
|
<field name="width" string="宽度(mm)"/>
|
||||||
<label for="tool_length" string="长"/>
|
<field name="height" string="高度(mm)"/>
|
||||||
<field name="tool_length" class="o_address_zip"
|
<field name="height_tolerance_value"
|
||||||
options="{'format': false}"/>
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||||
<!-- <span>&nbsp;</span>-->
|
<field name="diameter"
|
||||||
<label for="tool_width" string="宽"/>
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘'])]}"/>
|
||||||
<field name="tool_width" class="o_address_zip"
|
<field name="weight"/>
|
||||||
options="{'format': false}"/>
|
<field name="chucking_power_max"
|
||||||
<!-- <span>&nbsp;</span>-->
|
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
||||||
<label for="tool_height" string="高"/>
|
<field name="carrying_capacity_max"/>
|
||||||
<field name="tool_height" class="o_address_zip"
|
<field name="rigidity"/>
|
||||||
options="{'format': false}"/>
|
|
||||||
</div>
|
|
||||||
<field name="tool_weight"></field>
|
|
||||||
<label for="fixture_clamp_workpiece_length_max" string="夹持工件最大尺寸(mm)"
|
|
||||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'/>
|
|
||||||
<div class="o_address_format"
|
|
||||||
attrs='{"invisible": [("fixture_material_type","in",("零点卡盘","零点托盘"))]}'>
|
|
||||||
<label for="fixture_clamp_workpiece_length_max" string="长"/>
|
|
||||||
<field name="fixture_clamp_workpiece_length_max" class="o_address_zip"
|
|
||||||
options="{'format': false}"
|
|
||||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
|
||||||
<!-- <span>&nbsp;</span>-->
|
|
||||||
<label for="fixture_clamp_workpiece_width_max" string="宽"/>
|
|
||||||
<field name="fixture_clamp_workpiece_width_max" class="o_address_zip"
|
|
||||||
options="{'format': false}"
|
|
||||||
attrs="{'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
|
||||||
<!-- <span>&nbsp;</span>-->
|
|
||||||
<label for="fixture_clamp_workpiece_height_max" string="高"/>
|
|
||||||
<field name="fixture_clamp_workpiece_height_max" class="o_address_zip"
|
|
||||||
options="{'format': false}"
|
|
||||||
attrs="{'required': [('fixture_material_type', 'in',('气动托盘','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
|
||||||
</div>
|
|
||||||
<field name="fixture_clamp_workpiece_diameter_max"
|
|
||||||
attrs="{'invisible': [('fixture_material_type','in',('零点卡盘','零点托盘'))],'required': [('fixture_material_type', 'in',('气动夹具','转接板(锁板)夹具','磁吸夹具','虎钳夹具'))]}"/>
|
|
||||||
<field name="fixture_maximum_carrying_weight"></field>
|
|
||||||
<field name="fixture_maximum_clamping_force"></field>
|
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
<label for="gripper_length_min" string="夹持工件最小尺寸"
|
||||||
<field name="fixture_clamping_way"
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
<div class="o_address_format"
|
||||||
<field name="fixture_port_type"
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
<label for="gripper_length_min" string="长"/>
|
||||||
<field name="fixture_through_hole_size"
|
<field name="gripper_length_min" class="o_address_zip"/>
|
||||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
<span>&nbsp;</span>
|
||||||
<field name="fixture_screw_size"
|
<label for="gripper_width_min" string="宽"/>
|
||||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
<field name="gripper_width_min" class="o_address_zip"/>
|
||||||
<field name="fixture_driving_way"
|
<span>&nbsp;</span>
|
||||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘","零点托盘"))]}'/>
|
<label for="gripper_height_min" string="高"/>
|
||||||
<field name="fixture_apply_machine_tool_type_ids" options="{'no_create': True}"
|
<field name="gripper_height_min" class="o_address_zip"/>
|
||||||
widget="many2many_tags"
|
</div>
|
||||||
attrs='{"invisible": [("fixture_material_type","not in",("零点卡盘","零点托盘"))]}'/>
|
<label for="gripper_length_max" string="夹持工件最大尺寸"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||||
|
<div class="o_address_format"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||||
|
<label for="gripper_length_max" string="长"/>
|
||||||
|
<field name="gripper_length_max" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="gripper_width_max" string="宽"/>
|
||||||
|
<field name="gripper_width_max" class="o_address_zip"/>
|
||||||
|
<span>&nbsp;</span>
|
||||||
|
<label for="gripper_width_max" string="高"/>
|
||||||
|
<field name="gripper_width_max" class="o_address_zip"/>
|
||||||
|
</div>
|
||||||
|
<field name="gripper_diameter_min" string="夹持工件最小直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||||
|
<field name="gripper_diameter_max" string="夹持工件最大直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||||
|
<field name="clamping_diameter" string="装夹直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||||
|
<field name="clamping_num" placeholder="请选择" string="装夹单元数"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', '!=', '零点卡盘')]}"/>
|
||||||
|
<field name="repeated_positioning_accuracy" placeholder="请输入重复定位孔精度"
|
||||||
|
string="重复定位精度(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||||
|
<field name="orientation_dish_diameter" string="定位盘直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||||
|
<field name="boolean_transposing_hole" string="是否有转位孔"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||||
|
<field name="connector_diameter" placeholder="请选择" string="连接头直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘'])]}"/>
|
||||||
|
<field name="way_to_install" placeholder="请选择" string="安装方式"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘'])]}"/>
|
||||||
|
<field name="rated_air_pressure" string="额定气压(Mpa)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具'])]}"/>
|
||||||
|
|
||||||
|
<field name="transverse_groove" string="横向配合槽n(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||||
|
<field name="longitudinal_fitting_groove" string="纵向配合槽l(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['虎钳夹具'])]}"/>
|
||||||
|
|
||||||
|
<field name="rated_adsorption_force" string="额定吸附力(N/cm²)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||||
|
<field name="magnetic_field_height" string="磁场高度(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||||
|
<field name="magnetic_pole_plate_grinding_allowance" string="磁极板磨削余量(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||||
|
|
||||||
|
<field name="screw_size" string="螺牙大小(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['转接板(锁板)夹具'])]}"/>
|
||||||
|
<field name="via_hole_diameter" string="过孔直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['转接板(锁板)夹具'])]}"/>
|
||||||
|
|
||||||
|
<field name="mounting_hole_depth" string="安装孔深度(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['三爪卡盘'])]}"/>
|
||||||
|
<field name="centering_diameter" string="定心直径(mm)"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['三爪卡盘'])]}"/>
|
||||||
|
|
||||||
|
<field name="boolean_chip_blowing_function" string="是否有吹屑功能"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘','零点托盘'])]}"/>
|
||||||
|
<field name="materials_model_id" placeholder="请选择"/>
|
||||||
|
<field name="interface_materials_model_id" placeholder="请选择" string="接口类型"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具'])]}"/>
|
||||||
|
<field name="type_of_drive" placeholder="请选择" string="驱动方式"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点托盘','气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||||
|
<field name="unlocking_method" string="解锁方式" placeholder="请选择"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||||
|
<field name="machine_tool_type_id" string="适用机床型号" placeholder="请选择"
|
||||||
|
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘'])]}"/>
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
@@ -29,44 +29,44 @@
|
|||||||
<field name="spindle_speed"/>
|
<field name="spindle_speed"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string='刀位统计'>
|
<!-- <group string='刀位统计'> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num_process_time1"/>
|
<!-- <field name="tool_num_process_time1"/> -->
|
||||||
<field name="tool_num_process_time5"/>
|
<!-- <field name="tool_num_process_time5"/> -->
|
||||||
<field name="tool_num_process_time9"/>
|
<!-- <field name="tool_num_process_time9"/> -->
|
||||||
<field name="tool_num_process_time13"/>
|
<!-- <field name="tool_num_process_time13"/> -->
|
||||||
<field name="tool_num_process_time17"/>
|
<!-- <field name="tool_num_process_time17"/> -->
|
||||||
<field name="tool_num_process_time21"/>
|
<!-- <field name="tool_num_process_time21"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num_process_time2"/>
|
<!-- <field name="tool_num_process_time2"/> -->
|
||||||
<field name="tool_num_process_time6"/>
|
<!-- <field name="tool_num_process_time6"/> -->
|
||||||
<field name="tool_num_process_time10"/>
|
<!-- <field name="tool_num_process_time10"/> -->
|
||||||
<field name="tool_num_process_time14"/>
|
<!-- <field name="tool_num_process_time14"/> -->
|
||||||
<field name="tool_num_process_time18"/>
|
<!-- <field name="tool_num_process_time18"/> -->
|
||||||
<field name="tool_num_process_time22"/>
|
<!-- <field name="tool_num_process_time22"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num_process_time3"/>
|
<!-- <field name="tool_num_process_time3"/> -->
|
||||||
<field name="tool_num_process_time7"/>
|
<!-- <field name="tool_num_process_time7"/> -->
|
||||||
<field name="tool_num_process_time11"/>
|
<!-- <field name="tool_num_process_time11"/> -->
|
||||||
<field name="tool_num_process_time15"/>
|
<!-- <field name="tool_num_process_time15"/> -->
|
||||||
<field name="tool_num_process_time19"/>
|
<!-- <field name="tool_num_process_time19"/> -->
|
||||||
<field name="tool_num_process_time23"/>
|
<!-- <field name="tool_num_process_time23"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num_process_time4"/>
|
<!-- <field name="tool_num_process_time4"/> -->
|
||||||
<field name="tool_num_process_time8"/>
|
<!-- <field name="tool_num_process_time8"/> -->
|
||||||
<field name="tool_num_process_time12"/>
|
<!-- <field name="tool_num_process_time12"/> -->
|
||||||
<field name="tool_num_process_time16"/>
|
<!-- <field name="tool_num_process_time16"/> -->
|
||||||
<field name="tool_num_process_time20"/>
|
<!-- <field name="tool_num_process_time20"/> -->
|
||||||
<field name="tool_num_process_time24"/>
|
<!-- <field name="tool_num_process_time24"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
|
|
||||||
<!-- <div class="o_address_format"> -->
|
<!-- <div class="o_address_format"> -->
|
||||||
<!-- <label for="tool_num_process_time1" string="刀位1"/> -->
|
<!-- <label for="tool_num_process_time1" string="刀位1"/> -->
|
||||||
@@ -216,46 +216,46 @@
|
|||||||
</group>
|
</group>
|
||||||
<!-- </group> -->
|
<!-- </group> -->
|
||||||
</page>
|
</page>
|
||||||
<page string="刀位配置">
|
<!-- <page string="刀位配置"> -->
|
||||||
<group string="刀位配置">
|
<!-- <group string="刀位配置"> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num1"/>
|
<!-- <field name="tool_num1"/> -->
|
||||||
<field name="tool_num5"/>
|
<!-- <field name="tool_num5"/> -->
|
||||||
<field name="tool_num9"/>
|
<!-- <field name="tool_num9"/> -->
|
||||||
<field name="tool_num13"/>
|
<!-- <field name="tool_num13"/> -->
|
||||||
<field name="tool_num17"/>
|
<!-- <field name="tool_num17"/> -->
|
||||||
<field name="tool_num21"/>
|
<!-- <field name="tool_num21"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num2"/>
|
<!-- <field name="tool_num2"/> -->
|
||||||
<field name="tool_num6"/>
|
<!-- <field name="tool_num6"/> -->
|
||||||
<field name="tool_num10"/>
|
<!-- <field name="tool_num10"/> -->
|
||||||
<field name="tool_num14"/>
|
<!-- <field name="tool_num14"/> -->
|
||||||
<field name="tool_num18"/>
|
<!-- <field name="tool_num18"/> -->
|
||||||
<field name="tool_num22"/>
|
<!-- <field name="tool_num22"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num3"/>
|
<!-- <field name="tool_num3"/> -->
|
||||||
<field name="tool_num7"/>
|
<!-- <field name="tool_num7"/> -->
|
||||||
<field name="tool_num11"/>
|
<!-- <field name="tool_num11"/> -->
|
||||||
<field name="tool_num15"/>
|
<!-- <field name="tool_num15"/> -->
|
||||||
<field name="tool_num19"/>
|
<!-- <field name="tool_num19"/> -->
|
||||||
<field name="tool_num23"/>
|
<!-- <field name="tool_num23"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
<group>
|
<!-- <group> -->
|
||||||
<field name="tool_num4"/>
|
<!-- <field name="tool_num4"/> -->
|
||||||
<field name="tool_num8"/>
|
<!-- <field name="tool_num8"/> -->
|
||||||
<field name="tool_num12"/>
|
<!-- <field name="tool_num12"/> -->
|
||||||
<field name="tool_num16"/>
|
<!-- <field name="tool_num16"/> -->
|
||||||
<field name="tool_num20"/>
|
<!-- <field name="tool_num20"/> -->
|
||||||
<field name="tool_num24"/>
|
<!-- <field name="tool_num24"/> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</group>
|
<!-- </group> -->
|
||||||
</page>
|
<!-- </page> -->
|
||||||
<!-- </notebook> -->
|
<!-- </notebook> -->
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
'data': [
|
'data': [
|
||||||
'security/group_security.xml',
|
'security/group_security.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
'security/ir_rule_data.xml',
|
||||||
'views/maintenance_logs_views.xml',
|
'views/maintenance_logs_views.xml',
|
||||||
'views/maintenance_views.xml',
|
'views/maintenance_views.xml',
|
||||||
'views/equipment_maintenance_standards_views.xml',
|
'views/equipment_maintenance_standards_views.xml',
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
record.equipment_type = record.category_id.equipment_type
|
record.equipment_type = record.category_id.equipment_type
|
||||||
|
|
||||||
code = fields.Char('行业编码')
|
code = fields.Char('行业编码')
|
||||||
name = fields.Char('机台号')
|
name = fields.Char('机台号', required=False)
|
||||||
knife_type = fields.Selection(
|
knife_type = fields.Selection(
|
||||||
[("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")],
|
[("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")],
|
||||||
default="", string="刀把类型")
|
default="", string="刀把类型")
|
||||||
@@ -160,8 +160,9 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
type_id = fields.Many2one('sf.machine_tool.type', '型号')
|
||||||
|
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
|
||||||
default='正常', string="机床状态")
|
default='正常', string="机床状态")
|
||||||
|
run_time = fields.Char('总运行时长')
|
||||||
# 0606新增字段
|
# 0606新增字段
|
||||||
machine_tool_picture = fields.Binary('图片')
|
machine_tool_picture = fields.Binary('图片')
|
||||||
heightened_way = fields.Selection([
|
heightened_way = fields.Selection([
|
||||||
@@ -449,7 +450,7 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
sf_secret_key = sf_sync_config['sf_secret_key']
|
sf_secret_key = sf_sync_config['sf_secret_key']
|
||||||
headers = Common.get_headers(self, token, sf_secret_key)
|
headers = Common.get_headers(self, token, sf_secret_key)
|
||||||
strurl = sf_sync_config['sf_url'] + self.crea_url
|
strurl = sf_sync_config['sf_url'] + self.crea_url
|
||||||
objs_all = self.env['maintenance.equipment'].search([('MTcode', '=', self.MTcode)])
|
objs_all = self.env['maintenance.equipment'].search([('id', '=', self.id)])
|
||||||
machine_tool_list = []
|
machine_tool_list = []
|
||||||
if objs_all:
|
if objs_all:
|
||||||
for item in objs_all:
|
for item in objs_all:
|
||||||
@@ -552,7 +553,7 @@ class SfMaintenanceEquipment(models.Model):
|
|||||||
kw = json.dumps(machine_tool_list, ensure_ascii=False)
|
kw = json.dumps(machine_tool_list, ensure_ascii=False)
|
||||||
r = requests.post(strurl, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
r = requests.post(strurl, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
||||||
ret = r.json()
|
ret = r.json()
|
||||||
self.code = ret['message']
|
self.code = ret['data']
|
||||||
self.state_zc = "已注册"
|
self.state_zc = "已注册"
|
||||||
if r == 200:
|
if r == 200:
|
||||||
return "机床注册成功"
|
return "机床注册成功"
|
||||||
|
|||||||
@@ -26,3 +26,4 @@ class SfMaintenanceLogs(models.Model):
|
|||||||
recovery_time = fields.Datetime(string='复原时间')
|
recovery_time = fields.Datetime(string='复原时间')
|
||||||
fault_duration = fields.Float(string='故障时长')
|
fault_duration = fields.Float(string='故障时长')
|
||||||
note = fields.Text(string='备注')
|
note = fields.Text(string='备注')
|
||||||
|
active = fields.Boolean('Active', default=True)
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ access_maintenance_standard_image,maintenance_standard_image,model_maintenance_s
|
|||||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,1,1,1
|
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_user,1,1,1,1
|
||||||
|
|
||||||
|
|
||||||
access_maintenance_request,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
|
access_maintenance_request_group_plan_dispatch,maintenance.request,maintenance.model_maintenance_request,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,sf_base.group_plan_dispatch,1,0,0,0
|
access_maintenance_equipment_group_plan_dispatch,maintenance.equipment,maintenance.model_maintenance_equipment,sf_base.group_plan_dispatch,1,1,1,1
|
||||||
access_sf_maintenance_logs,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0
|
access_sf_maintenance_logs_group_plan_dispatch,sf_maintenance_logs,model_sf_maintenance_logs,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,sf_base.group_plan_dispatch,1,0,0,0
|
access_maintenance_standard_image_group_plan_dispatch,maintenance_standard_image,model_maintenance_standard_image,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
access_equipment_maintenance_standards_group_plan_dispatch,equipment_maintenance_standards,model_equipment_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
access_maintenance_standards_group_plan_dispatch,maintenance_standards,model_maintenance_standards,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
|
||||||
|
access_maintenance_equipment_tool_group_plan_dispatch,maintenance.equipment.tool,sf_manufacturing.model_maintenance_equipment_tool,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
access_sf_robot_axis_num_group_plan_dispatch,sf.robot.axis.num,model_sf_robot_axis_num,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
15
sf_maintenance/security/ir_rule_data.xml
Normal file
15
sf_maintenance/security/ir_rule_data.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<odoo>
|
||||||
|
<data> <!-- 如果您不希望在模块更新时重置规则,则设置 noupdate="1" -->
|
||||||
|
<!-- 计划调度岗 规则 -->
|
||||||
|
<record id="maintenance_equipment_rule_plan_dispatch" model="ir.rule">
|
||||||
|
<field name="name">Maintenance Equipment Plan Dispatch Rule</field>
|
||||||
|
<field name="model_id" ref="maintenance.model_maintenance_equipment"/>
|
||||||
|
<field name="groups" eval="[(4, ref('sf_base.group_plan_dispatch'))]"/>
|
||||||
|
<!-- <field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field> -->
|
||||||
|
<field name="perm_read">True</field>
|
||||||
|
<field name="perm_write">False</field>
|
||||||
|
<field name="perm_create">False</field>
|
||||||
|
<field name="perm_unlink">False</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<field name="inherit_id" ref="maintenance.hr_equipment_category_view_form"/>
|
<field name="inherit_id" ref="maintenance.hr_equipment_category_view_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='technician_user_id']" position="before">
|
<xpath expr="//field[@name='technician_user_id']" position="before">
|
||||||
<field name="equipment_type" required='1'/>
|
<field name="equipment_type"/>
|
||||||
<field name="equipment_type_code" required='1'/>
|
<field name="equipment_type_code" required='1'/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -105,9 +105,10 @@
|
|||||||
<!-- Action -->
|
<!-- Action -->
|
||||||
|
|
||||||
<record id="action_maintenance_logs" model="ir.actions.act_window">
|
<record id="action_maintenance_logs" model="ir.actions.act_window">
|
||||||
<field name="name">设备故障日志</field>
|
<field name="name">设备故障日志</field>
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sf.maintenance.logs</field>
|
<field name="res_model">sf.maintenance.logs</field>
|
||||||
|
<field name="search_view_id" ref="view_maintenance_logs_search"/>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="view_id" ref="view_maintenance_logs_tree"/>
|
<field name="view_id" ref="view_maintenance_logs_tree"/>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
@@ -117,6 +118,23 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- <record id="action_maintenance_logs_button" model="ir.actions.act_window">-->
|
||||||
|
<!-- <field name="name">设备故障日志</field>-->
|
||||||
|
<!-- <field name="type">ir.actions.act_window</field>-->
|
||||||
|
<!-- <field name="res_model">sf.maintenance.logs</field>-->
|
||||||
|
<!-- <field name="search_view_id" ref="view_maintenance_logs_search"/>-->
|
||||||
|
<!-- <field name="view_mode">tree,form</field>-->
|
||||||
|
<!-- <field name="view_id" ref="view_maintenance_logs_tree"/>-->
|
||||||
|
<!-- <field name="context">{-->
|
||||||
|
<!-- 'default_maintenance_equipment_id': active_id-->
|
||||||
|
<!-- }</field>-->
|
||||||
|
<!-- <field name="help" type="html">-->
|
||||||
|
<!-- <p class="oe_view_nocontent_create">-->
|
||||||
|
<!-- 设备故障日志-->
|
||||||
|
<!-- </p>-->
|
||||||
|
<!-- </field>-->
|
||||||
|
<!-- </record>-->
|
||||||
|
|
||||||
<!-- <record id="action_maintenance_logs" model="ir.actions.act_window">-->
|
<!-- <record id="action_maintenance_logs" model="ir.actions.act_window">-->
|
||||||
<!-- <field name="name">设备故障日志</field>-->
|
<!-- <field name="name">设备故障日志</field>-->
|
||||||
<!-- <field name="res_model">sf.maintenance.logs</field>-->
|
<!-- <field name="res_model">sf.maintenance.logs</field>-->
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<button name="%(action_maintenance_logs)d"
|
<button name="%(action_maintenance_logs)d"
|
||||||
type="action"
|
type="action"
|
||||||
class="oe_stat_button"
|
class="oe_stat_button"
|
||||||
context="{'default_sf_maintenance_logs_ids': sf_maintenance_logs_ids}"
|
context="{'search_default_maintenance_equipment_id': [active_id]}"
|
||||||
icon="fa-wrench">
|
icon="fa-wrench">
|
||||||
<field string="设备故障日志" name="sf_maintenance_logs_ids" widget="statinfo"/>
|
<field string="设备故障日志" name="sf_maintenance_logs_ids" widget="statinfo"/>
|
||||||
</button>
|
</button>
|
||||||
@@ -56,21 +56,22 @@
|
|||||||
domain="[('brand_id', '=', brand_id)]"/>
|
domain="[('brand_id', '=', brand_id)]"/>
|
||||||
<field name="machine_tool_category" readonly="1" attrs="{'invisible': [('type_id', '=', False)]}"
|
<field name="machine_tool_category" readonly="1" attrs="{'invisible': [('type_id', '=', False)]}"
|
||||||
force_save="1"/>
|
force_save="1"/>
|
||||||
|
<field name="run_time" force_save="1"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[@name='description']" position="before">
|
<xpath expr="//page[@name='description']" position="before">
|
||||||
<page string="设备参数" name="sf_equipment"
|
<page string="设备参数" name="sf_equipment"
|
||||||
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||||
<group>
|
<group>
|
||||||
<group string="基础参数">
|
<group string="基础参数">
|
||||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
<field name="control_system_id" attrs="{'required': [('equipment_type', '=', '机床')]}" options="{'no_create': True}"/>
|
||||||
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
<label for="workbench_L" string="工作台尺寸(mm)"/>
|
||||||
<div class="test_model">
|
<div class="test_model">
|
||||||
<label for="workbench_L" string="长"/>
|
<label for="workbench_L" string="长"/>
|
||||||
<field name="workbench_L" class="o_address_zip" required="1"
|
<field name="workbench_L" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"/>
|
||||||
<span>&nbsp;</span>
|
<span>&nbsp;</span>
|
||||||
<label for="workbench_W" string="宽"/>
|
<label for="workbench_W" string="宽"/>
|
||||||
<field name="workbench_W" class="o_address_zip" required="1"
|
<field name="workbench_W" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"/>
|
||||||
</div>
|
</div>
|
||||||
<field name="workpiece_load"/>
|
<field name="workpiece_load"/>
|
||||||
@@ -114,22 +115,22 @@
|
|||||||
|
|
||||||
<!-- <field name="lead_screw" required="1"/>-->
|
<!-- <field name="lead_screw" required="1"/>-->
|
||||||
<!-- <field name="guide_rail" required="1"/>-->
|
<!-- <field name="guide_rail" required="1"/>-->
|
||||||
<field name="number_of_axles" required="1" widget="radio"
|
<field name="number_of_axles" attrs="{'required': [('equipment_type', '=', '机床')]}" widget="radio"
|
||||||
options="{'horizontal': true}"/>
|
options="{'horizontal': true}"/>
|
||||||
<label for="x_axis" string="加工行程(mm)"
|
<label for="x_axis" string="加工行程(mm)"
|
||||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||||
<div class="test_model"
|
<div class="test_model"
|
||||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||||
<label for="x_axis" string="x"/>
|
<label for="x_axis" string="x"/>
|
||||||
<field name="x_axis" class="o_address_zip" required="1"
|
<field name="x_axis" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"/>
|
||||||
<span>&nbsp;</span>
|
<span>&nbsp;</span>
|
||||||
<label for="y_axis" string="y"/>
|
<label for="y_axis" string="y"/>
|
||||||
<field name="y_axis" class="o_address_zip" required="1"
|
<field name="y_axis" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"/>
|
||||||
<span>&nbsp;</span>
|
<span>&nbsp;</span>
|
||||||
<label for="z_axis" string="z"/>
|
<label for="z_axis" string="z"/>
|
||||||
<field name="z_axis" class="o_address_zip" required="1"
|
<field name="z_axis" class="o_address_zip" attrs="{'required': [('equipment_type', '=', '机床')]}"
|
||||||
options="{'format': false}"/>
|
options="{'format': false}"/>
|
||||||
<span>&nbsp;</span>
|
<span>&nbsp;</span>
|
||||||
<label for="a_axis" string="a"
|
<label for="a_axis" string="a"
|
||||||
@@ -152,7 +153,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</group>
|
</group>
|
||||||
<group string="主轴">
|
<group string="主轴">
|
||||||
<field name="taper_type_id" required="1"/>
|
<field name="taper_type_id" attrs="{'required': [('equipment_type', '=', '机床')]}"/>
|
||||||
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
<label for="distance_min" string="主轴端面-工作台距离(mm)"/>
|
||||||
<div class="test_model">
|
<div class="test_model">
|
||||||
<label for="distance_min" string="最小(min)"/>
|
<label for="distance_min" string="最小(min)"/>
|
||||||
@@ -178,7 +179,7 @@
|
|||||||
</group>
|
</group>
|
||||||
<group string="刀具">
|
<group string="刀具">
|
||||||
<!-- <field name="knife_type" required="1"/>-->
|
<!-- <field name="knife_type" required="1"/>-->
|
||||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
<field name="number_of_knife_library" attrs="{'required': [('equipment_type', '=', '机床')]}" options="{'format': false}"/>
|
||||||
<!-- <field name="tool_speed" required="1"/>-->
|
<!-- <field name="tool_speed" required="1"/>-->
|
||||||
<field name="tool_full_diameter_max"/>
|
<field name="tool_full_diameter_max"/>
|
||||||
<field name="tool_perimeter_diameter_max"/>
|
<field name="tool_perimeter_diameter_max"/>
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import base64
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
|
import requests
|
||||||
from odoo import api, fields, models, _
|
from odoo import api, fields, models, _
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
|
|
||||||
|
|
||||||
class MrpProduction(models.Model):
|
class MrpProduction(models.Model):
|
||||||
@@ -17,6 +22,10 @@ class MrpProduction(models.Model):
|
|||||||
|
|
||||||
check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
|
check_status = fields.Boolean(string='启用状态', default=False, readonly=True)
|
||||||
active = fields.Boolean(string='已归档', default=True)
|
active = fields.Boolean(string='已归档', default=True)
|
||||||
|
programming_no = fields.Char('编程单号')
|
||||||
|
work_state = fields.Char('业务状态')
|
||||||
|
programming_state = fields.Char('编程状态')
|
||||||
|
glb_file = fields.Binary("glb模型文件")
|
||||||
|
|
||||||
def action_check(self):
|
def action_check(self):
|
||||||
"""
|
"""
|
||||||
@@ -47,6 +56,48 @@ class MrpProduction(models.Model):
|
|||||||
for production in self:
|
for production in self:
|
||||||
production.maintenance_count = len(production.request_ids)
|
production.maintenance_count = len(production.request_ids)
|
||||||
|
|
||||||
|
# cnc程序获取
|
||||||
|
def fetchCNC(self):
|
||||||
|
cnc = self.env['mrp.production'].search([('id', '=', self.id)])
|
||||||
|
try:
|
||||||
|
res = {'model_code': '' if not cnc.product_id.model_code else cnc.product_id.model_code,
|
||||||
|
'production_no': cnc.name,
|
||||||
|
'machine_tool_code': "",
|
||||||
|
'material_code': self.env['sf.production.materials'].search(
|
||||||
|
[('id', '=', cnc.product_id.materials_id.id)]).materials_no,
|
||||||
|
'material_type_code': self.env['sf.materials.model'].search(
|
||||||
|
[('id', '=', cnc.product_id.materials_type_id.id)]).materials_no,
|
||||||
|
'machining_processing_panel': cnc.product_id.model_processing_panel,
|
||||||
|
'machining_precision': cnc.product_id.model_machining_precision,
|
||||||
|
'embryo_long': cnc.product_id.bom_ids.bom_line_ids.product_id.length,
|
||||||
|
'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.origin,
|
||||||
|
'model_order_no': cnc.product_id.default_code.rsplit(' -', 1)[0],
|
||||||
|
'user': cnc.env.user.name,
|
||||||
|
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
|
||||||
|
cnc.product_id.model_file).decode('utf-8')
|
||||||
|
}
|
||||||
|
logging.info('res:%s' % res)
|
||||||
|
configsettings = self.env['res.config.settings'].get_values()
|
||||||
|
config_header = Common.get_headers(self, configsettings['token'], configsettings['sf_secret_key'])
|
||||||
|
url = '/api/intelligent_programming/create'
|
||||||
|
config_url = configsettings['sf_url'] + url
|
||||||
|
res['token'] = configsettings['token']
|
||||||
|
# res_str = json.dumps(res)
|
||||||
|
ret = requests.post(config_url, json={}, data=res, headers=config_header)
|
||||||
|
ret = ret.json()
|
||||||
|
logging.info('fetchCNC-ret:%s' % ret)
|
||||||
|
if ret['status'] == 1:
|
||||||
|
self.write(
|
||||||
|
{'programming_no': ret['programming_no'], 'programming_state': '编程中', 'work_state': '编程中'})
|
||||||
|
else:
|
||||||
|
raise UserError(ret['message'])
|
||||||
|
except Exception as e:
|
||||||
|
logging.info('fetchCNC error:%s' % e)
|
||||||
|
raise UserError("cnc程序获取编程单失败,请联系管理员")
|
||||||
|
|
||||||
|
|
||||||
# 维修模块按钮
|
# 维修模块按钮
|
||||||
def button_maintenance_req(self):
|
def button_maintenance_req(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
@@ -134,6 +185,7 @@ class MrpProduction(models.Model):
|
|||||||
'state': 'pending',
|
'state': 'pending',
|
||||||
}]
|
}]
|
||||||
if production.product_id.categ_id.type == '成品':
|
if production.product_id.categ_id.type == '成品':
|
||||||
|
production.fetchCNC()
|
||||||
# 根据加工面板的面数及对应的工序模板生成工单
|
# 根据加工面板的面数及对应的工序模板生成工单
|
||||||
i = 0
|
i = 0
|
||||||
processing_panel_len = len(production.product_id.model_processing_panel.split(','))
|
processing_panel_len = len(production.product_id.model_processing_panel.split(','))
|
||||||
@@ -366,7 +418,8 @@ class MrpProduction(models.Model):
|
|||||||
current_sequence += 1
|
current_sequence += 1
|
||||||
if work.name == '获取CNC加工程序':
|
if work.name == '获取CNC加工程序':
|
||||||
work.button_start()
|
work.button_start()
|
||||||
work.fetchCNC()
|
#work.fetchCNC()
|
||||||
|
work.button_finish()
|
||||||
|
|
||||||
# 创建工单并进行排序
|
# 创建工单并进行排序
|
||||||
def _create_workorder(self):
|
def _create_workorder(self):
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ResWorkcenter(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
equipment_status = fields.Selection(
|
equipment_status = fields.Selection(
|
||||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
[("正常", "正常"), ("故障停机", "故障停机"), ("计划维保", "计划维保"),("空闲", "空闲"),("封存(报废)", "封存(报废)")],
|
||||||
string="设备状态", related='equipment_id.state')
|
string="设备状态", related='equipment_id.state')
|
||||||
|
|
||||||
# @api.depends('equipment_id')
|
# @api.depends('equipment_id')
|
||||||
|
|||||||
@@ -137,7 +137,10 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
"""
|
"""
|
||||||
检测is_ok(是否合格)被修改的话,就将当前用户赋值给inspection_user_id
|
检测is_ok(是否合格)被修改的话,就将当前用户赋值给inspection_user_id
|
||||||
"""
|
"""
|
||||||
self.inspection_user_id = self.env.user.id
|
if not self.inspection_user_id:
|
||||||
|
self.inspection_user_id = self.env.user.id
|
||||||
|
else:
|
||||||
|
self.inspection_user_id = False
|
||||||
|
|
||||||
@api.onchange('functional_fixture_id')
|
@api.onchange('functional_fixture_id')
|
||||||
def _onchange_functional_fixture_id(self):
|
def _onchange_functional_fixture_id(self):
|
||||||
@@ -447,7 +450,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height,
|
'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,
|
'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width,
|
||||||
'order_no': cnc.production_id.origin,
|
'order_no': cnc.production_id.origin,
|
||||||
'model_order_no': cnc.product_id.default_code.rsplit('-', 1)[0],
|
'model_order_no': cnc.product_id.default_code.rsplit(' -', 1)[0],
|
||||||
'user': self.env.user.name,
|
'user': self.env.user.name,
|
||||||
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
|
'model_file': '' if not cnc.product_id.model_file else base64.b64encode(
|
||||||
cnc.product_id.model_file).decode('utf-8')
|
cnc.product_id.model_file).decode('utf-8')
|
||||||
@@ -571,6 +574,18 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
'order_line': order_line_ids,
|
'order_line': order_line_ids,
|
||||||
})
|
})
|
||||||
super().button_finish()
|
super().button_finish()
|
||||||
|
is_production_id = True
|
||||||
|
for workorder in self.production_id.workorder_ids:
|
||||||
|
if workorder.state != 'done':
|
||||||
|
is_production_id = False
|
||||||
|
if is_production_id == True and self.name == '解除装夹':
|
||||||
|
for move_raw_id in self.production_id.move_raw_ids:
|
||||||
|
move_raw_id.quantity_done = move_raw_id.product_uom_qty
|
||||||
|
self.production_id.state = 'done'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CNCprocessing(models.Model):
|
class CNCprocessing(models.Model):
|
||||||
@@ -592,6 +607,7 @@ class CNCprocessing(models.Model):
|
|||||||
estimated_processing_time = fields.Char('预计加工时间')
|
estimated_processing_time = fields.Char('预计加工时间')
|
||||||
remark = fields.Text('备注')
|
remark = fields.Text('备注')
|
||||||
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
workorder_id = fields.Many2one('mrp.workorder', string="工单")
|
||||||
|
workorder_id = fields.Many2one('mrp.production', string="制造定单")
|
||||||
button_state = fields.Boolean(string='是否已经下发')
|
button_state = fields.Boolean(string='是否已经下发')
|
||||||
|
|
||||||
# mrs下发编程单创建CNC加工
|
# mrs下发编程单创建CNC加工
|
||||||
@@ -617,11 +633,11 @@ class CNCprocessing(models.Model):
|
|||||||
'remark': obj['remark']
|
'remark': obj['remark']
|
||||||
})
|
})
|
||||||
self.get_cnc_processing_file(ret['folder_name'], cnc_processing, workorder.processing_panel)
|
self.get_cnc_processing_file(ret['folder_name'], cnc_processing, workorder.processing_panel)
|
||||||
cnc_workorder.state = 'done'
|
# cnc_workorder.state = 'done'
|
||||||
cnc_workorder.work_state = '已编程'
|
cnc_workorder.work_state = '已编程'
|
||||||
cnc_workorder.programming_state = '已编程'
|
cnc_workorder.programming_state = '已编程'
|
||||||
cnc_workorder.time_ids.date_end = datetime.now()
|
# cnc_workorder.time_ids.date_end = datetime.now()
|
||||||
cnc_workorder.button_finish()
|
# cnc_workorder.button_finish()
|
||||||
|
|
||||||
# 根据程序名和加工面匹配到ftp里对应的Nc程序名
|
# 根据程序名和加工面匹配到ftp里对应的Nc程序名
|
||||||
def get_cnc_processing_file(self, folder_name, cnc_processing, processing_panel):
|
def get_cnc_processing_file(self, folder_name, cnc_processing, processing_panel):
|
||||||
|
|||||||
@@ -486,28 +486,6 @@ class ResProductMo(models.Model):
|
|||||||
string='适用刀柄型号'
|
string='适用刀柄型号'
|
||||||
)
|
)
|
||||||
|
|
||||||
# 夹具参数
|
|
||||||
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
|
|
||||||
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
|
|
||||||
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
|
||||||
fixture_multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型")
|
|
||||||
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)")
|
|
||||||
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)")
|
|
||||||
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)")
|
|
||||||
fixture_screw_size = fields.Integer(string="螺牙大小(mm)")
|
|
||||||
|
|
||||||
# 注册状态
|
# 注册状态
|
||||||
register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')],
|
register_state = fields.Selection([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')],
|
||||||
string='注册状态', default='未注册')
|
string='注册状态', default='未注册')
|
||||||
@@ -826,6 +804,124 @@ class ResProductMo(models.Model):
|
|||||||
return base64_data
|
return base64_data
|
||||||
|
|
||||||
|
|
||||||
|
class ResProductFixture(models.Model):
|
||||||
|
_inherit = 'product.template'
|
||||||
|
_description = '夹具产品信息'
|
||||||
|
|
||||||
|
fixture_model_id = fields.Many2one('sf.fixture.model', '夹具型号')
|
||||||
|
specification_fixture_id = fields.Many2one('sf.fixture.materials.basic.parameters', '夹具规格')
|
||||||
|
|
||||||
|
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料", required=True)
|
||||||
|
fixture_material_type = fields.Char(string="夹具物料类型", related='fixture_material_id.name')
|
||||||
|
multi_mounting_type_id = fields.Many2one('sf.multi_mounting.type', string="联装类型", required=True)
|
||||||
|
model_file = fields.Binary(string="3D模型图")
|
||||||
|
|
||||||
|
# 夹具物料基本参数
|
||||||
|
# length = fields.Float('长度(mm)', digits=(16, 2))
|
||||||
|
# width = fields.Float('宽度(mm)', digits=(16, 2))
|
||||||
|
# height = fields.Float('高度(mm)', digits=(16, 2))
|
||||||
|
diameter = fields.Float('直径(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
# '零点卡盘' 字段
|
||||||
|
weight = fields.Float('重量(mm)', digits=(16, 2))
|
||||||
|
orientation_dish_diameter = fields.Float('定位盘直径(mm)', digits=(16, 2))
|
||||||
|
clamping_diameter = fields.Float('装夹直径(mm)', digits=(16, 2))
|
||||||
|
clamping_num = fields.Selection([('1', '1'), ('2', '2'), ('4', '4'), ('6', '6'), ('8', '8')], string='装夹单元数')
|
||||||
|
chucking_power_max = fields.Float('最大夹持力(KN)', digits=(16, 2))
|
||||||
|
repeated_positioning_accuracy = fields.Char('重复定位精度(mm)', size=20)
|
||||||
|
boolean_transposing_hole = fields.Boolean('是否有转位孔')
|
||||||
|
unlocking_method = fields.Selection(
|
||||||
|
[('手动', '手动'), ('气动', '气动'), ('液压', '液压'), ('电动', '电动'), ('其他', '其他')], string='解锁方式')
|
||||||
|
boolean_chip_blowing_function = fields.Boolean('是否有吹屑功能')
|
||||||
|
carrying_capacity_max = fields.Float('最大承载重量(kg)', digits=(16, 2))
|
||||||
|
rigidity = fields.Integer('硬度HRC')
|
||||||
|
materials_model_id = fields.Many2one('sf.materials.model', '夹具材质')
|
||||||
|
machine_tool_type_id = fields.Many2one('sf.machine_tool.type', '适用机床型号')
|
||||||
|
|
||||||
|
# ’零点托盘‘ 字段
|
||||||
|
connector_diameter = fields.Selection([('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('8', '8')],
|
||||||
|
string='连接头直径(mm)')
|
||||||
|
way_to_install = fields.Selection(
|
||||||
|
[('接口式', '接口式'), ('螺栓固定', '螺栓固定'), ('磁吸式', '磁吸式'), ('其他', '其他')], string='安装方式')
|
||||||
|
type_of_drive = fields.Selection(
|
||||||
|
[('气动式', '气动式'), ('液压式', '液压式'), ('机械式', '机械式'), ('电动式', '电动式'), ('其他', '其他')],
|
||||||
|
string='驱动方式')
|
||||||
|
|
||||||
|
# ’气动夹具‘ 字段
|
||||||
|
gripper_length_min = fields.Float('夹持工件最小长度(mm)', digits=(16, 2))
|
||||||
|
gripper_width_min = fields.Float('夹持工件最小宽度(mm)', digits=(16, 2))
|
||||||
|
gripper_height_min = fields.Float('夹持工件最小高度(mm)', digits=(16, 2))
|
||||||
|
gripper_diameter_min = fields.Float('夹持工件最小直径(mm)', digits=(16, 2))
|
||||||
|
gripper_length_max = fields.Float('夹持工件最大长度(mm)', digits=(16, 2))
|
||||||
|
gripper_width_max = fields.Float('夹持工件最大宽度(mm)', digits=(16, 2))
|
||||||
|
gripper_height_max = fields.Float('夹持工件最大高度(mm)', digits=(16, 2))
|
||||||
|
gripper_diameter_max = fields.Float('夹持工件最大直径(mm)', digits=(16, 2))
|
||||||
|
rated_air_pressure = fields.Float('额定气压(Mpa)', digits=(16, 2))
|
||||||
|
interface_materials_model_id = fields.Many2one('sf.materials.model', '接口类型')
|
||||||
|
|
||||||
|
# ‘虎钳夹具' 字段
|
||||||
|
transverse_groove = fields.Float('横向配合槽n(mm)', digits=(16, 2))
|
||||||
|
longitudinal_fitting_groove = fields.Float('纵向配合槽l(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
# '磁吸夹具' 字段
|
||||||
|
height_tolerance_value = fields.Char('高度公差(mm)')
|
||||||
|
rated_adsorption_force = fields.Float('额定吸附力(N/cm²)', digits=(16, 2))
|
||||||
|
magnetic_field_height = fields.Float('磁场高度(mm)', digits=(16, 2))
|
||||||
|
magnetic_pole_plate_grinding_allowance = fields.Float('磁极板磨削余量(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
# '转接板(锁板)夹具' 字段
|
||||||
|
screw_size = fields.Float('螺牙大小(mm)', digits=(16, 2))
|
||||||
|
via_hole_diameter = fields.Float('过孔直径(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
# '三爪卡盘' 字段
|
||||||
|
mounting_hole_depth = fields.Float('安装孔深度(mm)', digits=(16, 2))
|
||||||
|
centering_diameter = fields.Float('定心直径(mm)', digits=(16, 2))
|
||||||
|
|
||||||
|
@api.onchange('specification_fixture_id')
|
||||||
|
def _onchange_specification_fixture_id(self):
|
||||||
|
if self.specification_fixture_id:
|
||||||
|
self.length = self.specification_fixture_id.length
|
||||||
|
self.width = self.specification_fixture_id.width
|
||||||
|
self.height = self.specification_fixture_id.height
|
||||||
|
self.weight = self.specification_fixture_id.weight
|
||||||
|
self.diameter = self.specification_fixture_id.diameter
|
||||||
|
self.orientation_dish_diameter = self.specification_fixture_id.orientation_dish_diameter
|
||||||
|
self.clamping_diameter = self.specification_fixture_id.clamping_diameter
|
||||||
|
self.clamping_num = self.specification_fixture_id.clamping_num
|
||||||
|
self.chucking_power_max = self.specification_fixture_id.chucking_power_max
|
||||||
|
self.repeated_positioning_accuracy = self.specification_fixture_id.repeated_positioning_accuracy
|
||||||
|
self.boolean_transposing_hole = self.specification_fixture_id.boolean_transposing_hole
|
||||||
|
self.unlocking_method = self.specification_fixture_id.unlocking_method
|
||||||
|
self.boolean_chip_blowing_function = self.specification_fixture_id.boolean_chip_blowing_function
|
||||||
|
self.carrying_capacity_max = self.specification_fixture_id.carrying_capacity_max
|
||||||
|
self.rigidity = self.specification_fixture_id.rigidity
|
||||||
|
self.materials_model_id = self.specification_fixture_id.materials_model_id
|
||||||
|
self.machine_tool_type_id = self.specification_fixture_id.machine_tool_type_id
|
||||||
|
self.connector_diameter = self.specification_fixture_id.connector_diameter
|
||||||
|
self.way_to_install = self.specification_fixture_id.way_to_install
|
||||||
|
self.type_of_drive = self.specification_fixture_id.type_of_drive
|
||||||
|
self.gripper_length_min = self.specification_fixture_id.gripper_length_min
|
||||||
|
self.gripper_width_min = self.specification_fixture_id.gripper_width_min
|
||||||
|
self.gripper_height_min = self.specification_fixture_id.gripper_height_min
|
||||||
|
self.gripper_diameter_min = self.specification_fixture_id.gripper_diameter_min
|
||||||
|
self.gripper_length_max = self.specification_fixture_id.gripper_length_max
|
||||||
|
self.gripper_width_max = self.specification_fixture_id.gripper_width_max
|
||||||
|
self.gripper_height_max = self.specification_fixture_id.gripper_height_max
|
||||||
|
self.gripper_diameter_max = self.specification_fixture_id.gripper_diameter_max
|
||||||
|
self.rated_air_pressure = self.specification_fixture_id.rated_air_pressure
|
||||||
|
self.interface_materials_model_id = self.specification_fixture_id.interface_materials_model_id
|
||||||
|
self.transverse_groove = self.specification_fixture_id.transverse_groove
|
||||||
|
self.longitudinal_fitting_groove = self.specification_fixture_id.longitudinal_fitting_groove
|
||||||
|
self.height_tolerance_value = self.specification_fixture_id.height_tolerance_value
|
||||||
|
self.rated_adsorption_force = self.specification_fixture_id.rated_adsorption_force
|
||||||
|
self.magnetic_field_height = self.specification_fixture_id.magnetic_field_height
|
||||||
|
self.magnetic_pole_plate_grinding_allowance = self.specification_fixture_id.magnetic_pole_plate_grinding_allowance
|
||||||
|
self.screw_size = self.specification_fixture_id.screw_size
|
||||||
|
self.via_hole_diameter = self.specification_fixture_id.via_hole_diameter
|
||||||
|
self.mounting_hole_depth = self.specification_fixture_id.mounting_hole_depth
|
||||||
|
self.centering_diameter = self.specification_fixture_id.centering_diameter
|
||||||
|
|
||||||
|
|
||||||
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
class SfMaintenanceEquipmentAndProductTemplate(models.Model):
|
||||||
_inherit = 'maintenance.equipment'
|
_inherit = 'maintenance.equipment'
|
||||||
_description = '设备'
|
_description = '设备'
|
||||||
|
|||||||
@@ -202,8 +202,7 @@ class StockRule(models.Model):
|
|||||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||||
if sale_order:
|
if sale_order:
|
||||||
sale_order.write({'schedule_status': 'to schedule'})
|
sale_order.write({'schedule_status': 'to schedule'})
|
||||||
self.env['sf.production.plan'].sudo().with_company(company_id). \
|
self.env['sf.production.plan'].sudo().with_company(company_id).create({
|
||||||
create({
|
|
||||||
'name': production.name,
|
'name': production.name,
|
||||||
'order_deadline': sale_order.deadline_of_delivery,
|
'order_deadline': sale_order.deadline_of_delivery,
|
||||||
'production_id': production.id,
|
'production_id': production.id,
|
||||||
|
|||||||
@@ -66,6 +66,11 @@
|
|||||||
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
<button name="action_check" string="审核" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', True)]}" groups="sf_base.group_plan_director"/>
|
||||||
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
<!-- <button name="action_uncheck" string="禁用" type="object" class="oe_highlight" attrs="{'invisible': [('check_status', '=', False)]}" groups="sf_base.group_plan_director"/> -->
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='user_id']" position="after">
|
||||||
|
<field name="programming_no"/>
|
||||||
|
<field name="work_state" invisible="1"/>
|
||||||
|
<field name="programming_state"/>
|
||||||
|
</xpath>
|
||||||
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -23,12 +23,11 @@ class Sf_Mrs_Connect(http.Controller):
|
|||||||
ret = json.loads(datas)
|
ret = json.loads(datas)
|
||||||
ret = json.loads(ret['result'])
|
ret = json.loads(ret['result'])
|
||||||
# 查询状态为进行中且类型为获取CNC加工程序的工单
|
# 查询状态为进行中且类型为获取CNC加工程序的工单
|
||||||
cnc_workorder = request.env['mrp.workorder'].with_user(
|
cnc_production = request.env['mrp.production'].with_user(
|
||||||
request.env.ref("base.user_admin")).search([('production_id.name', '=', ret['production_order_no']),
|
request.env.ref("base.user_admin")).search([('name', '=', ret['production_order_no'])])
|
||||||
('routing_type', '=', '获取CNC加工程序'),
|
if cnc_production:
|
||||||
('state', '=', 'progress')])
|
if ret['glb_file']:
|
||||||
if cnc_workorder:
|
cnc_production.glb_file = base64.b64encode(ret['glb_file'])
|
||||||
cnc_workorder.glb_file = base64.b64encode(ret['glb_file'])
|
|
||||||
# 拉取所有加工面的程序文件
|
# 拉取所有加工面的程序文件
|
||||||
# i = 1
|
# i = 1
|
||||||
for r in ret['processing_panel']:
|
for r in ret['processing_panel']:
|
||||||
@@ -37,10 +36,10 @@ class Sf_Mrs_Connect(http.Controller):
|
|||||||
ret['folder_name'], r)
|
ret['folder_name'], r)
|
||||||
if not download_state:
|
if not download_state:
|
||||||
res['status'] = -2
|
res['status'] = -2
|
||||||
res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_workorder.production_id.name)
|
res['message'] = '制造订单号为%s的CNC程序文件从FTP拉取失败' % (cnc_production.name)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
request.env['sf.cnc.processing'].with_user(
|
request.env['sf.cnc.processing'].with_user(
|
||||||
request.env.ref("base.user_admin")).cnc_processing_create(cnc_workorder, ret)
|
request.env.ref("base.user_admin")).cnc_processing_create(cnc_production, ret)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
else:
|
else:
|
||||||
res = {'status': 0, 'message': '该制造订单暂未开始'}
|
res = {'status': 0, 'message': '该制造订单暂未开始'}
|
||||||
|
|||||||
@@ -1466,6 +1466,39 @@ class SyncFixtureModel(models.Model):
|
|||||||
for item in result['fixture_model_yesterday_list']:
|
for item in result['fixture_model_yesterday_list']:
|
||||||
if item:
|
if item:
|
||||||
fixture_model = self.search([("code", '=', item['code'])])
|
fixture_model = self.search([("code", '=', item['code'])])
|
||||||
|
zero_chuck_list = []
|
||||||
|
for zero_chuck_id in item['zero_chuck_ids']:
|
||||||
|
zero_chuck_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_zero_chuck_param(zero_chuck_id))
|
||||||
|
zero_tray_list = []
|
||||||
|
for zero_tray_id in item['zero_tray_ids']:
|
||||||
|
zero_tray_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_zero_tray_param(zero_tray_id))
|
||||||
|
pneumatic_fixture_list = []
|
||||||
|
for pneumatic_fixture_id in item['pneumatic_fixture_ids']:
|
||||||
|
pneumatic_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_pneumatic_fixture_param(
|
||||||
|
pneumatic_fixture_id))
|
||||||
|
jaw_vice_fixture_list = []
|
||||||
|
for jaw_vice_fixture_id in item['jaw_vice_fixture_ids']:
|
||||||
|
jaw_vice_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_jaw_vice_fixture_param(
|
||||||
|
jaw_vice_fixture_id))
|
||||||
|
magnet_fixture_list = []
|
||||||
|
for magnet_fixture_id in item['magnet_fixture_ids']:
|
||||||
|
magnet_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_magnet_fixture_param(
|
||||||
|
magnet_fixture_id))
|
||||||
|
adapter_board_fixture_list = []
|
||||||
|
for adapter_board_fixture_id in item['adapter_board_fixture_ids']:
|
||||||
|
adapter_board_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_adapter_board_fixture_param(
|
||||||
|
adapter_board_fixture_id))
|
||||||
|
scroll_chuck_list = []
|
||||||
|
for scroll_chuck_id in item['scroll_chuck_ids']:
|
||||||
|
scroll_chuck_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_scroll_chuck_param(
|
||||||
|
scroll_chuck_id))
|
||||||
if not fixture_model:
|
if not fixture_model:
|
||||||
self.create({
|
self.create({
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
@@ -1475,56 +1508,35 @@ class SyncFixtureModel(models.Model):
|
|||||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||||
[('code', '=', item['multi_mounting_type_code'])]).id,
|
[('code', '=', item['multi_mounting_type_code'])]).id,
|
||||||
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
||||||
"clamping_way": item['clamping_way'],
|
|
||||||
"port_type": item['port_type'],
|
|
||||||
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
||||||
"length": item['length'],
|
"zero_chuck_ids": zero_chuck_list,
|
||||||
"width": item['width'],
|
"zero_tray_ids": zero_tray_list,
|
||||||
"height": item['height'],
|
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||||
"weight": item['weight'],
|
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
"magnet_fixture_ids": magnet_fixture_list,
|
||||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
"scroll_chuck_ids": scroll_chuck_list,
|
||||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
"status": item['status'],
|
||||||
"maximum_carrying_weight": item['maximum_carrying_weight'],
|
|
||||||
"maximum_clamping_force": item['maximum_clamping_force'],
|
|
||||||
"materials_model_id": self.env['sf.materials.model'].search(
|
|
||||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
|
||||||
"driving_way": item['driving_way'],
|
|
||||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
|
||||||
item['apply_machine_tool_type_code']),
|
|
||||||
"through_hole_size": item['through_hole_size'],
|
|
||||||
"screw_size": item['screw_size'],
|
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
fixture_model.write({
|
fixture_model.write({
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
|
"code": item['code'],
|
||||||
"fixture_material_id": self.env['sf.fixture.material'].search(
|
"fixture_material_id": self.env['sf.fixture.material'].search(
|
||||||
[('code', '=', item['fixture_material_code'])]).id,
|
[('code', '=', item['fixture_material_code'])]).id,
|
||||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||||
[('code', '=', item['multi_mounting_type_code'])]).id,
|
[('code', '=', item['multi_mounting_type_code'])]).id,
|
||||||
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
||||||
"clamping_way": item['clamping_way'],
|
|
||||||
"port_type": item['port_type'],
|
|
||||||
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
||||||
"length": item['length'],
|
"zero_chuck_ids": zero_chuck_list,
|
||||||
"width": item['width'],
|
"zero_tray_ids": zero_tray_list,
|
||||||
"height": item['height'],
|
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||||
"weight": item['weight'],
|
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
"magnet_fixture_ids": magnet_fixture_list,
|
||||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
"scroll_chuck_ids": scroll_chuck_list,
|
||||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
"status": item['status'],
|
||||||
"maximum_carrying_weight": item['maximum_carrying_weight'],
|
|
||||||
"maximum_clamping_force": item['maximum_clamping_force'],
|
|
||||||
"materials_model_id": self.env['sf.materials.model'].search(
|
|
||||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
|
||||||
"driving_way": item['driving_way'],
|
|
||||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
|
||||||
item['apply_machine_tool_type_code']),
|
|
||||||
"through_hole_size": item['through_hole_size'],
|
|
||||||
"screw_size": item['screw_size'],
|
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
@@ -1544,6 +1556,39 @@ class SyncFixtureModel(models.Model):
|
|||||||
for item in result['fixture_model_all_list']:
|
for item in result['fixture_model_all_list']:
|
||||||
if item:
|
if item:
|
||||||
fixture_model = self.search([("code", '=', item['code'])])
|
fixture_model = self.search([("code", '=', item['code'])])
|
||||||
|
zero_chuck_list = []
|
||||||
|
for zero_chuck_id in item['zero_chuck_ids']:
|
||||||
|
zero_chuck_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_zero_chuck_param(zero_chuck_id))
|
||||||
|
zero_tray_list = []
|
||||||
|
for zero_tray_id in item['zero_tray_ids']:
|
||||||
|
zero_tray_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_zero_tray_param(zero_tray_id))
|
||||||
|
pneumatic_fixture_list = []
|
||||||
|
for pneumatic_fixture_id in item['pneumatic_fixture_ids']:
|
||||||
|
pneumatic_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_pneumatic_fixture_param(
|
||||||
|
pneumatic_fixture_id))
|
||||||
|
jaw_vice_fixture_list = []
|
||||||
|
for jaw_vice_fixture_id in item['jaw_vice_fixture_ids']:
|
||||||
|
jaw_vice_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_jaw_vice_fixture_param(
|
||||||
|
jaw_vice_fixture_id))
|
||||||
|
magnet_fixture_list = []
|
||||||
|
for magnet_fixture_id in item['magnet_fixture_ids']:
|
||||||
|
magnet_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_magnet_fixture_param(
|
||||||
|
magnet_fixture_id))
|
||||||
|
adapter_board_fixture_list = []
|
||||||
|
for adapter_board_fixture_id in item['adapter_board_fixture_ids']:
|
||||||
|
adapter_board_fixture_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_adapter_board_fixture_param(
|
||||||
|
adapter_board_fixture_id))
|
||||||
|
scroll_chuck_list = []
|
||||||
|
for scroll_chuck_id in item['scroll_chuck_ids']:
|
||||||
|
scroll_chuck_list.append(
|
||||||
|
self.env['sf.fixture.materials.basic.parameters']._json_scroll_chuck_param(
|
||||||
|
scroll_chuck_id))
|
||||||
if not fixture_model:
|
if not fixture_model:
|
||||||
self.create({
|
self.create({
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
@@ -1553,56 +1598,35 @@ class SyncFixtureModel(models.Model):
|
|||||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||||
[('code', '=', item['multi_mounting_type_code'])]).id,
|
[('code', '=', item['multi_mounting_type_code'])]).id,
|
||||||
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
||||||
"clamping_way": item['clamping_way'],
|
|
||||||
"port_type": item['port_type'],
|
|
||||||
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
||||||
"length": item['length'],
|
"zero_chuck_ids": zero_chuck_list,
|
||||||
"width": item['width'],
|
"zero_tray_ids": zero_tray_list,
|
||||||
"height": item['height'],
|
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||||
"weight": item['weight'],
|
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
"magnet_fixture_ids": magnet_fixture_list,
|
||||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
"scroll_chuck_ids": scroll_chuck_list,
|
||||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
"status": item['status'],
|
||||||
"maximum_carrying_weight": item['maximum_carrying_weight'],
|
|
||||||
"maximum_clamping_force": item['maximum_clamping_force'],
|
|
||||||
"materials_model_id": self.env['sf.materials.model'].search(
|
|
||||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
|
||||||
"driving_way": item['driving_way'],
|
|
||||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
|
||||||
item['apply_machine_tool_type_code']),
|
|
||||||
"through_hole_size": item['through_hole_size'],
|
|
||||||
"screw_size": item['screw_size'],
|
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
fixture_model.write({
|
fixture_model.write({
|
||||||
"name": item['name'],
|
"name": item['name'],
|
||||||
|
"code": item['code'],
|
||||||
"fixture_material_id": self.env['sf.fixture.material'].search(
|
"fixture_material_id": self.env['sf.fixture.material'].search(
|
||||||
[('code', '=', item['fixture_material_code'])]).id,
|
[('code', '=', item['fixture_material_code'])]).id,
|
||||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||||
[('code', '=', item['multi_mounting_type_code'])]).id,
|
[('code', '=', item['multi_mounting_type_code'])]).id,
|
||||||
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
"brand_id": self.env['sf.machine.brand'].search([('code', '=', item['brand_code'])]).id,
|
||||||
"clamping_way": item['clamping_way'],
|
|
||||||
"port_type": item['port_type'],
|
|
||||||
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
"model_file": '' if not item['model_file'] else base64.b64decode(item['model_file']),
|
||||||
"length": item['length'],
|
"zero_chuck_ids": zero_chuck_list,
|
||||||
"width": item['width'],
|
"zero_tray_ids": zero_tray_list,
|
||||||
"height": item['height'],
|
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||||
"weight": item['weight'],
|
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
"magnet_fixture_ids": magnet_fixture_list,
|
||||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
"scroll_chuck_ids": scroll_chuck_list,
|
||||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
"status": item['status'],
|
||||||
"maximum_carrying_weight": item['maximum_carrying_weight'],
|
|
||||||
"maximum_clamping_force": item['maximum_clamping_force'],
|
|
||||||
"materials_model_id": self.env['sf.materials.model'].search(
|
|
||||||
[('materials_no', '=', item['materials_model_code'])]).id,
|
|
||||||
"driving_way": item['driving_way'],
|
|
||||||
"apply_machine_tool_type_ids": self.env['sf.machine_tool.type'].sudo()._get_ids(
|
|
||||||
item['apply_machine_tool_type_code']),
|
|
||||||
"through_hole_size": item['through_hole_size'],
|
|
||||||
"screw_size": item['screw_size'],
|
|
||||||
"active": item['active'],
|
"active": item['active'],
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -153,40 +153,45 @@ class sf_production_plan(models.Model):
|
|||||||
"""
|
"""
|
||||||
排程方法
|
排程方法
|
||||||
"""
|
"""
|
||||||
if not self.production_line_id:
|
for record in self:
|
||||||
raise ValidationError("未选择生产线")
|
if not record.production_line_id:
|
||||||
else:
|
raise ValidationError("未选择生产线")
|
||||||
workorder_id_list = self.production_id.workorder_ids.ids
|
|
||||||
if self.production_id.workorder_ids:
|
|
||||||
for item in self.production_id.workorder_ids:
|
|
||||||
if item.name == 'CNC加工':
|
|
||||||
item.date_planned_finished = datetime.now() + timedelta(days=100)
|
|
||||||
item.date_planned_start = self.date_planned_start
|
|
||||||
item.date_planned_finished = item.date_planned_start + timedelta(
|
|
||||||
minutes=self.env['mrp.routing.workcenter'].sudo().search(
|
|
||||||
[('name', '=', 'CNC加工')]).time_cycle)
|
|
||||||
item.duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
|
||||||
[('name', '=', 'CNC加工')]).time_cycle
|
|
||||||
self.calculate_plan_time_before(item, workorder_id_list)
|
|
||||||
self.calculate_plan_time_after(item, workorder_id_list)
|
|
||||||
self.date_planned_start, self.date_planned_finished = \
|
|
||||||
item.date_planned_start, item.date_planned_finished
|
|
||||||
self.state = 'done'
|
|
||||||
self.production_id.schedule_state = '已排'
|
|
||||||
# self.production_id.date_planned_start = self.date_planned_start
|
|
||||||
# self.production_id.date_planned_finished = self.date_planned_finished
|
|
||||||
else:
|
else:
|
||||||
raise ValidationError("未找到工单")
|
workorder_id_list = record.production_id.workorder_ids.ids
|
||||||
# self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
if record.production_id.workorder_ids:
|
||||||
# self.state = 'done'
|
for item in record.production_id.workorder_ids:
|
||||||
return {
|
if item.name == 'CNC加工':
|
||||||
'name': '排程甘特图',
|
item.date_planned_finished = datetime.now() + timedelta(days=100)
|
||||||
'type': 'ir.actions.act_window',
|
item.date_planned_start = record.date_planned_start
|
||||||
'res_model': 'sf.production.plan', # 要跳转的模型名称
|
item.date_planned_finished = item.date_planned_start + timedelta(
|
||||||
# 要显示的视图类型,可以是'form', 'tree', 'kanban', 'graph', 'calendar', 'pivot'等
|
minutes=record.env['mrp.routing.workcenter'].sudo().search(
|
||||||
'view_mode': 'gantt,tree,form',
|
[('name', '=', 'CNC加工')]).time_cycle)
|
||||||
'target': 'current', # 跳转的目标窗口,可以是'current'或'new'
|
item.duration_expected = record.env['mrp.routing.workcenter'].sudo().search(
|
||||||
}
|
[('name', '=', 'CNC加工')]).time_cycle
|
||||||
|
record.calculate_plan_time_before(item, workorder_id_list)
|
||||||
|
record.calculate_plan_time_after(item, workorder_id_list)
|
||||||
|
record.date_planned_start, record.date_planned_finished = \
|
||||||
|
item.date_planned_start, item.date_planned_finished
|
||||||
|
record.state = 'done'
|
||||||
|
record.production_id.schedule_state = '已排'
|
||||||
|
mrp_production_ids = record.production_id._get_children().ids
|
||||||
|
print('mrp_production_ids', mrp_production_ids)
|
||||||
|
for i in mrp_production_ids:
|
||||||
|
record.env['mrp.production'].browse(i).schedule_state = '已排'
|
||||||
|
# record.production_id.date_planned_start = record.date_planned_start
|
||||||
|
# record.production_id.date_planned_finished = record.date_planned_finished
|
||||||
|
else:
|
||||||
|
raise ValidationError("未找到工单")
|
||||||
|
# record.date_planned_finished = record.date_planned_start + timedelta(days=3)
|
||||||
|
# record.state = 'done'
|
||||||
|
return {
|
||||||
|
'name': '排程甘特图',
|
||||||
|
'type': 'ir.actions.act_window',
|
||||||
|
'res_model': 'sf.production.plan', # 要跳转的模型名称
|
||||||
|
# 要显示的视图类型,可以是'form', 'tree', 'kanban', 'graph', 'calendar', 'pivot'等
|
||||||
|
'view_mode': 'gantt,tree,form',
|
||||||
|
'target': 'current', # 跳转的目标窗口,可以是'current'或'new'
|
||||||
|
}
|
||||||
|
|
||||||
def calculate_plan_time_before(self, item, workorder_id_list):
|
def calculate_plan_time_before(self, item, workorder_id_list):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
<field name="name">sf.production.plan.tree</field>
|
<field name="name">sf.production.plan.tree</field>
|
||||||
<field name="model">sf.production.plan</field>
|
<field name="model">sf.production.plan</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="订单计划">
|
<tree string="订单计划" editable="bottom">
|
||||||
|
<header>
|
||||||
|
<button name="do_production_schedule" type="object" string="批量排程"/>
|
||||||
|
</header>
|
||||||
<field name="state" widget="badge" decoration-warning="state == 'draft'" decoration-success="state == 'done'"/>
|
<field name="state" widget="badge" decoration-warning="state == 'draft'" decoration-success="state == 'done'"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="origin"/>
|
<field name="origin"/>
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ access_quality_tag_group_quality_director,quality_tag_group_quality_director,qua
|
|||||||
access_quality_reason_type_group_quality,quality_reason_group_quality,quality.model_quality_reason,sf_base.group_quality,1,0,0,0
|
access_quality_reason_type_group_quality,quality_reason_group_quality,quality.model_quality_reason,sf_base.group_quality,1,0,0,0
|
||||||
access_quality_reason_type_group_quality_director,quality_reason_group_quality_director,quality.model_quality_reason,sf_base.group_quality_director,1,0,0,0
|
access_quality_reason_type_group_quality_director,quality_reason_group_quality_director,quality.model_quality_reason,sf_base.group_quality_director,1,0,0,0
|
||||||
|
|
||||||
|
access_quality_alert_stage,quality.alert.stage,quality.model_quality_alert_stage,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
@@ -22,6 +22,11 @@
|
|||||||
'views/purchase_order_view.xml',
|
'views/purchase_order_view.xml',
|
||||||
'views/quick_easy_order_view.xml'
|
'views/quick_easy_order_view.xml'
|
||||||
],
|
],
|
||||||
|
'assets': {
|
||||||
|
'web.assets_backend': [
|
||||||
|
'sf_sale/static/js/setTableWidth.js',
|
||||||
|
]
|
||||||
|
},
|
||||||
'demo': [
|
'demo': [
|
||||||
],
|
],
|
||||||
'qweb': [
|
'qweb': [
|
||||||
|
|||||||
@@ -69,8 +69,11 @@ access_purchase_order_wizard_group_purchase,purchase_order_wizard_group_purchase
|
|||||||
access_purchase_order_wizard_group_purchase_director,purchase_order_wizard_group_purchase_director,model_purchase_order_wizard,sf_base.group_purchase_director,1,1,1,0
|
access_purchase_order_wizard_group_purchase_director,purchase_order_wizard_group_purchase_director,model_purchase_order_wizard,sf_base.group_purchase_director,1,1,1,0
|
||||||
access_crm_tag_group_sale_salemanager,crm_tag_group_sale_salemanager,sales_team.model_crm_tag,sf_base.group_sale_salemanager,1,0,0,0
|
access_crm_tag_group_sale_salemanager,crm_tag_group_sale_salemanager,sales_team.model_crm_tag,sf_base.group_sale_salemanager,1,0,0,0
|
||||||
access_crm_tag_group_sale_director,crm_tag_group_sale_director,sales_team.model_crm_tag,sf_base.group_sale_director,1,1,1,0
|
access_crm_tag_group_sale_director,crm_tag_group_sale_director,sales_team.model_crm_tag,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
access_sale_order,sale.order,sale.model_sale_order,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_res_partner_group_purchase,res_partner_group_purchase,base.model_res_partner,sf_base.group_purchase,1,1,1,0
|
access_res_partner_group_purchase,res_partner_group_purchase,base.model_res_partner,sf_base.group_purchase,1,1,1,0
|
||||||
access_res_partner_group_purchase_director,res_partner_group_purchase_director,base.model_res_partner,sf_base.group_purchase_director,1,1,1,0
|
access_res_partner_group_purchase_director,res_partner_group_purchase_director,base.model_res_partner,sf_base.group_purchase_director,1,1,1,0
|
||||||
access_sale_advance_payment_inv_group_sale_salemanager,sale_advance_payment_inv_group_sale_salemanager,sale.model_sale_advance_payment_inv,sf_base.group_sale_salemanager,1,1,1,0
|
access_sale_advance_payment_inv_group_sale_salemanager,sale_advance_payment_inv_group_sale_salemanager,sale.model_sale_advance_payment_inv,sf_base.group_sale_salemanager,1,1,1,0
|
||||||
access_sale_advance_payment_inv_group_sale_director,sale_advance_payment_inv_group_sale_director,sale.model_sale_advance_payment_inv,sf_base.group_sale_director,1,1,1,0
|
access_sale_advance_payment_inv_group_sale_director,sale_advance_payment_inv_group_sale_director,sale.model_sale_advance_payment_inv,sf_base.group_sale_director,1,1,1,0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
28
sf_sale/static/js/setTableWidth.js
Normal file
28
sf_sale/static/js/setTableWidth.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
function setTableWidth() {
|
||||||
|
let timer = null
|
||||||
|
const dom = $('.o_list_renderer ')
|
||||||
|
if(!dom.length) {
|
||||||
|
timer = setTimeout(setTableWidth, 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const widthTest = '<span id="widthTest" style="width: fit-content"></span>'
|
||||||
|
$('body').append(widthTest)
|
||||||
|
clearTimeout(timer)
|
||||||
|
const tbody_tr = dom.find('tbody').children('tr')
|
||||||
|
dom.find('thead').children('tr').children().each(function () {
|
||||||
|
$('#widthTest').text($(this).text())
|
||||||
|
const width = $('#widthTest').width()
|
||||||
|
const i = $(this).index()
|
||||||
|
console.log(111)
|
||||||
|
tbody_tr.each(function () {
|
||||||
|
if($(this).children().length > 2) {
|
||||||
|
$(this).children().eq(i).css('min-width', width + 'px')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
setTableWidth()
|
||||||
|
})
|
||||||
|
|
||||||
@@ -27,6 +27,8 @@
|
|||||||
'web.assets_qweb': [
|
'web.assets_qweb': [
|
||||||
],
|
],
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
|
'sf_tool_management/static/src/change.scss'
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -791,7 +791,7 @@ class FunctionalToolAssembly(models.Model):
|
|||||||
L_D_number = fields.Float(string='L/D值(mm)', readonly=True)
|
L_D_number = fields.Float(string='L/D值(mm)', readonly=True)
|
||||||
hiding_length = fields.Float(string='避空长(mm)', readonly=True)
|
hiding_length = fields.Float(string='避空长(mm)', readonly=True)
|
||||||
|
|
||||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
# functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||||
tool_loading_person = fields.Char(string='装刀人', readonly=True)
|
tool_loading_person = fields.Char(string='装刀人', readonly=True)
|
||||||
tool_loading_time = fields.Datetime(string='装刀时间', readonly=True)
|
tool_loading_time = fields.Datetime(string='装刀时间', readonly=True)
|
||||||
remark = fields.Char(string='备注说明', readonly=True)
|
remark = fields.Char(string='备注说明', readonly=True)
|
||||||
|
|||||||
@@ -9,3 +9,13 @@
|
|||||||
.modal-content .o_list_button {
|
.modal-content .o_list_button {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.o_form_view .o_field_widget .o_list_renderer {
|
||||||
|
width: calc(100% - 64px) !important;
|
||||||
|
margin:0 auto;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.o_list_renderer .o_list_table tbody > tr > td:not(.o_list_record_selector).o_list_number {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
@@ -878,7 +878,7 @@
|
|||||||
<field name="whether_standard_knife" invisible="True"/>
|
<field name="whether_standard_knife" invisible="True"/>
|
||||||
<field name="reason_for_applying" invisible="True"/>
|
<field name="reason_for_applying" invisible="True"/>
|
||||||
<field name="functional_tool_type_id" invisible="True"/>
|
<field name="functional_tool_type_id" invisible="True"/>
|
||||||
<field name="functional_tool_cutting_type" invisible="True"/>
|
<!-- <field name="functional_tool_cutting_type" invisible="True"/>-->
|
||||||
|
|
||||||
<button string="组装"
|
<button string="组装"
|
||||||
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
||||||
@@ -900,7 +900,6 @@
|
|||||||
'default_new_former':new_former,
|
'default_new_former':new_former,
|
||||||
'default_use_tool_time':use_tool_time,
|
'default_use_tool_time':use_tool_time,
|
||||||
'default_reason_for_applying':reason_for_applying,
|
'default_reason_for_applying':reason_for_applying,
|
||||||
'default_functional_tool_cutting_type':functional_tool_cutting_type,
|
|
||||||
}"
|
}"
|
||||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
@@ -937,7 +936,6 @@
|
|||||||
'default_new_former':new_former,
|
'default_new_former':new_former,
|
||||||
'default_use_tool_time':use_tool_time,
|
'default_use_tool_time':use_tool_time,
|
||||||
'default_reason_for_applying':reason_for_applying,
|
'default_reason_for_applying':reason_for_applying,
|
||||||
'default_functional_tool_cutting_type':functional_tool_cutting_type,
|
|
||||||
}"
|
}"
|
||||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||||
class="btn-primary"/>
|
class="btn-primary"/>
|
||||||
@@ -1116,7 +1114,7 @@
|
|||||||
<field name="new_former"/>
|
<field name="new_former"/>
|
||||||
<field name="use_tool_time"/>
|
<field name="use_tool_time"/>
|
||||||
<field name="reason_for_applying"/>
|
<field name="reason_for_applying"/>
|
||||||
<field name="functional_tool_cutting_type"/>
|
<!-- <field name="functional_tool_cutting_type"/>-->
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
L_D_number = fields.Float(string='L/D值(mm)', compute='_compute_l_d_number')
|
L_D_number = fields.Float(string='L/D值(mm)', compute='_compute_l_d_number')
|
||||||
hiding_length = fields.Float(string='避空长(mm)')
|
hiding_length = fields.Float(string='避空长(mm)')
|
||||||
|
|
||||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
# functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||||
|
|
||||||
@api.onchange('integral_code_id')
|
@api.onchange('integral_code_id')
|
||||||
def _onchange_after_assembly_functional_tool_diameter(self):
|
def _onchange_after_assembly_functional_tool_diameter(self):
|
||||||
|
|||||||
@@ -190,7 +190,7 @@
|
|||||||
<field name="new_former"/>
|
<field name="new_former"/>
|
||||||
<field name="use_tool_time"/>
|
<field name="use_tool_time"/>
|
||||||
<field name="reason_for_applying"/>
|
<field name="reason_for_applying"/>
|
||||||
<field name="functional_tool_cutting_type"/>
|
<!-- <field name="functional_tool_cutting_type"/>-->
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string="组装物料信息" col="1">
|
<group string="组装物料信息" col="1">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
|
||||||
access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_warehouse.group_sf_stock_user,1,1,1,0
|
access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_warehouse.group_sf_stock_user,1,1,1,0
|
||||||
|
|
||||||
access_procurement_group,procurement.group,stock.model_procurement_group,base.group_user,1,1,1,0
|
access_procurement_group,procurement.group,stock.model_procurement_group,base.group_user,1,1,1,0
|
||||||
@@ -95,17 +96,20 @@ access_stock_lot_label_layout_user,lot.label.layout.user,stock.model_lot_label_l
|
|||||||
access_stock_replenish_option,stock.replenishment.option,stock.model_stock_replenishment_option,sf_warehouse.group_sf_stock_user,1,1,1,0
|
access_stock_replenish_option,stock.replenishment.option,stock.model_stock_replenishment_option,sf_warehouse.group_sf_stock_user,1,1,1,0
|
||||||
access_mrp_production,mrp.production,mrp.model_mrp_production,sf_warehouse.group_sf_stock_user,1,1,1,0
|
access_mrp_production,mrp.production,mrp.model_mrp_production,sf_warehouse.group_sf_stock_user,1,1,1,0
|
||||||
|
|
||||||
access_sf_shelf_location,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,0,0,0
|
access_sf_shelf_location_group_plan_dispatch,sf.shelf.location,model_sf_shelf_location,sf_base.group_plan_dispatch,1,1,0,0
|
||||||
access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_move,stock.move,stock.model_stock_move,sf_base.group_plan_dispatch,1,1,1,0
|
||||||
access_stock_scrap_user,stock.scrap.user,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_scrap_user,stock.scrap.user,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_stock_scrap_manager,stock.scrap.manager,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_scrap_manager,stock.scrap.manager,stock.model_stock_scrap,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_picking,stock.picking,stock.model_stock_picking,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_stock_lot,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,1,1,0
|
access_stock_lot_group_plan_dispatch,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_lot_group_plan_director,stock.lot,stock.model_stock_lot,sf_base.group_plan_director,1,1,1,0
|
||||||
access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,1,0,0
|
||||||
|
access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,1,1,0
|
||||||
|
|
||||||
access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,1,1,0
|
access_product_product,product.product,product.model_product_product,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,1,1,0
|
access_product_template,product.template,product.model_product_template,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
access_product_product,product.product,product.model_product_product,sf_base.group_plan_director,1,1,1,0
|
||||||
|
access_product_template,product.template,product.model_product_template,sf_base.group_plan_director,1,1,1,0
|
||||||
|
|
||||||
access_stock_inventory_conflict,stock.inventory.conflict,stock.model_stock_inventory_conflict,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_inventory_conflict,stock.inventory.conflict,stock.model_stock_inventory_conflict,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
access_stock_inventory_warning,stock.inventory.warning,stock.model_stock_inventory_warning,sf_base.group_plan_dispatch,1,0,0,0
|
access_stock_inventory_warning,stock.inventory.warning,stock.model_stock_inventory_warning,sf_base.group_plan_dispatch,1,0,0,0
|
||||||
|
|||||||
|
Reference in New Issue
Block a user