Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/修改机床参数bug
This commit is contained in:
@@ -132,11 +132,11 @@ td.o_required_modifier {
|
||||
//font-weight: bold;
|
||||
}
|
||||
|
||||
.text-truncate {
|
||||
overflow: unset !important;
|
||||
text-overflow: unset !important;
|
||||
white-space: nowrap!important;
|
||||
}
|
||||
//.text-truncate {
|
||||
// overflow: unset !important;
|
||||
// text-overflow: unset !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) {
|
||||
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 {
|
||||
.row {
|
||||
align-items: center;
|
||||
@@ -412,3 +414,18 @@ div:has(.o_required_modifier) > label::before {
|
||||
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 {
|
||||
width: 3.2% !important;
|
||||
width: 35px !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
'views/tool_basic_param.xml',
|
||||
'views/tool_menu.xml',
|
||||
'views/menu_fixture_view.xml',
|
||||
'views/change_base_view.xml',
|
||||
|
||||
],
|
||||
'demo': [
|
||||
|
||||
@@ -16,7 +16,7 @@ class BasicParametersFixture(models.Model):
|
||||
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='夹装单元数')
|
||||
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('是否有转位孔')
|
||||
@@ -59,10 +59,183 @@ class BasicParametersFixture(models.Model):
|
||||
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))
|
||||
|
||||
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)
|
||||
brand_id = fields.Many2one('sf.machine.brand', string="品牌")
|
||||
model_file = fields.Binary(string="3D模型图")
|
||||
status = fields.Boolean('状态')
|
||||
active = fields.Boolean('有效', default=False)
|
||||
|
||||
zero_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
@@ -45,7 +46,7 @@ class FixtureModel(models.Model):
|
||||
magnet_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='磁吸夹具基本参数')
|
||||
adapter_board_fixture_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='转接板夹具基本参数')
|
||||
string='转接板(锁板)夹具基本参数')
|
||||
scroll_chuck_ids = fields.One2many('sf.fixture.materials.basic.parameters', 'fixture_model_id',
|
||||
string='三爪卡盘基本参数')
|
||||
|
||||
@@ -67,7 +68,7 @@ class FixtureModel(models.Model):
|
||||
if fixture_material_id:
|
||||
if self.fixture_material_id.name == "气动夹具":
|
||||
code = self._get_code("JKM-C-JJWL-QDJJ-")
|
||||
elif self.fixture_material_id.name == "转接板夹具":
|
||||
elif self.fixture_material_id.name == "转接板(锁板)夹具":
|
||||
code = self._get_code("JKM-C-JJWL-ZJJJ-")
|
||||
elif self.fixture_material_id.name == "磁吸夹具":
|
||||
code = self._get_code("JKM-C-JJWL-CXJJ-")
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<record id="group_plan_director" model="res.groups">
|
||||
<field name="name">计划总监</field>
|
||||
<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 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>
|
||||
@@ -341,7 +341,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
<field name="adapter_board_fixture_ids"
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '转接板夹具')]}">
|
||||
attrs="{'invisible': [('fixture_material_type', '!=', '转接板(锁板)夹具')]}">
|
||||
<tree editable="bottom" class="center" delete="0">
|
||||
<field name="name"/>
|
||||
<field name="length"/>
|
||||
|
||||
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,6 +41,10 @@
|
||||
<field name="fixture_model_id" string="型号" placeholder="请选择"
|
||||
attrs="{'invisible': [('categ_type', '!=', '夹具')]}"
|
||||
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 name="name" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('categ_id', '!=', False)]}</attribute>
|
||||
</field>
|
||||
@@ -89,8 +93,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_product_template_only_form_inherit_sf">
|
||||
<record model="ir.ui.view" id="view_product_template_form_inherit_sf">
|
||||
<field name="name">product.template.only.form.inherit.sf</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
@@ -101,7 +104,15 @@
|
||||
<field name="default_code" position="replace">
|
||||
<field name='default_code' invisible="1"/>
|
||||
</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="刀具物料参数"
|
||||
attrs="{'invisible': [('categ_type', '!=', '刀具')],'readonly': [('categ_type', '=', '刀具')]}">
|
||||
<group>
|
||||
@@ -444,7 +455,7 @@
|
||||
<page string="切削速度Vc"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))]}">
|
||||
<field name="cutting_speed_ids" string="" widget="one2many"
|
||||
attrs="{'readonly': [('categ_type', '=', '刀具')]}">
|
||||
attrs="{'readonly': [('categ_type', '=', '刀具')]}" class="fixTableCss">
|
||||
<tree editable="bottom">
|
||||
<!-- <field name="order"/>-->
|
||||
<field name="execution_standard_id"/>
|
||||
@@ -463,6 +474,8 @@
|
||||
<field name="application"/>
|
||||
</tree>
|
||||
</field>
|
||||
<script src="/sf_dlm_management/static/js/changeCss.js"></script>
|
||||
|
||||
</page>
|
||||
<page string="每齿走刀量fz"
|
||||
attrs="{'invisible': [('cutting_tool_type', 'not in', ('整体式刀具','刀片'))],'readonly': [('categ_type', '=', '刀具')]}">
|
||||
@@ -483,64 +496,106 @@
|
||||
</notebook>
|
||||
</page>
|
||||
<page string="夹具物料参数" attrs="{'invisible': [('categ_type', '!=', '夹具')]}">
|
||||
<group attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","转接板(锁板)夹具","磁吸夹具","虎钳夹具","零点卡盘","零点托盘"))]}'>
|
||||
<group>
|
||||
<field name="brand_id"/>
|
||||
<field name="fixture_multi_mounting_type_id" options="{'no_create': True}"/>
|
||||
<label for="tool_length" string="尺寸(mm)"/>
|
||||
<div class="o_address_format">
|
||||
<label for="tool_length" string="长"/>
|
||||
<field name="tool_length" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_width" string="宽"/>
|
||||
<field name="tool_width" class="o_address_zip"
|
||||
options="{'format': false}"/>
|
||||
<!-- <span>&nbsp;</span>-->
|
||||
<label for="tool_height" string="高"/>
|
||||
<field name="tool_height" class="o_address_zip"
|
||||
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>
|
||||
<field name="brand_id" placeholder="请选择"/>
|
||||
<field name="multi_mounting_type_id" placeholder="请选择"/>
|
||||
<field name="length" string="长度(mm)"/>
|
||||
<field name="width" string="宽度(mm)"/>
|
||||
<field name="height" string="高度(mm)"/>
|
||||
<field name="height_tolerance_value"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['磁吸夹具'])]}"/>
|
||||
<field name="diameter"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['零点卡盘', '零点托盘', '三爪卡盘'])]}"/>
|
||||
<field name="weight"/>
|
||||
<field name="chucking_power_max"
|
||||
attrs="{'invisible': [('fixture_material_type', '=','磁吸夹具')]}"/>
|
||||
<field name="carrying_capacity_max"/>
|
||||
<field name="rigidity"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="materials_type_id" options="{'no_create': True}"/>
|
||||
<field name="fixture_clamping_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_port_type"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("气动夹具","磁吸夹具","虎钳夹具"))]}'/>
|
||||
<field name="fixture_through_hole_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_screw_size"
|
||||
attrs='{"invisible": [("fixture_material_type","!=",("转接板(锁板)夹具"))]}'/>
|
||||
<field name="fixture_driving_way"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("虎钳夹具","零点卡盘","零点托盘"))]}'/>
|
||||
<field name="fixture_apply_machine_tool_type_ids" options="{'no_create': True}"
|
||||
widget="many2many_tags"
|
||||
attrs='{"invisible": [("fixture_material_type","not in",("零点卡盘","零点托盘"))]}'/>
|
||||
<label for="gripper_length_min" string="夹持工件最小尺寸"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('fixture_material_type', 'not in', ['气动夹具','虎钳夹具','磁吸夹具','转接板(锁板)夹具','三爪卡盘'])]}">
|
||||
<label for="gripper_length_min" string="长"/>
|
||||
<field name="gripper_length_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_width_min" string="宽"/>
|
||||
<field name="gripper_width_min" class="o_address_zip"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="gripper_height_min" string="高"/>
|
||||
<field name="gripper_height_min" class="o_address_zip"/>
|
||||
</div>
|
||||
<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>
|
||||
</page>
|
||||
|
||||
@@ -29,44 +29,44 @@
|
||||
<field name="spindle_speed"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string='刀位统计'>
|
||||
<group>
|
||||
<group>
|
||||
<field name="tool_num_process_time1"/>
|
||||
<field name="tool_num_process_time5"/>
|
||||
<field name="tool_num_process_time9"/>
|
||||
<field name="tool_num_process_time13"/>
|
||||
<field name="tool_num_process_time17"/>
|
||||
<field name="tool_num_process_time21"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="tool_num_process_time2"/>
|
||||
<field name="tool_num_process_time6"/>
|
||||
<field name="tool_num_process_time10"/>
|
||||
<field name="tool_num_process_time14"/>
|
||||
<field name="tool_num_process_time18"/>
|
||||
<field name="tool_num_process_time22"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="tool_num_process_time3"/>
|
||||
<field name="tool_num_process_time7"/>
|
||||
<field name="tool_num_process_time11"/>
|
||||
<field name="tool_num_process_time15"/>
|
||||
<field name="tool_num_process_time19"/>
|
||||
<field name="tool_num_process_time23"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="tool_num_process_time4"/>
|
||||
<field name="tool_num_process_time8"/>
|
||||
<field name="tool_num_process_time12"/>
|
||||
<field name="tool_num_process_time16"/>
|
||||
<field name="tool_num_process_time20"/>
|
||||
<field name="tool_num_process_time24"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<!-- <group string='刀位统计'> -->
|
||||
<!-- <group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num_process_time1"/> -->
|
||||
<!-- <field name="tool_num_process_time5"/> -->
|
||||
<!-- <field name="tool_num_process_time9"/> -->
|
||||
<!-- <field name="tool_num_process_time13"/> -->
|
||||
<!-- <field name="tool_num_process_time17"/> -->
|
||||
<!-- <field name="tool_num_process_time21"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num_process_time2"/> -->
|
||||
<!-- <field name="tool_num_process_time6"/> -->
|
||||
<!-- <field name="tool_num_process_time10"/> -->
|
||||
<!-- <field name="tool_num_process_time14"/> -->
|
||||
<!-- <field name="tool_num_process_time18"/> -->
|
||||
<!-- <field name="tool_num_process_time22"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num_process_time3"/> -->
|
||||
<!-- <field name="tool_num_process_time7"/> -->
|
||||
<!-- <field name="tool_num_process_time11"/> -->
|
||||
<!-- <field name="tool_num_process_time15"/> -->
|
||||
<!-- <field name="tool_num_process_time19"/> -->
|
||||
<!-- <field name="tool_num_process_time23"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num_process_time4"/> -->
|
||||
<!-- <field name="tool_num_process_time8"/> -->
|
||||
<!-- <field name="tool_num_process_time12"/> -->
|
||||
<!-- <field name="tool_num_process_time16"/> -->
|
||||
<!-- <field name="tool_num_process_time20"/> -->
|
||||
<!-- <field name="tool_num_process_time24"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
|
||||
<!-- <div class="o_address_format"> -->
|
||||
<!-- <label for="tool_num_process_time1" string="刀位1"/> -->
|
||||
@@ -216,46 +216,46 @@
|
||||
</group>
|
||||
<!-- </group> -->
|
||||
</page>
|
||||
<page string="刀位配置">
|
||||
<group string="刀位配置">
|
||||
<group>
|
||||
<group>
|
||||
<field name="tool_num1"/>
|
||||
<field name="tool_num5"/>
|
||||
<field name="tool_num9"/>
|
||||
<field name="tool_num13"/>
|
||||
<field name="tool_num17"/>
|
||||
<field name="tool_num21"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="tool_num2"/>
|
||||
<field name="tool_num6"/>
|
||||
<field name="tool_num10"/>
|
||||
<field name="tool_num14"/>
|
||||
<field name="tool_num18"/>
|
||||
<field name="tool_num22"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="tool_num3"/>
|
||||
<field name="tool_num7"/>
|
||||
<field name="tool_num11"/>
|
||||
<field name="tool_num15"/>
|
||||
<field name="tool_num19"/>
|
||||
<field name="tool_num23"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="tool_num4"/>
|
||||
<field name="tool_num8"/>
|
||||
<field name="tool_num12"/>
|
||||
<field name="tool_num16"/>
|
||||
<field name="tool_num20"/>
|
||||
<field name="tool_num24"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<!-- <page string="刀位配置"> -->
|
||||
<!-- <group string="刀位配置"> -->
|
||||
<!-- <group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num1"/> -->
|
||||
<!-- <field name="tool_num5"/> -->
|
||||
<!-- <field name="tool_num9"/> -->
|
||||
<!-- <field name="tool_num13"/> -->
|
||||
<!-- <field name="tool_num17"/> -->
|
||||
<!-- <field name="tool_num21"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num2"/> -->
|
||||
<!-- <field name="tool_num6"/> -->
|
||||
<!-- <field name="tool_num10"/> -->
|
||||
<!-- <field name="tool_num14"/> -->
|
||||
<!-- <field name="tool_num18"/> -->
|
||||
<!-- <field name="tool_num22"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num3"/> -->
|
||||
<!-- <field name="tool_num7"/> -->
|
||||
<!-- <field name="tool_num11"/> -->
|
||||
<!-- <field name="tool_num15"/> -->
|
||||
<!-- <field name="tool_num19"/> -->
|
||||
<!-- <field name="tool_num23"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- <group> -->
|
||||
<!-- <field name="tool_num4"/> -->
|
||||
<!-- <field name="tool_num8"/> -->
|
||||
<!-- <field name="tool_num12"/> -->
|
||||
<!-- <field name="tool_num16"/> -->
|
||||
<!-- <field name="tool_num20"/> -->
|
||||
<!-- <field name="tool_num24"/> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- </group> -->
|
||||
<!-- </page> -->
|
||||
<!-- </notebook> -->
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
'data': [
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'security/ir_rule_data.xml',
|
||||
'views/maintenance_logs_views.xml',
|
||||
'views/maintenance_views.xml',
|
||||
'views/equipment_maintenance_standards_views.xml',
|
||||
|
||||
@@ -12,8 +12,12 @@ access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equi
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,sf_group_equipment_manager,1,1,1,0
|
||||
|
||||
|
||||
access_maintenance_request,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_sf_maintenance_logs,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_equipment_maintenance_standards,equipment_maintenance_standards,model_equipment_maintenance_standards,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_group_plan_dispatch,maintenance.equipment,maintenance.model_maintenance_equipment,sf_base.group_plan_dispatch,1,1,1,1
|
||||
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_group_plan_dispatch,maintenance_standard_image,model_maintenance_standard_image,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>
|
||||
@@ -137,7 +137,10 @@ class ResMrpWorkOrder(models.Model):
|
||||
"""
|
||||
检测is_ok(是否合格)被修改的话,就将当前用户赋值给inspection_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')
|
||||
def _onchange_functional_fixture_id(self):
|
||||
|
||||
@@ -486,28 +486,6 @@ class ResProductMo(models.Model):
|
||||
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([('未注册', '未注册'), ('已注册', '已注册'), ('注册失败', '注册失败')],
|
||||
string='注册状态', default='未注册')
|
||||
@@ -826,6 +804,124 @@ class ResProductMo(models.Model):
|
||||
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):
|
||||
_inherit = 'maintenance.equipment'
|
||||
_description = '设备'
|
||||
|
||||
@@ -202,8 +202,7 @@ class StockRule(models.Model):
|
||||
sale_order = self.env['sale.order'].sudo().search([('name', '=', production.origin)])
|
||||
if sale_order:
|
||||
sale_order.write({'schedule_status': 'to schedule'})
|
||||
self.env['sf.production.plan'].sudo().with_company(company_id). \
|
||||
create({
|
||||
self.env['sf.production.plan'].sudo().with_company(company_id).create({
|
||||
'name': production.name,
|
||||
'order_deadline': sale_order.deadline_of_delivery,
|
||||
'production_id': production.id,
|
||||
|
||||
@@ -903,7 +903,6 @@ class MachineToolType(models.Model):
|
||||
"jg_image_id": jg_image_id.ids,
|
||||
"lq_image_id": lq_image_id.ids,
|
||||
|
||||
|
||||
})
|
||||
else:
|
||||
machine_tool_type.update({
|
||||
@@ -1459,6 +1458,39 @@ class SyncFixtureModel(models.Model):
|
||||
for item in result['fixture_model_yesterday_list']:
|
||||
if item:
|
||||
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:
|
||||
self.create({
|
||||
"name": item['name'],
|
||||
@@ -1468,56 +1500,35 @@ class SyncFixtureModel(models.Model):
|
||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||
[('code', '=', item['multi_mounting_type_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']),
|
||||
"length": item['length'],
|
||||
"width": item['width'],
|
||||
"height": item['height'],
|
||||
"weight": item['weight'],
|
||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
||||
"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'],
|
||||
"zero_chuck_ids": zero_chuck_list,
|
||||
"zero_tray_ids": zero_tray_list,
|
||||
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||
"magnet_fixture_ids": magnet_fixture_list,
|
||||
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||
"scroll_chuck_ids": scroll_chuck_list,
|
||||
"status": item['status'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
"fixture_material_id": self.env['sf.fixture.material'].search(
|
||||
[('code', '=', item['fixture_material_code'])]).id,
|
||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||
[('code', '=', item['multi_mounting_type_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']),
|
||||
"length": item['length'],
|
||||
"width": item['width'],
|
||||
"height": item['height'],
|
||||
"weight": item['weight'],
|
||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
||||
"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'],
|
||||
"zero_chuck_ids": zero_chuck_list,
|
||||
"zero_tray_ids": zero_tray_list,
|
||||
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||
"magnet_fixture_ids": magnet_fixture_list,
|
||||
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||
"scroll_chuck_ids": scroll_chuck_list,
|
||||
"status": item['status'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
@@ -1537,6 +1548,39 @@ class SyncFixtureModel(models.Model):
|
||||
for item in result['fixture_model_all_list']:
|
||||
if item:
|
||||
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:
|
||||
self.create({
|
||||
"name": item['name'],
|
||||
@@ -1546,56 +1590,35 @@ class SyncFixtureModel(models.Model):
|
||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||
[('code', '=', item['multi_mounting_type_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']),
|
||||
"length": item['length'],
|
||||
"width": item['width'],
|
||||
"height": item['height'],
|
||||
"weight": item['weight'],
|
||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
||||
"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'],
|
||||
"zero_chuck_ids": zero_chuck_list,
|
||||
"zero_tray_ids": zero_tray_list,
|
||||
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||
"magnet_fixture_ids": magnet_fixture_list,
|
||||
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||
"scroll_chuck_ids": scroll_chuck_list,
|
||||
"status": item['status'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
fixture_model.write({
|
||||
"name": item['name'],
|
||||
"code": item['code'],
|
||||
"fixture_material_id": self.env['sf.fixture.material'].search(
|
||||
[('code', '=', item['fixture_material_code'])]).id,
|
||||
"multi_mounting_type_id": self.env['sf.multi_mounting.type'].search(
|
||||
[('code', '=', item['multi_mounting_type_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']),
|
||||
"length": item['length'],
|
||||
"width": item['width'],
|
||||
"height": item['height'],
|
||||
"weight": item['weight'],
|
||||
"clamp_workpiece_length_max": item['clamp_workpiece_length_max'],
|
||||
"clamp_workpiece_width_max": item['clamp_workpiece_width_max'],
|
||||
"clamp_workpiece_height_max": item['clamp_workpiece_height_max'],
|
||||
"clamp_workpiece_diameter_max": item['clamp_workpiece_diameter_max'],
|
||||
"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'],
|
||||
"zero_chuck_ids": zero_chuck_list,
|
||||
"zero_tray_ids": zero_tray_list,
|
||||
"pneumatic_fixture_ids": pneumatic_fixture_list,
|
||||
"jaw_vice_fixture_ids": jaw_vice_fixture_list,
|
||||
"magnet_fixture_ids": magnet_fixture_list,
|
||||
"adapter_board_fixture_ids": adapter_board_fixture_list,
|
||||
"scroll_chuck_ids": scroll_chuck_list,
|
||||
"status": item['status'],
|
||||
"active": item['active'],
|
||||
})
|
||||
else:
|
||||
|
||||
@@ -153,32 +153,37 @@ class sf_production_plan(models.Model):
|
||||
"""
|
||||
排程方法
|
||||
"""
|
||||
if not self.production_line_id:
|
||||
for record in self:
|
||||
if not record.production_line_id:
|
||||
raise ValidationError("未选择生产线")
|
||||
else:
|
||||
workorder_id_list = self.production_id.workorder_ids.ids
|
||||
if self.production_id.workorder_ids:
|
||||
for item in self.production_id.workorder_ids:
|
||||
workorder_id_list = record.production_id.workorder_ids.ids
|
||||
if record.production_id.workorder_ids:
|
||||
for item in record.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_start = record.date_planned_start
|
||||
item.date_planned_finished = item.date_planned_start + timedelta(
|
||||
minutes=self.env['mrp.routing.workcenter'].sudo().search(
|
||||
minutes=record.env['mrp.routing.workcenter'].sudo().search(
|
||||
[('name', '=', 'CNC加工')]).time_cycle)
|
||||
item.duration_expected = self.env['mrp.routing.workcenter'].sudo().search(
|
||||
item.duration_expected = record.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 = \
|
||||
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
|
||||
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
|
||||
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("未找到工单")
|
||||
# self.date_planned_finished = self.date_planned_start + timedelta(days=3)
|
||||
# self.state = 'done'
|
||||
# record.date_planned_finished = record.date_planned_start + timedelta(days=3)
|
||||
# record.state = 'done'
|
||||
return {
|
||||
'name': '排程甘特图',
|
||||
'type': 'ir.actions.act_window',
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
<field name="name">sf.production.plan.tree</field>
|
||||
<field name="model">sf.production.plan</field>
|
||||
<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="name"/>
|
||||
<field name="origin"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_quality_point_group_quality,quality_point_group_quality,quality.model_quality_point,sf_base.group_quality,1,1,1,0
|
||||
access_quality_point_group_quality_director,quality_point_group_quality_director,quality.model_quality_point,sf_base.group_quality_director,1,1,0,0
|
||||
access_quality_point_group_quality_director,quality_point_group_quality_director,quality.model_quality_point,sf_base.group_quality_director,1,1,1,0
|
||||
access_quality_point_group_plan_dispatch,quality_point_group_plan_dispatch,quality.model_quality_point,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_quality_point_group_plan_director,quality_point_group_plan_director,quality.model_quality_point,sf_base.group_plan_director,1,0,0,0
|
||||
access_quality_point_group_sf_equipment_user,quality_point_group_sf_equipment_user,quality.model_quality_point,sf_base.group_sf_equipment_user,1,0,0,0
|
||||
@@ -30,8 +30,8 @@ access_quality_alert_group_sf_mrp_manager,quality_alert_group_sf_mrp_manager,qua
|
||||
access_quality_alert_group_equipment_user,quality_alert_group_equipment_user,quality.model_quality_alert,sf_maintenance.sf_group_equipment_user,1,0,0,0
|
||||
access_quality_alert_group_equipment_manager,quality_alert_group_equipment_manager,quality.model_quality_alert,sf_maintenance.sf_group_equipment_manager,1,0,0,0
|
||||
|
||||
access_quality_alert_team_group_quality,quality_alert_team_group_quality,quality.model_quality_alert_team,sf_base.group_quality,1,1,1,0
|
||||
access_quality_alert_team_group_quality_director,quality_alert_team_group_quality_director,quality.model_quality_alert_team,sf_base.group_quality_director,1,1,0,0
|
||||
access_quality_alert_team_group_quality,quality_alert_team_group_quality,quality.model_quality_alert_team,sf_base.group_quality,1,0,0,0
|
||||
access_quality_alert_team_group_quality_director,quality_alert_team_group_quality_director,quality.model_quality_alert_team,sf_base.group_quality_director,1,1,1,0
|
||||
access_quality_alert_team_group_plan_dispatch,quality_alert_team_group_plan_dispatch,quality.model_quality_alert_team,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_quality_alert_team_group_plan_director,quality_alert_team_group_plan_director,quality.model_quality_alert_team,sf_base.group_plan_director,1,0,0,0
|
||||
access_quality_alert_team_group_sf_equipment_user,quality_alert_team_group_sf_equipment_user,quality.model_quality_alert_team,sf_base.group_sf_equipment_user,1,0,0,0
|
||||
@@ -51,18 +51,17 @@ access_product_template_group_equipment_user,product_template_group_equipment_us
|
||||
access_product_template_group_equipment_manager,product_template_group_equipment_manager,product.model_product_template,sf_maintenance.sf_group_equipment_manager,1,0,0,0
|
||||
|
||||
access_quality_alert_stage_group_quality,quality_alert_stage_group_quality,quality.model_quality_alert_stage,sf_base.group_quality,1,0,0,0
|
||||
access_quality_alert_stage_group_quality_director,quality_alert_stage_group_quality_director,quality.model_quality_alert_stage,sf_base.group_quality_director,1,0,0,0
|
||||
access_quality_alert_stage_group_quality_director,quality_alert_stage_group_quality_director,quality.model_quality_alert_stage,sf_base.group_quality_director,1,1,1,0
|
||||
|
||||
access_quality_point_test_type_group_quality,quality_point_test_type_group_quality,quality.model_quality_point_test_type,sf_base.group_quality,1,0,0,0
|
||||
access_quality_point_test_type_group_quality_director,quality_point_test_type_group_quality_director,quality.model_quality_point_test_type,sf_base.group_quality_director,1,0,0,0
|
||||
|
||||
access_quality_tag_group_quality,quality_tag_group_quality,quality.model_quality_tag,sf_base.group_quality,1,0,0,0
|
||||
access_quality_tag_group_quality_director,quality_tag_group_quality_director,quality.model_quality_tag,sf_base.group_quality_director,1,0,0,0
|
||||
access_quality_tag_group_quality_director,quality_tag_group_quality_director,quality.model_quality_tag,sf_base.group_quality_director,1,1,1,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_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/quick_easy_order_view.xml'
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'sf_sale/static/js/setTableWidth.js',
|
||||
]
|
||||
},
|
||||
'demo': [
|
||||
],
|
||||
'qweb': [
|
||||
|
||||
@@ -86,6 +86,7 @@ class ResaleOrderLine(models.Model):
|
||||
_inherit = 'sale.order.line'
|
||||
|
||||
model_glb_file = fields.Binary('模型的glb文件')
|
||||
check_status = fields.Selection(related='order_id.check_status')
|
||||
|
||||
|
||||
class RePurchaseOrder(models.Model):
|
||||
@@ -144,16 +145,30 @@ class ResPartnerToSale(models.Model):
|
||||
else:
|
||||
domain = [('id', '=', False)]
|
||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||
elif self._context.get('is_supplier'):
|
||||
if self.env.user.has_group('sf_base.group_purchase_director'):
|
||||
domain = [('supplier_rank', '>', 0)]
|
||||
elif self.env.user.has_group('sf_base.group_purchase'):
|
||||
customer = self.env['res.partner'].search(
|
||||
[('supplier_rank', '>', 0), ('user_id', '=', self.env.user.id)])
|
||||
if customer:
|
||||
ids = [t.id for t in customer]
|
||||
domain = [('id', 'in', ids)]
|
||||
else:
|
||||
domain = [('id', '=', False)]
|
||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||
return super()._name_search(name, args, operator, limit, name_get_uid)
|
||||
|
||||
@api.onchange('user_id')
|
||||
def _get_salesman(self):
|
||||
if self.customer_rank > 0:
|
||||
if self.env.user.has_group('sf_base.group_sale_salemanager'):
|
||||
self.user_id = self.env.user.id
|
||||
|
||||
@api.onchange('purchase_user_id')
|
||||
def _get_purchaseman(self):
|
||||
if self.supplier_rank > 0:
|
||||
if self.env.user.has_group('sf_base.group_purchase'):
|
||||
self.purchase_user_id = self.env.user.id
|
||||
|
||||
|
||||
@@ -166,6 +181,9 @@ class ResUserToSale(models.Model):
|
||||
if self.env.user.has_group('sf_base.group_sale_director'):
|
||||
domain = []
|
||||
elif self.env.user.has_group('sf_base.group_sale_salemanager'):
|
||||
if self.id != self.env.user.id:
|
||||
domain = [('id', '=', self.id)]
|
||||
else:
|
||||
domain = [('id', '=', self.env.user.id)]
|
||||
return self._search(domain, limit=limit, access_rights_uid=name_get_uid)
|
||||
elif self._context.get('supplier_rank'):
|
||||
|
||||
@@ -64,8 +64,9 @@
|
||||
<record model="ir.rule" id="inventory_purchase_order_rule_director">
|
||||
<field name="name">采购总监查看所有的订单</field>
|
||||
<field name="model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="domain_force">[(1,'=',1),('check_status','!=', False]</field>
|
||||
<field name="domain_force">[(1,'=',1)]</field>
|
||||
<field name="groups" eval="[(4, ref('sf_base.group_purchase_director'))]"/>
|
||||
<field name="perm_create" eval="1"/>
|
||||
<field name="perm_read" eval="1"/>
|
||||
<field name="perm_write" eval="1"/>
|
||||
</record>
|
||||
|
||||
@@ -29,6 +29,8 @@ access_mrp_bom_group_sale_salemanager,mrp_bom_group_sale_salemanager,mrp.model_m
|
||||
access_mrp_bom_group_sale_director,mrp_bom_group_sale_director,mrp.model_mrp_bom,sf_base.group_sale_director,1,0,0,0
|
||||
access_mrp_bom_group_purchase,mrp_bom_group_purchase,mrp.model_mrp_bom,sf_base.group_purchase,1,0,0,0
|
||||
access_mrp_bom_group_purchase_director,mrp_bom_group_purchase_director,mrp.model_mrp_bom,sf_base.group_purchase_director,1,0,0,0
|
||||
access_mrp_bom_group_quality,mrp_bom_group_quality,mrp.model_mrp_bom,sf_base.group_quality,1,0,0,0
|
||||
access_mrp_bom_group_quality_director,mrp_bom_group_quality_director,mrp.model_mrp_bom,sf_base.group_quality_director,1,0,0,0
|
||||
access_stock_move_group_sale_salemanager,stock_move_group_sale_salemanager,stock.model_stock_move,sf_base.group_sale_salemanager,1,0,0,0
|
||||
access_stock_move_group_sale_director,stock_move_group_sale_director,stock.model_stock_move,sf_base.group_sale_director,1,0,0,0
|
||||
access_stock_move_group_purchase,stock_move_group_purchase,stock.model_stock_move,sf_base.group_purchase,1,0,0,0
|
||||
@@ -67,3 +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_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_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_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_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()
|
||||
})
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="partner_id" position="replace">
|
||||
<field name="partner_id" widget="res_partner_many2one" context="{'is_supplier': True }"/>
|
||||
</field>
|
||||
<field name="currency_id" position="after">
|
||||
<field name="check_status" invisible="1"/>
|
||||
<!-- <field name="state"/>-->
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<form position="attributes">
|
||||
<attribute name="delete">false</attribute>
|
||||
</form>
|
||||
<field name="vat" position="after">
|
||||
<field name="customer_rank" invisible="1"/>
|
||||
<field name="supplier_rank" invisible="1"/>
|
||||
@@ -42,7 +45,7 @@
|
||||
</field>
|
||||
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
||||
<field name="user_id" widget="many2one_avatar_user" context="{'is_sale': True }"
|
||||
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('supplier_rank','>', 0)]}"/>
|
||||
attrs="{'required' : [('customer_rank','>', 0)]}"/>
|
||||
</xpath>
|
||||
<field name="category_id" position="attributes">
|
||||
<attribute name="required">1</attribute>
|
||||
@@ -69,6 +72,9 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree position="attributes">
|
||||
<attribute name="delete">false</attribute>
|
||||
</tree>
|
||||
<field name="function" position="before">
|
||||
<field name="customer_rank" invisible="1"/>
|
||||
<field name="supplier_rank" invisible="1"/>
|
||||
|
||||
@@ -36,8 +36,7 @@
|
||||
attrs="{'invisible': ['|','&',('check_status', '!=', 'approved'),('state', 'in', ['draft','cancel']),'&',('check_status', '=', 'approved'),('state', 'in', ['sale','cancel'])]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_cancel']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': ['|',('check_status', '!=', 'approved'),('schedule_status',
|
||||
'not in', ['to schedule',False])]}
|
||||
<attribute name="attrs">{'invisible': [('check_status', '=', False)]}
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//form/header/button[@name='action_draft']" position="attributes">
|
||||
@@ -63,7 +62,7 @@
|
||||
</field>
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='name']" position="before">
|
||||
<field name="model_glb_file" widget="Viewer3D" optional="show"
|
||||
string="模型文件"/>
|
||||
string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('state', 'in', ['cancel','sale'])]}</attribute>
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
'web.assets_qweb': [
|
||||
],
|
||||
'web.assets_backend': [
|
||||
'sf_tool_management/static/src/change.scss'
|
||||
|
||||
]
|
||||
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
from datetime import timedelta
|
||||
|
||||
from odoo import fields, models, api
|
||||
from odoo import SUPERUSER_ID
|
||||
from odoo.exceptions import ValidationError
|
||||
@@ -234,6 +234,7 @@ class FunctionalToolWarning(models.Model):
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = 'stock.move.line'
|
||||
_description = '功能刀具出入库记录'
|
||||
_order = 'install_tool_time desc'
|
||||
|
||||
functional_tool_name_id = fields.Many2one('sf.functional.tool.assembly', string='功能刀具名称')
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', store=True,
|
||||
@@ -253,11 +254,11 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
_name = 'sf.real.time.distribution.of.functional.tools'
|
||||
_description = '功能刀具安全库存'
|
||||
|
||||
name = fields.Char('功能刀具名称')
|
||||
sf_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型',
|
||||
name = fields.Char('功能刀具名称', readonly=False)
|
||||
sf_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=False,
|
||||
group_expand='_read_mrs_cutting_tool_type_ids', store=True)
|
||||
diameter = fields.Integer(string='刀具直径(mm)')
|
||||
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)')
|
||||
diameter = fields.Integer(string='刀具直径(mm)', readonly=False)
|
||||
knife_tip_r_angle = fields.Float(string='刀尖R角(mm)', readonly=False)
|
||||
tool_stock_num = fields.Integer(string='刀具房数量')
|
||||
side_shelf_num = fields.Integer(string='线边刀库数量')
|
||||
on_tool_stock_num = fields.Integer(string='机内刀库数量')
|
||||
@@ -266,10 +267,10 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
max_stock_num = fields.Integer('最高库存量')
|
||||
batch_replenishment_num = fields.Integer('批次补货量', readonly=True, compute='_compute_batch_replenishment_num')
|
||||
unit = fields.Char('单位')
|
||||
image = fields.Binary('图片')
|
||||
image = fields.Binary('图片', readonly=False)
|
||||
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精')
|
||||
whether_standard_knife = fields.Boolean(string='是否标准刀', default=True)
|
||||
coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=False)
|
||||
whether_standard_knife = fields.Boolean(string='是否标准刀', default=True, readonly=False)
|
||||
# 能力特征信息
|
||||
suitable_machining_method_ids = fields.Many2many(
|
||||
'maintenance.equipment.image', 'rel_machining_product_template_distribution', '适合加工方式',
|
||||
@@ -299,7 +300,7 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
@api.constrains('min_stock_num', 'max_stock_num')
|
||||
def _check_stock_num(self):
|
||||
for obj in self:
|
||||
if obj.min_stock_num > obj.min_stock_num:
|
||||
if obj.min_stock_num > obj.max_stock_num:
|
||||
raise ValidationError('【最低安全库存】不能高于【最高安全库存】!!!')
|
||||
|
||||
@api.model
|
||||
@@ -326,31 +327,31 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
if tool.tool_stock_total < tool.min_stock_num:
|
||||
tool.batch_replenishment_num = tool.max_stock_num - tool.tool_stock_total
|
||||
# 根据判断创建功能刀具组装单
|
||||
if not tool.sf_functional_tool_assembly_ids:
|
||||
if not tool.sf_functional_tool_assembly_ids and re.match(r'^\d+$', str(tool.id)):
|
||||
for i in range(tool.batch_replenishment_num):
|
||||
tool.create_functional_tool_assembly()
|
||||
tool.create_functional_tool_assembly(tool)
|
||||
print(i, ": ", tool.sf_functional_tool_assembly_ids)
|
||||
else:
|
||||
tool.batch_replenishment_num = 0
|
||||
|
||||
def create_functional_tool_assembly(self):
|
||||
def create_functional_tool_assembly(self, tool):
|
||||
"""
|
||||
创建功能刀具组装单
|
||||
"""
|
||||
functional_tool_assembly = self.env['sf.functional.tool.assembly'].sudo().create({
|
||||
'functional_tool_name': self.name,
|
||||
'functional_tool_type_id': self.sf_cutting_tool_type_id.id,
|
||||
'functional_tool_diameter': self.diameter,
|
||||
'knife_tip_r_angle': self.knife_tip_r_angle,
|
||||
'coarse_middle_thin': self.coarse_middle_thin,
|
||||
functional_tool_assembly = tool.env['sf.functional.tool.assembly'].sudo().create({
|
||||
'functional_tool_name': tool.name,
|
||||
'functional_tool_type_id': tool.sf_cutting_tool_type_id.id,
|
||||
'functional_tool_diameter': tool.diameter,
|
||||
'knife_tip_r_angle': tool.knife_tip_r_angle,
|
||||
'coarse_middle_thin': tool.coarse_middle_thin,
|
||||
'loading_task_source': '2',
|
||||
'use_tool_time': fields.Datetime.now() + timedelta(hours=4),
|
||||
'applicant': '系统自动',
|
||||
'apply_time': fields.Datetime.now(),
|
||||
'whether_standard_knife': self.whether_standard_knife,
|
||||
'whether_standard_knife': tool.whether_standard_knife,
|
||||
'reason_for_applying': '安全库存',
|
||||
})
|
||||
self.sf_functional_tool_assembly_ids = [(4, functional_tool_assembly.id)]
|
||||
tool.sf_functional_tool_assembly_ids = [(4, functional_tool_assembly.id)]
|
||||
|
||||
def estimate_functional_tool_assembly_ids(self, tool):
|
||||
"""
|
||||
@@ -394,6 +395,15 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
vals['sf_functional_cutting_tool_entity_ids'] = sf_functional_cutting_tool_entity_ids.ids
|
||||
self.env['sf.real.time.distribution.of.functional.tools'].create(vals)
|
||||
|
||||
status_create = fields.Boolean('是否是新增状态', default=True)
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
vals['status_create'] = False
|
||||
records = super(RealTimeDistributionOfFunctionalTools, self).create(vals_list)
|
||||
return records
|
||||
|
||||
|
||||
class MachineTableToolChangingApply(models.Model):
|
||||
_name = 'sf.machine.table.tool.changing.apply'
|
||||
@@ -781,7 +791,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
L_D_number = fields.Float(string='L/D值(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_time = fields.Datetime(string='装刀时间', readonly=True)
|
||||
remark = fields.Char(string='备注说明', readonly=True)
|
||||
|
||||
@@ -9,3 +9,13 @@
|
||||
.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;
|
||||
}
|
||||
@@ -310,22 +310,29 @@
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
<field name="name" attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
</h1>
|
||||
</div>
|
||||
<field name="status_create" invisible="1"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="sf_cutting_tool_type_id" readonly="1"/>
|
||||
<field name="diameter" readonly="1"/>
|
||||
<field name="knife_tip_r_angle" readonly="1"/>
|
||||
<field name="coarse_middle_thin" readonly="1"/>
|
||||
<field name="whether_standard_knife" readonly="1"/>
|
||||
<field name="sf_cutting_tool_type_id"
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
<field name="diameter"
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
<field name="knife_tip_r_angle"
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
<field name="coarse_middle_thin"
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
<field name="whether_standard_knife"
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
<field name="min_stock_num"/>
|
||||
<field name="max_stock_num"/>
|
||||
<field name="batch_replenishment_num"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="image" widget='image' readonly="1"/>
|
||||
<field name="image" widget='image'
|
||||
attrs="{'readonly': [('status_create', '=', False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1">
|
||||
@@ -366,7 +373,7 @@
|
||||
<field name="barcode_id"/>
|
||||
<field name="functional_tool_name_id"/>
|
||||
<field name="new_former"/>
|
||||
<field name="tool_loading_length" string="总长度"/>
|
||||
<field name="tool_loading_length" string="总长度(mm)"/>
|
||||
<field name="functional_tool_length"/>
|
||||
<field name="effective_length"/>
|
||||
<field name="max_lifetime_value"/>
|
||||
@@ -871,7 +878,7 @@
|
||||
<field name="whether_standard_knife" invisible="True"/>
|
||||
<field name="reason_for_applying" 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="组装"
|
||||
name="%(sf_tool_management.sf_functional_tool_assembly_order_act)d"
|
||||
@@ -893,7 +900,6 @@
|
||||
'default_new_former':new_former,
|
||||
'default_use_tool_time':use_tool_time,
|
||||
'default_reason_for_applying':reason_for_applying,
|
||||
'default_functional_tool_cutting_type':functional_tool_cutting_type,
|
||||
}"
|
||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||
class="btn-primary"/>
|
||||
@@ -930,7 +936,6 @@
|
||||
'default_new_former':new_former,
|
||||
'default_use_tool_time':use_tool_time,
|
||||
'default_reason_for_applying':reason_for_applying,
|
||||
'default_functional_tool_cutting_type':functional_tool_cutting_type,
|
||||
}"
|
||||
attrs="{'invisible': [('assemble_status', '!=', '0')]}"
|
||||
class="btn-primary"/>
|
||||
@@ -1109,7 +1114,7 @@
|
||||
<field name="new_former"/>
|
||||
<field name="use_tool_time"/>
|
||||
<field name="reason_for_applying"/>
|
||||
<field name="functional_tool_cutting_type"/>
|
||||
<!-- <field name="functional_tool_cutting_type"/>-->
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
@@ -330,7 +330,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
L_D_number = fields.Float(string='L/D值(mm)', compute='_compute_l_d_number')
|
||||
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')
|
||||
def _onchange_after_assembly_functional_tool_diameter(self):
|
||||
@@ -537,6 +537,8 @@ class StockPicking(models.Model):
|
||||
self.env['stock.move.line'].create({
|
||||
'picking_id': picking_id.id,
|
||||
'product_id': stock_lot.product_id.id,
|
||||
'location_id': picking_id.location_id.id,
|
||||
'location_dest_id': picking_id.location_dest_id.id,
|
||||
'lot_id': stock_lot.id,
|
||||
'qty_done': 1,
|
||||
'functional_tool_name_id': functional_tool_assembly.id
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<field name="new_former"/>
|
||||
<field name="use_tool_time"/>
|
||||
<field name="reason_for_applying"/>
|
||||
<field name="functional_tool_cutting_type"/>
|
||||
<!-- <field name="functional_tool_cutting_type"/>-->
|
||||
</group>
|
||||
</group>
|
||||
<group string="组装物料信息" col="1">
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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_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_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_stock_move,stock.move,stock.model_stock_move,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,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_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_lot,stock.lot,stock.model_stock_lot,sf_base.group_plan_dispatch,1,1,1,0
|
||||
access_stock_warehouse_orderpoint,stock.warehouse.orderpoint,stock.model_stock_warehouse_orderpoint,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_stock_quant,stock.quant,stock.model_stock_quant,sf_base.group_plan_dispatch,1,0,0,0
|
||||
access_stock_lot_group_plan_dispatch,stock.lot,stock.model_stock_lot,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_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_template,product.template,product.model_product_template,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,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_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