修改设备模块布局

This commit is contained in:
qihao.gong@jikimo.com
2023-07-25 17:27:11 +08:00
parent 65157e93a9
commit f246827d3d
4 changed files with 77 additions and 35 deletions

View File

@@ -94,8 +94,9 @@ class SfMaintenanceEquipment(models.Model):
control_system_id = fields.Many2one('sf.machine.control_system',
string="控制系统")
# 多个机床型号对应一个机床
type_id = fields.Many2one('sf.machine_tool.type', '型号')
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
type_id = fields.Many2one('sf.machine_tool.type', '型号')
state = fields.Selection(
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
default='正常', string="机床状态")
@@ -420,7 +421,6 @@ class SfMaintenanceEquipment(models.Model):
'company_id': self.company_id.id or self.env.company.id,
'equipment_maintenance_id': self.eq_maintenance_id.id,
'sf_maintenance_type': '保养'
}
# 拼接维保请求字符串

View File

@@ -34,10 +34,11 @@
<field name="maintenance_standards_ids" widget="ony2many">
<tree editable="top" create="true" string="维保项目">
<field name="sequence"/>
<field name="cycle"/>
<field name="device_unit"/>
<field name="name"/>
<field name="maintenance_standards"/>
<field name="device_unit"/>
<field name="cycle"/>
</tree>
</field>
</page>

View File

@@ -20,14 +20,12 @@
<notebook>
<page string="维保标准" attrs="{'invisible': [('equipment_maintenance_id', '=', False)]}">
<group>
<field name="maintenance_standards" widget="ony2many">
<tree create="False" string="维保项目">
<tree create="False">
<field name="name"/>
<field name="maintenance_standards"/>
</tree>
</field>
</group>
</page>
</notebook>

View File

@@ -17,17 +17,22 @@
<field name="model">maintenance.equipment</field>
<field name="inherit_id" ref="maintenance.hr_equipment_view_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//sheet" position="before">
<!-- <button type="object" class="oe_highlight" name='enroll_machine_tool' string="机床注册"/>-->
<field name="state_zc" widget="radio" options="{'horizontal': true}"/>
</xpath>
<xpath expr="//field[@name='maintenance_team_id']" position="before">
<field name="machine_tool_picture" widget="image"/>
</xpath>
<xpath expr="//field[@name='category_id']" position="after">
<field name="code" readonly="1"/>
<field name="equipment_type"/>
<field name="type_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}" required="1"/>
<field name="brand_id" attrs="{'invisible': [('type_id', '=', False)]}"
<field name="state" widget="radio" options="{'horizontal': true}"/>
<field name="equipment_type" invisible="1"/>
<field name="brand_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}"
force_save="1"/>
<field name="type_id" attrs="{'invisible': [('equipment_type', '!=', '机床')]}" required="1" domain="[('brand_id', '=', brand_id)]"/>
<field name="machine_tool_category" readonly="1" attrs="{'invisible': [('type_id', '=', False)]}"
force_save="1"/>
</xpath>
@@ -36,21 +41,55 @@
<group string="参数">
<group>
<field name="control_system_id" options="{'no_create': True}"/>
<field name="workbench_L"/>
<field name="workbench_W"/>
<field name="machine_tool_L"/>
<field name="machine_tool_W"/>
<field name="machine_tool_H"/>
<field name="knife_type"/>
<field name="workpiece_load"/>
<field name="lead_screw"/>
<field name="taper"/>
<field name="torque"/>
<field name="motor_power"/>
<field name="number_of_knife_library" options="{'format': false}"/>
<label for="workbench_L" string="工作台[mm]"/>
<div class="o_address_format">
<label for="workbench_L" string="长"/>
<field name="workbench_L" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="workbench_W" string="宽"/>
<field name="workbench_W" class="o_address_zip"
options="{'format': false}"/>
</div>
<!-- <field name="workbench_L"/>-->
<!-- <field name="workbench_W"/>-->
<label for="machine_tool_L" string="机床[mm]"/>
<div class="o_address_format">
<label for="machine_tool_L" string="长"/>
<field name="machine_tool_L" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="machine_tool_W" string="宽"/>
<field name="machine_tool_W" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="machine_tool_H" string="高"/>
<field name="machine_tool_H" class="o_address_zip"
options="{'format': false}"/>
</div>
<!-- <field name="machine_tool_L"/>-->
<!-- <field name="machine_tool_W"/>-->
<!-- <field name="machine_tool_H"/>-->
<label for="taper" string="主轴"/>
<div class="o_address_format">
<label for="taper" string="锥度(°)"/>
<field name="taper" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="torque" string="点击扭矩(n/m)"/>
<field name="torque" class="o_address_zip"
options="{'format': false}"/>
<span>&amp;nbsp;</span>
<label for="motor_power" string="电机功率(kw)"/>
<field name="motor_power" class="o_address_zip"
options="{'format': false}"/>
<label for="motor_power" string="转速(min)"/>
<field name="rotate_speed" class="o_address_zip"
options="{'format': false}"/>
</div>
<field name="number_of_axles" widget="radio"
options="{'horizontal': true}"/>
<field name="heightened_way"/>
<label for="x_axis" string="加工行程(mm)"
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
<div class="test_model"
@@ -79,23 +118,28 @@
attrs="{'invisible': [('number_of_axles', 'in', ['三轴','四轴'])]}"
options="{'format': false}"/>
</div>
<field name="distance"/>
<field name="precision" string="X轴定位精度(mm)"/>
<!-- <field name="taper"/>-->
<!-- <field name="torque"/>-->
<!-- <field name="motor_power"/>-->
</group>
<group>
<field name="heightened_way"/>
<field name="knife_type"/>
<field name="number_of_knife_library" options="{'format': false}"/>
<field name="tool_quality_max"/>
<field name="tool_long_max"/>
<field name="tool_diameter_max"/>
<field name="tool_speed"/>
<field name="guide_rail"/>
<field name="feed_speed"/>
<field name="tool_speed"/>
<field name="distance"/>
<field name="rotate_speed" string="主轴转速(min)"
options="{'format': false}"/>
<field name="precision" string="X轴定位精度(mm)(mm)"/>
<field name="workpiece_load"/>
<field name="lead_screw"/>
</group>
</group>
</page>
<page string="其他" attrs="{'invisible': [('type_id', '=', False)]}">
<group string="其他">
@@ -116,7 +160,6 @@
<xpath expr="//div[@class='o_row'][field[@name='maintenance_duration']]" position="after">
<field name='eq_maintenance_maintenance_standards_ids'/>
<field name='overhaul_maintenance_standards_ids'/>
<field name='overhaul_id'/>
@@ -209,9 +252,9 @@
groups="maintenance.group_equipment_manager,base.group_user"
sequence="2"/>
<!-- <record id="maintenance.hr_equipment_action" model="ir.actions.act_window">-->
<!-- <field name="active">False</field>-->
<!-- </record>-->
<!-- <record id="maintenance.hr_equipment_action" model="ir.actions.act_window">-->
<!-- <field name="active">False</field>-->
<!-- </record>-->
<!-- <menuitem-->