Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/bug修复
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
}
|
||||
|
||||
.test_model > .o_form_label {
|
||||
margin-left: 20px;
|
||||
margin-left: 0px !important;
|
||||
margin-right: 0px !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -159,20 +159,22 @@ td.o_required_modifier {
|
||||
}
|
||||
|
||||
.o_list_view .o_list_table thead {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
//z-index: 100000;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
//z-index: 100000;
|
||||
}
|
||||
|
||||
//.o_list_view .o_list_table {
|
||||
// height: 1799px !important;
|
||||
//}
|
||||
.table-responsive {
|
||||
overflow: unset;
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
.o_form_view.o_xxl_form_view .o_form_sheet_bg > .o_form_statusbar {
|
||||
position: sticky !important;
|
||||
top: 0;
|
||||
//z-index: 100000;
|
||||
position: sticky !important;
|
||||
top: 0;
|
||||
//z-index: 100000;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
@@ -253,7 +255,7 @@ div[class="o_content o_component_with_search_panel"] .show_state span {
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
position: absolute;
|
||||
top: 55px;
|
||||
right: 263px;
|
||||
right: 43.5%;
|
||||
}
|
||||
//------------------------------------------
|
||||
|
||||
@@ -262,3 +264,44 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
||||
line-height: 0 !important;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px) {
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
right: 52%;
|
||||
}
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
|
||||
left: -95px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom {
|
||||
// display: flex !important;
|
||||
// flex-direction: column;
|
||||
//}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom > div:nth-child(1) > span:nth-child(1) {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
|
||||
}
|
||||
|
||||
.o_kanban_renderer .o_kanban_record .o_kanban_record_bottom > div:nth-child(1) {
|
||||
margin-top: -5px;
|
||||
margin-bottom: 5px;
|
||||
|
||||
}
|
||||
|
||||
.text-bg-warning {
|
||||
background-color: #FED300 !important;
|
||||
}
|
||||
|
||||
.test_model>div {
|
||||
display: flex;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.test_model>div .o_field_widget {
|
||||
width: 40% !important;
|
||||
}
|
||||
@@ -127,19 +127,6 @@ class MrsProcessingOrder(models.Model):
|
||||
index=True, string='加工工艺')
|
||||
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||
|
||||
|
||||
# class Tray(models.Model):
|
||||
# _name = 'sf.tray'
|
||||
# _description = '托盘'
|
||||
#
|
||||
# code = fields.Char('编码', copy=False)
|
||||
# name = fields.Char('名称')
|
||||
# state = fields.Selection(
|
||||
# [("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
||||
# default="空闲", string="状态")
|
||||
# active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class SupplierSort(models.Model):
|
||||
_name = 'sf.supplier.sort'
|
||||
_description = '供应商排序'
|
||||
|
||||
@@ -361,26 +361,5 @@
|
||||
</record>
|
||||
|
||||
|
||||
<!-- <record model="ir.ui.view" id="sf_tray_form">-->
|
||||
<!-- <field name="name">sf.tray.form</field>-->
|
||||
<!-- <field name="model">sf.tray</field>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <form string="托盘">-->
|
||||
<!-- <header>-->
|
||||
<!-- <field name='state' widget="radio" options="{'horizontal': True}"/>-->
|
||||
<!-- </header>-->
|
||||
<!-- <sheet>-->
|
||||
<!-- <group name="group1">-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="code" required="1"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name="name" required="1"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- </group>-->
|
||||
<!-- </sheet>-->
|
||||
<!-- </form>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -33,9 +33,9 @@
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'sf_machine_connect/static/src/xml/barcode_button.xml',
|
||||
'sf_machine_connect/static/src/js/barcode_button.js',
|
||||
'sf_machine_connect/static/src/css/barcode_button.css',
|
||||
# 'sf_machine_connect/static/src/xml/barcode_button.xml',
|
||||
# 'sf_machine_connect/static/src/js/barcode_button.js',
|
||||
# 'sf_machine_connect/static/src/css/barcode_button.css',
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
@@ -15,13 +15,31 @@ class SfEquipmentSaintenanceStandards(models.Model):
|
||||
num = "%04d" % 1
|
||||
|
||||
else:
|
||||
m = int(partner.code) + 1
|
||||
m = int(partner.code[-4:]) + 1
|
||||
num = "%04d" % m
|
||||
return num
|
||||
code = fields.Char(string='编码', default=get_no)
|
||||
code = fields.Char(string='编码')
|
||||
remark = fields.Char('备注')
|
||||
maintenance_type = fields.Selection([('保养', '保养'), ("检修", "检修")], string='类型', default='保养')
|
||||
name = fields.Char(string='名称')
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if not vals['code']:
|
||||
if vals['maintenance_type']:
|
||||
if vals['maintenance_type'] == '保养':
|
||||
vals['code'] = 'BY' + self.get_no()
|
||||
else:
|
||||
vals['code'] = 'JX' + self.get_no()
|
||||
if not vals['name']:
|
||||
if vals['maintenance_equipment_category_id']:
|
||||
ma_name = self.env['maintenance.equipment.category'].sudo().search(
|
||||
[('id', '=', vals['maintenance_equipment_category_id'])]).name
|
||||
vals['name'] = ma_name + '-' + vals['maintenance_type'] + '标准-' + vals[
|
||||
'code']
|
||||
return super().create(vals_list)
|
||||
|
||||
created_user_id = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
maintenance_equipment_category_id = fields.Many2one('maintenance.equipment.category', string='设备类别')
|
||||
maintenance_equipment_ids = fields.Many2many(
|
||||
|
||||
@@ -14,7 +14,7 @@ class SfMaintenanceEquipmentCategory(models.Model):
|
||||
_inherit = 'maintenance.equipment.category'
|
||||
_description = '设备类别'
|
||||
|
||||
equipment_type = fields.Selection([('机床', '机床')], string='类型', default='机床')
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')], string='类型', default='机床')
|
||||
|
||||
|
||||
class SfMaintenanceEquipment(models.Model):
|
||||
@@ -65,7 +65,7 @@ class SfMaintenanceEquipment(models.Model):
|
||||
|
||||
MTcode = fields.Char("编码", default=get_no)
|
||||
created_user = fields.Many2one('res.users', string='创建人', default=lambda self: self.env.user)
|
||||
equipment_type = fields.Selection([('机床', '机床')], compute='_compute_category_id')
|
||||
equipment_type = fields.Selection([('机床', '机床'), ('机器人', '机器人'), ('AGV小车', 'AGV小车'), ('检测设备', '检测设备')], compute='_compute_category_id')
|
||||
|
||||
@api.depends('category_id')
|
||||
def _compute_category_id(self):
|
||||
@@ -235,6 +235,97 @@ class SfMaintenanceEquipment(models.Model):
|
||||
item.machine_tool_category = item.type_id.machine_tool_category.id
|
||||
item.brand_id = item.type_id.brand_id.id
|
||||
|
||||
# AGV小车设备参数
|
||||
AGV_L = fields.Char('设备尺寸(长)')
|
||||
AGV_W = fields.Char('设备尺寸(宽)')
|
||||
AGV_H = fields.Char('设备尺寸(高)')
|
||||
AGV_goods_L = fields.Char('载货尺寸(长)')
|
||||
AGV_goods_W = fields.Char('载货尺寸(宽)')
|
||||
AGV_goods_H = fields.Char('载货尺寸(高)')
|
||||
AGV_velocity = fields.Char('标准速度')
|
||||
AGV_velocity_min = fields.Char('标准速度(最小)')
|
||||
AGV_velocity_max = fields.Char('标准速度(最大)')
|
||||
AGV_Lifting_height = fields.Char('升降高度(max)')
|
||||
AGV_ground_clearance = fields.Char('最小离地高度')
|
||||
AGV_turning_radius = fields.Char('最小转弯半径')
|
||||
AGV_gradeability_max = fields.Integer('最大爬坡度')
|
||||
AGV_parking_accuracy = fields.Char('停车精度')
|
||||
AGV_load_weight_max = fields.Char('最大负载重量')
|
||||
AGV_weight = fields.Char('本体总重量')
|
||||
AGV_job_duration = fields.Char('连续作业时长')
|
||||
AGV_transfer_mode = fields.Char('移载方式')
|
||||
AGV_drive_motor_power = fields.Char('驱动电机功率')
|
||||
AGV_hoist_motor_power = fields.Char('提升电机功率')
|
||||
AGV_drive_motor_speed_ratio = fields.Char('驱动电机速比')
|
||||
AGV_veer_motor_power = fields.Char('转向电机功率')
|
||||
AGV_veer_motor_speed_ratio = fields.Char('转向电机速比')
|
||||
AGV_move_motor_power = fields.Char('前移电机功率')
|
||||
AGV_move_motor_speed_ratio = fields.Char('前移电机速比')
|
||||
AGV_drive_mode = fields.Char('驱动方式')
|
||||
AGV_navigation_mode = fields.Char('导航方式')
|
||||
AGV_communication_mode = fields.Char('通讯方式')
|
||||
AGV_direction_travel = fields.Char('行走方向')
|
||||
AGV_power_requirements = fields.Char('电源要求')
|
||||
AGV_charge_mode = fields.Selection([('手动', '手动'), ('自动', '自动')], string='充电方式')
|
||||
AGV_security = fields.Char('安全防护')
|
||||
AGV_operating_temperature = fields.Char('环境温度')
|
||||
AGV_operating_humidity = fields.Char('环境湿度')
|
||||
|
||||
# 三元检测设备参数
|
||||
detect_L = fields.Char('设备尺寸(长)')
|
||||
detect_W = fields.Char('设备尺寸(宽)')
|
||||
detect_H = fields.Char('设备尺寸(高)')
|
||||
detect_x_axis = fields.Char('X轴')
|
||||
detect_y_axis = fields.Char('Y轴')
|
||||
detect_z_axis = fields.Char('Z轴')
|
||||
detect_precision = fields.Char('测量精度')
|
||||
detect_measurement_mode = fields.Selection([('光栅尺', '光栅尺'), ('容栅', '容栅'), ('磁栅', '磁栅'), ('激光干涉仪', '激光干涉仪')], string='测量方式')
|
||||
detect_resolution = fields.Char('分辨率')
|
||||
detect_load_weight_max = fields.Char('最大负载重量')
|
||||
detect_weight = fields.Char('本体总重量')
|
||||
detect_measurement_length = fields.Char('深孔测量长度(max)')
|
||||
detect_control_mode = fields.Char('控制方式')
|
||||
detect_balance_mode_for_Z = fields.Char('Z轴平衡方式')
|
||||
detect_zoom_objective_magnification = fields.Char('变焦物镜倍率')
|
||||
detect_magnification = fields.Char('放大倍率')
|
||||
detect_working_distance = fields.Char('工作距离')
|
||||
detect_locking_mode = fields.Char('锁紧方式')
|
||||
detect_pressurized_air = fields.Char('压缩空气')
|
||||
detect_object_field_of_view_max = fields.Char('物方视场(最大)')
|
||||
detect_object_field_of_view_min = fields.Char('物方视场(最小)')
|
||||
detect_power_requirements = fields.Char('电源要求')
|
||||
detect_operating_temperature = fields.Char('环境温度')
|
||||
detect_operating_humidity = fields.Char('环境湿度')
|
||||
|
||||
# 机器人设备参数
|
||||
robot_gripping_of_workpieces_L = fields.Char('可抓取工件(长)')
|
||||
robot_gripping_of_workpieces_W = fields.Char('可抓取工件(宽)')
|
||||
robot_gripping_of_workpieces_H = fields.Char('可抓取工件(高)')
|
||||
robot_radius_of_the_boom = fields.Char('展臂半径')
|
||||
robot_load_weight_max = fields.Char('最大负载重量')
|
||||
robot_weight = fields.Char('本体总重量')
|
||||
robot_repeatable_positioning_accuracy = fields.Char('重复定位精度')
|
||||
robot_axis_num = fields.Selection([('2轴', '2轴'), ('3轴', '3轴'), ('4轴', '4轴'), ('5轴', '5轴'), ('6轴', '6轴'), ('7轴', '7轴'), ('8轴', '8轴')], string='轴数')
|
||||
axis_ids = fields.One2many('sf.robot.axis.num', 'equipment_id', string='动作范围')
|
||||
robot_track_dimensions_L = fields.Char('轨道尺寸(长)')
|
||||
robot_track_dimensions_W = fields.Char('轨道尺寸(宽)')
|
||||
robot_track_dimensions_H = fields.Char('轨道尺寸(高)')
|
||||
robot_drive_mode = fields.Char('驱动方式')
|
||||
robot_installation_method = fields.Selection([('置地式', '置地式'), ('壁挂式', '壁挂式'), ('倒挂式', '倒挂式')], string='安装方式')
|
||||
robot_operating_temperature = fields.Char('环境温度')
|
||||
robot_operating_humidity = fields.Char('环境湿度')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# 注册同步机床
|
||||
def enroll_machine_tool(self):
|
||||
sf_sync_config = self.env['res.config.settings'].get_values()
|
||||
@@ -517,3 +608,16 @@ class MaintenanceStandardImage(models.Model):
|
||||
new_res.append([id, name, data_uri])
|
||||
# 返回新的结果列表
|
||||
return new_res
|
||||
|
||||
class SfRobotAxisNum(models.Model):
|
||||
_name = 'sf.robot.axis.num'
|
||||
_description = '机器人轴参数'
|
||||
|
||||
name = fields.Char('*轴')
|
||||
angle_min = fields.Char('最小角度-(°)')
|
||||
angle_max = fields.Char('最大角度+(°)')
|
||||
velocity = fields.Char('最大速度(°/s)')
|
||||
weight = fields.Char('最大负载(kg)')
|
||||
permissible_load_torque = fields.Char('允许负载扭矩(N-m)')
|
||||
permissible_inertial_torque = fields.Char('允许惯性扭矩(kg-m²)')
|
||||
equipment_id = fields.Many2one('maintenance.equipment', string='机器人', domain="[('equipment_type', '=', '机器人')]")
|
||||
|
||||
@@ -5,6 +5,7 @@ access_maintenance_equipment,maintenance_equipment,model_maintenance_equipment,b
|
||||
access_maintenance_standards,maintenance_standards,model_maintenance_standards,base.group_user,1,1,1,1
|
||||
access_maintenance_standard_image,maintenance_standard_image,model_maintenance_standard_image,base.group_user,1,1,1,1
|
||||
access_maintenance_equipment_image,maintenance_equipment_image,model_maintenance_equipment_image,base.group_user,1,1,1,1
|
||||
access_sf_robot_axis_num,sf_robot_axis_num,model_sf_robot_axis_num,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="code" readonly="1" force_save="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="name" readonly="1" force_save="1"/>
|
||||
<field name="maintenance_equipment_category_id" required="1"/>
|
||||
<field name="eq_maintenance_ids" invisible='1'/>
|
||||
<field name="overhaul_ids" invisible='1'/>
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
force_save="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='description']" position="before">
|
||||
<page string="设备参数" name="sf_equipment" attrs="{'invisible': [('type_id', '=', False)]}">
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机床')]}">
|
||||
<group>
|
||||
<group string="基本参数">
|
||||
<field name="control_system_id" required="1" options="{'no_create': True}"/>
|
||||
@@ -177,6 +178,565 @@
|
||||
|
||||
</page>
|
||||
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', 'AGV小车')]}">
|
||||
<group string="AGV基础参数">
|
||||
<label for="AGV_L" string="设备尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="AGV_L" string="长"/>
|
||||
<field name="AGV_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="AGV_W" string="宽"/>
|
||||
<field name="AGV_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="AGV_H" string="高"/>
|
||||
<field name="AGV_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<label for="AGV_goods_L" string="载货尺寸MAX(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="AGV_goods_L" string="长"/>
|
||||
<field name="AGV_goods_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="AGV_goods_W" string="宽"/>
|
||||
<field name="AGV_goods_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="AGV_goods_H" string="宽"/>
|
||||
<field name="AGV_goods_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<label for="AGV_velocity" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="AGV_velocity" string="标准速度"/>
|
||||
<field name="AGV_velocity" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>m/S&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_velocity_min" string="标准速度(最小)"/>
|
||||
<field name="AGV_velocity_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>m/S&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_velocity_max" string="标准速度(最大)"/>
|
||||
<field name="AGV_velocity_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>m/S&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_Lifting_height" string="升降高度(max)"/>
|
||||
<field name="AGV_Lifting_height" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<label for="AGV_ground_clearance" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
<div>
|
||||
<label for="AGV_ground_clearance" string="最小离地高度"/>
|
||||
|
||||
<field name="AGV_ground_clearance" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_turning_radius" string="最小转弯半径"/>
|
||||
<field name="AGV_turning_radius" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_gradeability_max" string="最大爬坡度"/>
|
||||
<field name="AGV_gradeability_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_parking_accuracy" string="停车精度"/>
|
||||
<field name="AGV_parking_accuracy" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<label for="AGV_load_weight_max" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
<div>
|
||||
<label for="AGV_load_weight_max" string="最大负载重量"/>
|
||||
|
||||
<field name="AGV_load_weight_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_weight" string="本体总重量"/>
|
||||
|
||||
<field name="AGV_weight" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_job_duration" string="连续作业时长"/>
|
||||
|
||||
<field name="AGV_job_duration" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>h&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_transfer_mode" string="移载方式"/>
|
||||
|
||||
<field name="AGV_transfer_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <label for="AGV_parking_accuracy" string="停车精度"/>-->
|
||||
<!-- <field name="AGV_parking_accuracy" class="o_address_zip" required="1"-->
|
||||
<!-- options="{'format': false}"/>mm-->
|
||||
|
||||
|
||||
</group>
|
||||
<group string="电机参数">
|
||||
|
||||
<label for="control_system_id" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
<div>
|
||||
<label for="control_system_id" string="控制系统"/>
|
||||
|
||||
<field name="control_system_id" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_drive_motor_power" string="驱动电机功率"/>
|
||||
|
||||
<field name="AGV_drive_motor_power" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kw&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_hoist_motor_power" string="提升电机功率"/>
|
||||
|
||||
<field name="AGV_hoist_motor_power" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>i&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_drive_motor_speed_ratio" string="驱动电机速比"/>
|
||||
|
||||
<field name="AGV_drive_motor_speed_ratio" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kw&nbsp;</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label for="AGV_veer_motor_power" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
<div>
|
||||
<label for="AGV_veer_motor_power" string="转向电机功率"/>
|
||||
|
||||
<field name="AGV_veer_motor_power" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kw&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="AGV_veer_motor_speed_ratio" string="转向电机速比"/>
|
||||
|
||||
<field name="AGV_veer_motor_speed_ratio" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>i&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_move_motor_power" string="前移电机功率"/>
|
||||
|
||||
<field name="AGV_move_motor_power" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kw&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_move_motor_speed_ratio" string="前移电机速比"/>
|
||||
|
||||
<field name="AGV_move_motor_speed_ratio" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>i&nbsp;</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</group>
|
||||
|
||||
<group string="其他参数">
|
||||
<label for="AGV_drive_mode" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
<div>
|
||||
<label for="AGV_drive_mode" string="驱动方式"/>
|
||||
|
||||
<field name="AGV_drive_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
<label for="AGV_navigation_mode" string="导航方式"/>
|
||||
|
||||
|
||||
<field name="AGV_navigation_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<div>
|
||||
|
||||
<label for="AGV_communication_mode" string="通讯方式"/>
|
||||
|
||||
|
||||
<field name="AGV_communication_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="AGV_direction_travel" string="行走方向"/>
|
||||
|
||||
<field name="AGV_direction_travel" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<label for="AGV_power_requirements" string=""/>
|
||||
<div class="test_model">
|
||||
|
||||
|
||||
<label for="AGV_power_requirements" string="电源要求"/>
|
||||
|
||||
<field name="AGV_power_requirements" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
|
||||
|
||||
<label for="AGV_charge_mode" string="充电方式"/>
|
||||
|
||||
<field name="AGV_charge_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
|
||||
|
||||
<label for="AGV_security" string="安全防护"/>
|
||||
|
||||
<field name="AGV_security" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
|
||||
</div>
|
||||
<label for="AGV_operating_temperature" string="工作条件"/>
|
||||
<div class="test_model">
|
||||
|
||||
|
||||
<label for="AGV_operating_temperature" string="环境温度"/>
|
||||
|
||||
<field name="AGV_operating_temperature" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
|
||||
|
||||
<label for="AGV_operating_humidity" string="环境湿度"/>
|
||||
|
||||
<field name="AGV_operating_humidity" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</group>
|
||||
</page>
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', '机器人')]}">
|
||||
<group string="机器人设备参数">
|
||||
<label for="robot_gripping_of_workpieces_L" string="抓取工件最大尺寸"/>
|
||||
<div class="test_model">
|
||||
<label for="robot_gripping_of_workpieces_L" string="长"/>
|
||||
<field name="robot_gripping_of_workpieces_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="robot_gripping_of_workpieces_W" string="宽"/>
|
||||
<field name="robot_gripping_of_workpieces_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="robot_gripping_of_workpieces_H" string="高"/>
|
||||
<field name="robot_gripping_of_workpieces_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
|
||||
<label for="robot_radius_of_the_boom" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="robot_radius_of_the_boom" string="展臂半径"/>
|
||||
<field name="robot_radius_of_the_boom" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="robot_load_weight_max" string="最大负载重量"/>
|
||||
<field name="robot_load_weight_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="robot_gripping_of_workpieces_H" string="本体总重量"/>
|
||||
<field name="robot_gripping_of_workpieces_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="robot_repeatable_positioning_accuracy" string="重复定位精度"/>
|
||||
<field name="robot_repeatable_positioning_accuracy" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<field name = 'robot_axis_num'/>
|
||||
|
||||
<field name = 'axis_ids' widget="One2many">
|
||||
<tree editable='bottom'>
|
||||
<field name="name"/>
|
||||
<field name="angle_min"/>
|
||||
<field name="angle_max"/>
|
||||
<field name="velocity"/>
|
||||
<field name="weight"/>
|
||||
<field name="permissible_load_torque"/>
|
||||
<field name="permissible_inertial_torque"/>
|
||||
</tree>
|
||||
</field>
|
||||
<label for="robot_track_dimensions_L" string="轨道尺寸"/>
|
||||
<div class="test_model">
|
||||
<label for="robot_track_dimensions_L" string="长"/>
|
||||
<field name="robot_track_dimensions_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="robot_track_dimensions_W" string="宽"/>
|
||||
<field name="robot_track_dimensions_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="robot_track_dimensions_H" string="高"/>
|
||||
<field name="robot_track_dimensions_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
<label for="control_system_id" string=""/>
|
||||
<div class="test_model">
|
||||
<label for="control_system_id" string="控制系统"/>
|
||||
<field name="control_system_id" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="robot_drive_mode" string="驱动方式"/>
|
||||
<field name="robot_drive_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
<label for="robot_installation_method" string="安装方式"/>
|
||||
<field name="robot_installation_method" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<label for="robot_operating_temperature" string="工作条件"/>
|
||||
<div class="test_model">
|
||||
<label for="robot_operating_temperature" string="环境温度"/>
|
||||
<field name="robot_operating_temperature" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
<label for="robot_operating_humidity" string="环境湿度"/>
|
||||
<field name="robot_operating_humidity" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</group>
|
||||
</page>
|
||||
<page string="设备参数" name="sf_equipment"
|
||||
attrs="{'invisible': [('equipment_type', '!=', '检测设备')]}">
|
||||
<group string="三元检测设备基础参数">
|
||||
<label for="detect_L" string="设备尺寸(mm)"/>
|
||||
<div class="test_model">
|
||||
<label for="detect_L" string="长"/>
|
||||
<field name="detect_L" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="detect_W" string="宽"/>
|
||||
<field name="detect_W" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="detect_H" string="高"/>
|
||||
<field name="detect_H" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
<label for="detect_x_axis" string="测量范围(max)"/>
|
||||
<div class="test_model">
|
||||
<label for="detect_x_axis" string="X轴"/>
|
||||
<field name="detect_x_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="detect_y_axis" string="Y轴"/>
|
||||
<field name="detect_y_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
<label for="detect_z_axis" string="Z轴"/>
|
||||
<field name="detect_z_axis" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
<label for="detect_precision" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="detect_precision" string="测量精度"/>
|
||||
<field name="detect_precision" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>μm&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_measurement_mode" string="测量方式"/>
|
||||
<field name="detect_measurement_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_resolution" string="分辨率"/>
|
||||
<field name="detect_resolution" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<label for="detect_load_weight_max" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="detect_load_weight_max" string="最大负载重量"/>
|
||||
<field name="detect_load_weight_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_weight" string="本体总重量"/>
|
||||
<field name="detect_weight" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>kg&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_measurement_length" string="深孔测量长度(max)"/>
|
||||
<field name="detect_measurement_length" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group string="其他">
|
||||
<label for="control_system_id" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="control_system_id" string="控制系统"/>
|
||||
<field name="control_system_id" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_control_mode" string="控制方式"/>
|
||||
<field name="detect_control_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_balance_mode_for_Z" string="Z轴平衡方式"/>
|
||||
<field name="detect_balance_mode_for_Z" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<label for="detect_zoom_objective_magnification" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="detect_zoom_objective_magnification" string="变焦物镜倍率"/>
|
||||
<field name="detect_zoom_objective_magnification" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>倍&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_magnification" string="放大倍率"/>
|
||||
<field name="detect_magnification" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>倍&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_working_distance" string="工作距离"/>
|
||||
<field name="detect_working_distance" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<label for="detect_locking_mode" string=""/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="detect_locking_mode" string="锁紧方式"/>
|
||||
<field name="detect_locking_mode" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_pressurized_air" string="压缩空气"/>
|
||||
<field name="detect_pressurized_air" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_object_field_of_view_max" string="物方视场:"/>
|
||||
<span>最小&nbsp;</span>
|
||||
<field name="detect_object_field_of_view_max" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm~&nbsp;</span>
|
||||
<field name="detect_object_field_of_view_min" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>mm&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
<label for="detect_operating_temperature" string="工作条件"/>
|
||||
<div class="test_model">
|
||||
<div>
|
||||
<label for="detect_operating_temperature" string="环境温度"/>
|
||||
<field name="detect_operating_temperature" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_operating_humidity" string="环境湿度"/>
|
||||
<field name="detect_operating_humidity" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>°&nbsp;</span>
|
||||
</div>
|
||||
<div>
|
||||
<label for="detect_power_requirements" string="电源要求"/>
|
||||
<field name="detect_power_requirements" class="o_address_zip" required="1"
|
||||
options="{'format': false}"/>
|
||||
<span>&nbsp;</span>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="加工能力">
|
||||
|
||||
<field name='image_id' widget="custom_many2many_checkboxes">
|
||||
@@ -332,7 +892,15 @@
|
||||
</div>
|
||||
<!-- 内容 -->
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="state_zc"/>
|
||||
<div>
|
||||
<field name="brand_id"/>
|
||||
<field name="type_id"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="state_zc"
|
||||
widget="label_selection"
|
||||
options="{'classes': {'未注册': 'warning', '已注册': 'success'}}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom state_zc">
|
||||
<field name="technician_user_id"/>
|
||||
@@ -349,7 +917,7 @@
|
||||
<div t-attf-class="#{record.state.raw_value == '故障' ? 'color_2' : ''}"></div>
|
||||
<div t-attf-class="#{record.state.raw_value == '不可用' ? 'color_3' : ''}"></div>
|
||||
<p class="o_kanban_record_bottom state_zc"
|
||||
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
||||
t-attf-class="#{record.state.raw_value == '正常' ? 'font_color_1' : ''}
|
||||
#{record.state.raw_value == '故障' ? 'font_color_2' : ''}
|
||||
#{record.state.raw_value == '不可用' ? 'font_color_3' : ''}">
|
||||
<field name="state"/>
|
||||
|
||||
@@ -16,14 +16,12 @@
|
||||
'security/group_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/mrp_production_addional_change.xml',
|
||||
# 'report/tray_report.xml',
|
||||
# 'views/mrp_maintenance_views.xml',
|
||||
'views/mrp_routing_workcenter_view.xml',
|
||||
'views/production_line_view.xml',
|
||||
'views/mrp_workcenter_views.xml',
|
||||
'views/mrp_workorder_view.xml',
|
||||
'views/production_line_view.xml',
|
||||
'views/tool_other_features_view.xml',
|
||||
# 'views/tray_view.xml',
|
||||
'views/model_type_view.xml',
|
||||
# 'views/kanban_change.xml'
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from . import tray
|
||||
from . import model_type
|
||||
from . import product_template
|
||||
from . import mrp_production
|
||||
from . import mrp_workorder
|
||||
from . import mrp_workcenter
|
||||
from . import mrp_maintenance
|
||||
from . import mrp_workcenter
|
||||
from . import mrp_routing_workcenter
|
||||
from . import stock
|
||||
from . import res_user
|
||||
|
||||
@@ -6,8 +6,8 @@ from dateutil.relativedelta import relativedelta
|
||||
|
||||
class MaintenanceEquipment(models.Model):
|
||||
_inherit = "maintenance.equipment"
|
||||
_check_company_auto = True
|
||||
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
expected_mtbf = fields.Integer(string='Expected MTBF', help='Expected Mean Time Between Failure')
|
||||
mtbf = fields.Integer(compute='_compute_maintenance_request', string='MTBF',
|
||||
help='Mean Time Between Failure, computed based on done corrective maintenances.')
|
||||
@@ -16,8 +16,6 @@ class MaintenanceEquipment(models.Model):
|
||||
string='Estimated time before next failure (in days)',
|
||||
help='Computed as Latest Failure Date + MTBF')
|
||||
latest_failure_date = fields.Date(compute='_compute_maintenance_request', string='Latest Failure Date')
|
||||
workcenter_id = fields.Many2one(
|
||||
'mrp.workcenter', string='Work Center', check_company=True)
|
||||
|
||||
@api.depends('effective_date', 'maintenance_ids.stage_id', 'maintenance_ids.close_date',
|
||||
'maintenance_ids.request_date')
|
||||
@@ -64,3 +62,8 @@ class MaintenanceRequest(models.Model):
|
||||
'mrp.workorder', string='Work Order', check_company=True)
|
||||
production_company_id = fields.Many2one(string='Production Company', related='production_id.company_id')
|
||||
company_id = fields.Many2one(domain="[('id', '=?', production_company_id)]")
|
||||
|
||||
class SfMaintenanceLogs(models.Model):
|
||||
_inherit = 'sf.maintenance.logs'
|
||||
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='maintenance_equipment_id.production_line_id', store=True)
|
||||
|
||||
@@ -9,13 +9,10 @@ class ResWorkcenter(models.Model):
|
||||
|
||||
# 生产线显示
|
||||
production_line_show = fields.Char(string='生产线名称')
|
||||
machine_tool_id = fields.Many2one('sf.machine_tool', string='机床')
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线')
|
||||
equipment_id = fields.Many2one(
|
||||
'maintenance.equipment', string="设备",
|
||||
check_company=True)
|
||||
|
||||
|
||||
)
|
||||
production_line_id = fields.Many2one('sf.production.line', string='生产线', related='equipment_id.production_line_id', store=True)
|
||||
|
||||
is_process_outsourcing = fields.Boolean('工艺外协')
|
||||
users_ids = fields.Many2many("res.users", 'users_workcenter')
|
||||
@@ -25,13 +22,13 @@ class ResWorkcenter(models.Model):
|
||||
|
||||
equipment_status = fields.Selection(
|
||||
[("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")],
|
||||
string="设备状态", compute='_compute_equipment_id')
|
||||
string="设备状态", related='equipment_id.state')
|
||||
|
||||
@api.depends('equipment_id')
|
||||
def _compute_equipment_id(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.equipment_status = record.equipment_id.state
|
||||
# @api.depends('equipment_id')
|
||||
# def _compute_equipment_id(self):
|
||||
# for record in self:
|
||||
# if record:
|
||||
# record.equipment_status = record.equipment_id.state
|
||||
|
||||
equipment_image = fields.Binary('设备图片', related='equipment_id.machine_tool_picture')
|
||||
|
||||
@@ -40,23 +37,23 @@ class ResWorkcenter(models.Model):
|
||||
outsourcing_workcenter = self.env['mrp.workcenter'].search([('is_process_outsourcing', '=', True)])
|
||||
return outsourcing_workcenter.id
|
||||
|
||||
@api.onchange('machine_tool_id')
|
||||
def update_machine_tool_is_binding(self):
|
||||
machine_tool = self.env["sf.machine_tool"].search([('is_binding', '=', True)])
|
||||
if machine_tool:
|
||||
for item in machine_tool:
|
||||
workcenter_machine_tool = self.env["mrp.workcenter"].search([('machine_tool_id', '=', item.id)])
|
||||
if workcenter_machine_tool:
|
||||
if self.machine_tool_id.id:
|
||||
if workcenter_machine_tool.id != self.machine_tool_id.id:
|
||||
self.machine_tool_id.is_binding = True
|
||||
else:
|
||||
self.machine_tool_id.is_binding = True
|
||||
else:
|
||||
self.machine_tool_id.is_binding = True
|
||||
item.is_binding = False
|
||||
else:
|
||||
self.machine_tool_id.is_binding = True
|
||||
# @api.onchange('machine_tool_id')
|
||||
# def update_machine_tool_is_binding(self):
|
||||
# machine_tool = self.env["sf.machine_tool"].search([('is_binding', '=', True)])
|
||||
# if machine_tool:
|
||||
# for item in machine_tool:
|
||||
# workcenter_machine_tool = self.env["mrp.workcenter"].search([('machine_tool_id', '=', item.id)])
|
||||
# if workcenter_machine_tool:
|
||||
# if self.machine_tool_id.id:
|
||||
# if workcenter_machine_tool.id != self.machine_tool_id.id:
|
||||
# self.machine_tool_id.is_binding = True
|
||||
# else:
|
||||
# self.machine_tool_id.is_binding = True
|
||||
# else:
|
||||
# self.machine_tool_id.is_binding = True
|
||||
# item.is_binding = False
|
||||
# else:
|
||||
# self.machine_tool_id.is_binding = True
|
||||
|
||||
def action_work_order(self):
|
||||
if not self.env.context.get('desktop_list_view', False):
|
||||
|
||||
@@ -22,6 +22,7 @@ class ProductionLine(models.Model):
|
||||
return num
|
||||
|
||||
mrp_workcenter_ids = fields.One2many('mrp.workcenter', 'production_line_id', '工作中心')
|
||||
mrp_manufacturing_ids = fields.One2many('maintenance.equipment', 'production_line_id', '设备')
|
||||
name = fields.Char('生产线', size=20, required=True)
|
||||
code = fields.Char('编码', default=_get_code, readonly=True)
|
||||
remark = fields.Char('备注')
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# # -*- coding: utf-8 -*-
|
||||
# # Part of SmartGo. See LICENSE file for full copyright and licensing details.
|
||||
# import base64
|
||||
# from io import BytesIO
|
||||
# from odoo import api, fields, models
|
||||
# #from pystrich.code128 import Code128Encoder
|
||||
#
|
||||
#
|
||||
# class Tray(models.Model):
|
||||
# _inherit = 'sf.tray'
|
||||
# _description = '托盘'
|
||||
# qr_image = fields.Binary(string="托盘二维码", compute='compute_qr_image')
|
||||
# production_id = fields.Many2one('mrp.production', string='制造订单',
|
||||
# related='workorder_id.production_id'
|
||||
# )
|
||||
# workorder_id = fields.Many2one('mrp.workorder', string="工单"
|
||||
# )
|
||||
#
|
||||
# @api.onchange('production_id')
|
||||
# def updateTrayState(self):
|
||||
# if self.workorder_id != False and self.create_date != False:
|
||||
#
|
||||
# self.state = '占用'
|
||||
# else:
|
||||
# self.state = '空闲'
|
||||
#
|
||||
# #解绑托盘
|
||||
# def unclamp(self):
|
||||
# self.workorder_id = False
|
||||
# self.production_id = False
|
||||
# self.state = '空闲'
|
||||
#
|
||||
# @api.depends('code')
|
||||
# def compute_qr_image(self):
|
||||
# for item in self:
|
||||
# if not item.code:
|
||||
# item.qr_image = False
|
||||
# continue
|
||||
# # 根据code动态生成二维码图片
|
||||
# # qr = qrcode.QRCode(
|
||||
# # version=1,
|
||||
# # error_correction=qrcode.constants.ERROR_CORRECT_L,
|
||||
# # box_size=10,
|
||||
# # border=4,
|
||||
# # )
|
||||
# # qr.add_data(item.code)
|
||||
# # qr.make(fit=True)
|
||||
# # img = qr.make_image()
|
||||
# # 生成条形码文件
|
||||
# # bar = barcode.get("ean13", "123456789102", writer=ImageWriter())
|
||||
# # a = bar.get_fullcode()
|
||||
# # b = bar.save('occ')
|
||||
# # 生成条形码图片
|
||||
# partner_encoder = Code128Encoder(item.code)
|
||||
# # 转换bytes流
|
||||
# temp = BytesIO()
|
||||
# partner_encoder.save(temp)
|
||||
# # img.save(temp, format='PNG')
|
||||
# qr_image = base64.b64encode(temp.getvalue())
|
||||
# item.qr_image = qr_image
|
||||
@@ -1,74 +0,0 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- 托盘码打印尺寸-->
|
||||
<record id="sf_tray1" model="report.paperformat">
|
||||
<field name="name">Dymo Label Sheet</field>
|
||||
<field name="default" eval="True"/>
|
||||
<field name="format">custom</field>
|
||||
<field name="page_height">100</field>
|
||||
<field name="page_width">60</field>
|
||||
<field name="orientation">Landscape</field>
|
||||
<field name="margin_top">0</field>
|
||||
<field name="margin_bottom">0</field>
|
||||
<field name="margin_left">0</field>
|
||||
<field name="margin_right">0</field>
|
||||
<field name="disable_shrinking" eval="True"/>
|
||||
<field name="dpi">96</field>
|
||||
</record>
|
||||
|
||||
<!-- 托盘码打印动作-->
|
||||
<record id="label_sf_tray_code" model="ir.actions.report">
|
||||
<field name="name">打印条形码</field>
|
||||
<field name="model">sf.tray</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">sf_manufacturing.sf_tray_template</field>
|
||||
<field name="report_file">sf_manufacturing.sf_tray_template</field>
|
||||
<field name="binding_model_id" ref="model_sf_tray"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>
|
||||
|
||||
</record>
|
||||
<!-- 托盘码打印模板-->
|
||||
<template id="sf_tray_template">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page">
|
||||
<div t-field="o.code"
|
||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
||||
<div t-field="o.code" style="text-align: center"/>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
||||
<!-- 产品信息打印动作-->
|
||||
<record id="label_sf_tray_code1" model="ir.actions.report">
|
||||
<field name="name">打印产品信息</field>
|
||||
<field name="model">mrp.workorder</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">sf_manufacturing.sf_tray_template1</field>
|
||||
<field name="report_file">sf_manufacturing.sf_tray_template1</field>
|
||||
<field name="binding_model_id" ref="model_mrp_workorder"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="paperformat_id" ref="sf_manufacturing.sf_tray1"/>
|
||||
</record>
|
||||
|
||||
<!-- 产品信息打印模板-->
|
||||
<template id="sf_tray_template1">
|
||||
<t t-call="web.html_container">
|
||||
<t t-call="web.external_layout">
|
||||
<t t-foreach="docs" t-as="o">
|
||||
<div class="page">
|
||||
<div t-field="o.production_id.name"
|
||||
t-options="{'widget': 'barcode', 'width': 600, 'height': 100, 'img_style': 'width:350px;height:60px'}"/>
|
||||
<div t-field="o.production_id" style="text-align: center"/>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -82,4 +82,27 @@
|
||||
name="生产线"
|
||||
sequence="20"
|
||||
action="sf_production_line_act"/>
|
||||
|
||||
<!-- 设备新增生产线-->
|
||||
<record id="sf_hr_equipment_view_form_manufacturing" model="ir.ui.view">
|
||||
<field name="name">sf_equipment.form</field>
|
||||
<field name="model">maintenance.equipment</field>
|
||||
<field name="inherit_id" ref="sf_maintenance.sf_hr_equipment_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='brand_id']" position="after">
|
||||
<field name="production_line_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- 故障日志增加产线对象-->
|
||||
<record id="sf_view_maintenance_logs_tree" model="ir.ui.view">
|
||||
<field name="name">sf.maintenance.logs.tree</field>
|
||||
<field name="model">sf.maintenance.logs</field>
|
||||
<field name="inherit_id" ref="sf_maintenance.view_maintenance_logs_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='code']" position="after">
|
||||
<field name="production_line_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1,30 +0,0 @@
|
||||
<!--<?xml version="1.0" encoding="utf-8"?>-->
|
||||
<!--<odoo>-->
|
||||
<!-- <data>-->
|
||||
<!-- <record id="sf_tray_form_inherit" model="ir.ui.view">-->
|
||||
<!-- <field name="name">托盘条形码生成</field>-->
|
||||
<!-- <field name="model">sf.tray</field>-->
|
||||
<!-- <field name="inherit_id" ref="sf_base.sf_tray_form"/>-->
|
||||
<!-- <field name="arch" type="xml">-->
|
||||
<!-- <xpath expr="//group[@name='group1']" position="after">-->
|
||||
<!-- <notebook>-->
|
||||
<!-- <page string="生成条形码">-->
|
||||
<!-- <field name='qr_image' widget="image"/>-->
|
||||
<!-- <group>-->
|
||||
<!-- <field name='production_id' readonly="1"-->
|
||||
<!-- attrs='{"invisible": [("production_id","=",False)]}'/>-->
|
||||
<!-- <field name="workorder_id"/>-->
|
||||
<!-- </group>-->
|
||||
<!-- <div class="col-12 col-lg-6 o_setting_box">-->
|
||||
<!-- <button type="object" class="oe_highlight" name="unclamp" string="解除装夹"-->
|
||||
<!-- attrs='{"invisible": [("state","=","空闲")]}'/>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- </page>-->
|
||||
|
||||
<!-- </notebook>-->
|
||||
<!-- </xpath>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<!-- </data>-->
|
||||
<!--</odoo>-->
|
||||
@@ -16,7 +16,8 @@
|
||||
'depends': ['sf_manufacturing'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/view.xml'
|
||||
'views/view.xml',
|
||||
# 'views/duration_view.xml'
|
||||
],
|
||||
|
||||
'assets': {
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import custom_plan
|
||||
# from . import duration
|
||||
|
||||
25
sf_plan/models/duration.py
Normal file
25
sf_plan/models/duration.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
import json, requests
|
||||
from odoo import models, fields, api, _
|
||||
from datetime import datetime, timedelta
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class HoleDuration(models.Model):
|
||||
_name = 'hole.duration'
|
||||
_description = 'Hole Duration'
|
||||
|
||||
hole_diameter = fields.Selection([('3', '≤¢3'), ('6', '≤¢6'), ('10', '≤¢10'), ('12', '≤¢12'), ('16', '≤¢16'), ('25', '≤¢25')], string='孔径', required=True)
|
||||
name = fields.Char(string='名称', required=True, default='钻孔')
|
||||
hole_depth = fields.Selection([
|
||||
('10', '≤10'),
|
||||
('30', '≤30'),
|
||||
('50', '≤50'),
|
||||
('70', '≤70'),
|
||||
('90', '≤90'),
|
||||
('100', '≤100'),
|
||||
('120', '≤120'),
|
||||
('150', '≤150')], string='深度', required=True)
|
||||
working_hours = fields.Float(string='工时', required=True)
|
||||
hole_expansion = fields.Float(string='扩孔', required=True, default=0.6)
|
||||
52
sf_plan/views/duration_view.xml
Normal file
52
sf_plan/views/duration_view.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="hole_duration_tree" model="ir.ui.view">
|
||||
<field name="name">hole.duration.tree</field>
|
||||
<field name="model">hole.duration</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="孔加工">
|
||||
<field name="name"/>
|
||||
<field name="hole_diameter"/>
|
||||
<field name="hole_depth"/>
|
||||
<field name="working_hours"/>
|
||||
<field name="hole_expansion"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hole_duration_form" model="ir.ui.view">
|
||||
<field name="name">hole.duration.form</field>
|
||||
<field name="model">hole.duration</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="孔加工">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="hole_diameter"/>
|
||||
<field name="hole_depth"/>
|
||||
<field name="working_hours"/>
|
||||
<field name="hole_expansion"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hole_duration_action" model="ir.actions.act_window">
|
||||
<field name="name">孔加工</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hole.duration</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
id="hole_duration_menu"
|
||||
name="孔加工"
|
||||
sequence="900"
|
||||
action="hole_duration_action"
|
||||
parent="sf_production_plan_menu"
|
||||
/>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -128,7 +128,7 @@
|
||||
decoration-success="state == 'done'"
|
||||
progress_bar="name"
|
||||
form_view_id="sf_production_plan_form"
|
||||
default_scale="week"
|
||||
default_scale="day"
|
||||
scales="day,week,month,year"
|
||||
precision="{'day': 'hour:quarter', 'week': 'day:half', 'month': 'day', 'year': 'month:quarter'}">
|
||||
<field name="shift"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,48 +8,42 @@ class ProcedureEquipmentResourceSetting(models.Model):
|
||||
|
||||
name = fields.Many2one('sf.production.line', string='生产线', required=True)
|
||||
work_center_name_id = fields.Many2one('mrp.workcenter', string='工作中心名称')
|
||||
equipment_code = fields.Char(string='机台号', readonly=True, compute='_onchange_equipment_name_id')
|
||||
equipment_name_id = fields.Many2one('maintenance.equipment',
|
||||
string='设备名称',
|
||||
readonly=True,
|
||||
compute='_onchange_work_center_name_id')
|
||||
brand = fields.Char(string='品牌', readonly=True, compute='_onchange_equipment_name_id')
|
||||
model = fields.Char(string='型号', readonly=True, compute='_onchange_equipment_name_id')
|
||||
equipment_name_id = fields.Many2one('maintenance.equipment', string='设备名称', readonly=True, search=True,
|
||||
compute='_compute_equipment_name_id')
|
||||
equipment_code = fields.Char(string='机台号', readonly=True, related='equipment_name_id.code')
|
||||
brand_id = fields.Many2one('sf.machine.brand', string='品牌', readonly=True, related='equipment_name_id.brand_id')
|
||||
type_id = fields.Many2one('sf.machine_tool.type', string='型号', readonly=True, related='equipment_name_id.type_id')
|
||||
status = fields.Selection(string='设备状态', readonly=True, related='equipment_name_id.state')
|
||||
# todo 传入工序数据
|
||||
working_procedure = fields.Char(string='工序', readonly=True)
|
||||
production_capacity = fields.Float(string='产能', required=True, digits=(4, 1))
|
||||
working_calendar_id = fields.Many2one('sf.work.log.setting', string='工作日历')
|
||||
working_shift_id = fields.Many2many('sf.working.shift', string='班次', readonly=True, compute='_onchange_working_calendar_id')
|
||||
working_shift_id = fields.Many2many('sf.working.shift', string='班次', readonly=True,
|
||||
compute='_compute_working_shift_id')
|
||||
create_time = fields.Datetime(string='新增时间', default=lambda self: fields.Datetime.now(), readonly=True)
|
||||
status = fields.Selection([('正常', '正常'), ('1', '故障停机'), ('2', '计划停机')],
|
||||
string='设备状态',
|
||||
readonly=True,
|
||||
compute='_onchange_equipment_name_id')
|
||||
participate_in_scheduling = fields.Boolean(string='参与排程', default=True)
|
||||
|
||||
@api.onchange('production_capacity')
|
||||
def _onchange_production_capacity(self):
|
||||
@api.depends('work_center_name_id')
|
||||
def _compute_equipment_name_id(self):
|
||||
for record in self:
|
||||
if record.work_center_name_id:
|
||||
record.equipment_name_id = record.work_center_name_id.equipment_id
|
||||
else:
|
||||
record.equipment_name_id = None
|
||||
|
||||
@api.constrains('production_capacity')
|
||||
def _check_production_capacity(self):
|
||||
for record in self:
|
||||
if record.production_capacity < 0:
|
||||
raise UserError("输入的产能值不正确,请重新输入!")
|
||||
|
||||
@api.depends('work_center_name_id')
|
||||
def _onchange_work_center_name_id(self):
|
||||
for record in self:
|
||||
record.equipment_name_id = record.work_center_name_id.equipment_id
|
||||
|
||||
@api.onchange('equipment_name_id')
|
||||
def _onchange_equipment_name_id(self):
|
||||
for record in self:
|
||||
record.equipment_code = record.equipment_name_id.code
|
||||
record.brand = record.equipment_name_id.brand_id.name
|
||||
record.model = record.equipment_name_id.type_id.name
|
||||
record.status = record.equipment_name_id.state
|
||||
raise UserError("产能不能为负!")
|
||||
|
||||
@api.depends('working_calendar_id')
|
||||
def _onchange_working_calendar_id(self):
|
||||
def _compute_working_shift_id(self):
|
||||
for record in self:
|
||||
record.working_shift_id = record.working_calendar_id.working_shift_ids
|
||||
if record.working_calendar_id:
|
||||
record.working_shift_id = record.working_calendar_id.working_shift_ids
|
||||
else:
|
||||
record.working_shift_id = None
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ class WorkScheduleCalendar(models.Model):
|
||||
name = fields.Selection([('休息日', '休息日'), ('计划停机', '计划停机'), ('工作日', '工作日')], '日历事件名称')
|
||||
date_time = fields.Date('休息时间')
|
||||
name_id = fields.Many2one('sf.work.log.setting', '工作日历名称')
|
||||
calendar_code = fields.Char('工作日历编码', readonly=True, compute='_compute_name_id')
|
||||
calendar_code = fields.Char('工作日历编码', readonly=True, compute='_compute_calendar_code')
|
||||
|
||||
day_off_id = fields.Many2many('sf.day.off', string='休息日')
|
||||
scheduled_outage = fields.Char('计划停机')
|
||||
@@ -266,7 +266,7 @@ class WorkScheduleCalendar(models.Model):
|
||||
annual_planned_downtime = fields.Char('年计划停机时长', readonly=True)
|
||||
|
||||
@api.depends('name_id')
|
||||
def _compute_name_id(self):
|
||||
def _compute_calendar_code(self):
|
||||
for record in self:
|
||||
if record:
|
||||
record.calendar_code = record.name_id.code
|
||||
|
||||
@@ -29,6 +29,69 @@
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- 隐藏讨论 -->
|
||||
<record id="mail.menu_root_discuss" model="ir.ui.menu">
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整采购菜单顺序 -->
|
||||
<record id="purchase.menu_purchase_root" model="ir.ui.menu">
|
||||
<field name="sequence" eval="33"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整计划菜单顺序 -->
|
||||
<record id="sf_plan.sf_production_plan_menu" model="ir.ui.menu">
|
||||
<field name="sequence" eval="36"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整制造菜单顺序 -->
|
||||
<record id="mrp.menu_mrp_root" model="ir.ui.menu">
|
||||
<field name="sequence" eval="39"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整质量菜单顺序 -->
|
||||
<record id="quality_control.menu_quality_root" model="ir.ui.menu">
|
||||
<field name="sequence" eval="42"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整设备菜单顺序 -->
|
||||
<record id="maintenance.menu_maintenance_title" model="ir.ui.menu">
|
||||
<field name="sequence" eval="45"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整条码菜单顺序 -->
|
||||
<record id="stock_barcode.stock_barcode_menu" model="ir.ui.menu">
|
||||
<field name="sequence" eval="48"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整库存菜单顺序 -->
|
||||
<record id="stock.menu_stock_root" model="ir.ui.menu">
|
||||
<field name="sequence" eval="51"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整仪表板菜单顺序 -->
|
||||
<record id="spreadsheet_dashboard.spreadsheet_dashboard_menu_root" model="ir.ui.menu">
|
||||
<field name="sequence" eval="54"/>
|
||||
</record>
|
||||
|
||||
<!-- 调整开票菜单名字及顺序 -->
|
||||
<record id="account.menu_finance" model="ir.ui.menu">
|
||||
<field name="name">应收应付</field>
|
||||
<field name="sequence" eval="57"/>
|
||||
</record>
|
||||
<!-- 隐藏跟踪链 -->
|
||||
<record id="utm.menu_link_tracker_root" model="ir.ui.menu">
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- <record id="mrp_workorder.menu_mrp_workorder_workcenter" model="ir.ui.menu"> -->
|
||||
<!-- <field name="name">工单计划</field> -->
|
||||
<!-- <field name="sequence" eval="300"/> -->
|
||||
<!-- <field name="parent_id" ref="sf_plan.sf_production_plan_menu"/> -->
|
||||
<!-- </record> -->
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -47,7 +47,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="code"/>
|
||||
<field name="day_off_ids" widget="many2many_tags"
|
||||
<field name="day_off_ids" widget="many2many_tags" placeholder="请选择"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
@@ -101,8 +101,8 @@
|
||||
<tree string="班次" editable="bottom" >
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="start_time" placeholder="请选择"/>
|
||||
<field name="end_time" placeholder="请选择"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -211,8 +211,8 @@
|
||||
<field name="work_center_name_id"/>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="equipment_code"/>
|
||||
<field name="brand" optional="hide"/>
|
||||
<field name="model" optional="hide"/>
|
||||
<field name="brand_id" optional="hide"/>
|
||||
<field name="type_id" optional="hide"/>
|
||||
<field name="working_procedure"/>
|
||||
<field name="production_capacity" optional="hide"/>
|
||||
<field name="working_calendar_id" optional="hide"/>
|
||||
@@ -233,14 +233,14 @@
|
||||
<sheet>
|
||||
<div>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
<field name="name" placeholder="请选择"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="work_center_name_id"/>
|
||||
<field name="work_center_name_id" placeholder="请选择"/>
|
||||
<field name="production_capacity"/>
|
||||
<field name="working_calendar_id"/>
|
||||
<field name="working_calendar_id" placeholder="请选择"/>
|
||||
<field name="create_time"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -254,12 +254,12 @@
|
||||
<group>`
|
||||
<group>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="brand"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="status"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="equipment_code" string="机台号"/>
|
||||
<field name="model"/>
|
||||
<field name="type_id"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -277,8 +277,8 @@
|
||||
<field name="work_center_name_id"/>
|
||||
<field name="equipment_code"/>
|
||||
<field name="equipment_name_id"/>
|
||||
<field name="brand"/>
|
||||
<field name="model"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="type_id"/>
|
||||
<field name="working_procedure"/>
|
||||
<field name="production_capacity"/>
|
||||
<field name="working_calendar_id"/>
|
||||
|
||||
@@ -24,28 +24,28 @@ class FunctionalCuttingToolEntity(models.Model):
|
||||
return categories.browse(mrs_cutting_tool_type_ids)
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')])
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')])
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||
|
||||
diameter = fields.Float('直径(mm)')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
@@ -103,28 +103,28 @@ class FunctionalCuttingToolEntityCache(models.Model):
|
||||
mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')])
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')])
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||
|
||||
diameter = fields.Float('直径(mm)')
|
||||
tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
|
||||
@@ -153,33 +153,33 @@ class FunctionalToolWarning(models.Model):
|
||||
related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')],
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')],
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
@@ -267,33 +267,33 @@ class RealTimeDistributionOfFunctionalTools(models.Model):
|
||||
# related='functional_cutting_tool_id.mrs_cutting_tool_type_id')
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')],
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')],
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
@@ -375,33 +375,33 @@ class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
|
||||
name = fields.Char('名称', invisible=True, readonly=True, related='functional_cutting_tool_id.name')
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')],
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')],
|
||||
related='functional_cutting_tool_id.cutting_tool_integral_model_id')
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')],
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')],
|
||||
related='functional_cutting_tool_id.cutting_tool_blade_model_id')
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')],
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterbar_model_id')
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')],
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterpad_model_id')
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')],
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhandle_model_id')
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')],
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')],
|
||||
related='functional_cutting_tool_id.cutting_tool_cutterhead_model_id')
|
||||
|
||||
diameter = fields.Float('直径(mm)', readonly=True, related='functional_cutting_tool_id.diameter')
|
||||
@@ -752,39 +752,39 @@ class FunctionalToolAssembly(models.Model):
|
||||
functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||
integral_code = fields.Char('整体式刀具序列号', readonly=True)
|
||||
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True)
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀片')])
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||
blade_code = fields.Char('刀片序列号', readonly=True)
|
||||
blade_name = fields.Char('刀片名称', readonly=True)
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||
bar_code = fields.Char('刀杆序列号', readonly=True)
|
||||
bar_name = fields.Char('刀杆名称', readonly=True)
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||
pad_code = fields.Char('刀盘序列号', readonly=True)
|
||||
pad_name = fields.Char('刀盘名称', readonly=True)
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||
handle_code = fields.Char('刀柄序列号', readonly=True)
|
||||
handle_name = fields.Char('刀柄名称', readonly=True)
|
||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_type', '=', '夹头')])
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=True,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||
chuck_code = fields.Char('夹头序列号', readonly=True)
|
||||
chuck_name = fields.Char('夹头名称', readonly=True)
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
||||
|
||||
@@ -95,24 +95,27 @@
|
||||
<!-- attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"-->
|
||||
<group col="1">
|
||||
<group string="适合加工方式">
|
||||
<field name="suitable_machining_method_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
<field name="suitable_machining_method_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',suitable_machining_method_ids)]"/>
|
||||
</group>
|
||||
<group>
|
||||
<group string="刀尖特征">
|
||||
<field name="blade_tip_characteristics_ids" string=""
|
||||
widget="custom_many2many_checkboxes"/>
|
||||
<field name="blade_tip_characteristics_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',blade_tip_characteristics_ids)]"/>
|
||||
</group>
|
||||
<group string="柄部类型">
|
||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
<field name="handle_type_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',handle_type_ids)]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="走刀方向">
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
<field name="cutting_direction_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',cutting_direction_ids)]"/>
|
||||
</group>
|
||||
<group string="适合冷却液">
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"/>
|
||||
<field name="suitable_coolant_ids" string="" widget="custom_many2many_checkboxes"
|
||||
domain="[('id','in',suitable_coolant_ids)]"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -137,8 +137,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
|
||||
# 功能刀具组装信息
|
||||
# 整体式刀具型号
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.tool.material.search', string='整体式刀具型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '整体式刀具')])
|
||||
cutting_tool_integral_model_id = fields.Many2one('product.product', string='整体式刀具型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '整体式刀具')])
|
||||
integral_code = fields.Char('整体式刀具序列号', readonly=True, compute='_compute_integral_code')
|
||||
integral_name = fields.Char('整体式刀具名称', readonly=True, compute='_compute_integral_name')
|
||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', '整体式刀具品牌', readonly=True,
|
||||
@@ -164,13 +164,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_1(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_integral_model_id:
|
||||
self.sf_tool_brand_id_1 = record.cutting_tool_integral_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_1 = record.cutting_tool_integral_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_1 = None
|
||||
|
||||
# 刀片型号
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.tool.material.search', string='刀片型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '刀片')])
|
||||
cutting_tool_blade_model_id = fields.Many2one('product.product', string='刀片型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '刀片')])
|
||||
blade_code = fields.Char('刀片序列号', readonly=True, compute='_compute_blade_code')
|
||||
blade_name = fields.Char('刀片名称', readonly=True, compute='_compute_blade_name')
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True,
|
||||
@@ -196,13 +196,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_2(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_blade_model_id:
|
||||
self.sf_tool_brand_id_2 = self.cutting_tool_blade_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_2 = self.cutting_tool_blade_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_2 = None
|
||||
|
||||
# 刀杆型号
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.tool.material.search', string='刀杆型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '刀杆')])
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('product.product', string='刀杆型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '刀杆')])
|
||||
bar_code = fields.Char('刀杆序列号', readonly=True, compute='_compute_bar_code')
|
||||
bar_name = fields.Char('刀杆名称', readonly=True, compute='_compute_bar_name')
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True,
|
||||
@@ -228,13 +228,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_3(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_cutterbar_model_id:
|
||||
self.sf_tool_brand_id_3 = self.cutting_tool_cutterbar_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_3 = self.cutting_tool_cutterbar_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_3 = None
|
||||
|
||||
# 刀盘型号
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.tool.material.search', string='刀盘型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '刀盘')])
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('product.product', string='刀盘型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '刀盘')])
|
||||
pad_code = fields.Char('刀盘序列号', readonly=True, compute='_compute_pad_code')
|
||||
pad_name = fields.Char('刀盘名称', readonly=True, compute='_compute_pad_name')
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True,
|
||||
@@ -260,13 +260,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_4(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_cutterpad_model_id:
|
||||
self.sf_tool_brand_id_4 = self.cutting_tool_cutterpad_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_4 = self.cutting_tool_cutterpad_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_4 = None
|
||||
|
||||
# 刀柄型号
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.tool.material.search', string='刀柄型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '刀柄')])
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('product.product', string='刀柄型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '刀柄')])
|
||||
handle_code = fields.Char('刀柄序列号', readonly=True, compute='_compute_handle_code')
|
||||
handle_name = fields.Char('刀柄名称', readonly=True, compute='_compute_handle_name')
|
||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True,
|
||||
@@ -292,13 +292,13 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_5(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_cutterhandle_model_id:
|
||||
self.sf_tool_brand_id_5 = self.cutting_tool_cutterhandle_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_5 = self.cutting_tool_cutterhandle_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_5 = None
|
||||
|
||||
# 夹头型号
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.tool.material.search', string='夹头型号', readonly=False,
|
||||
domain=[('cutting_tool_type', '=', '夹头')])
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('product.product', string='夹头型号', readonly=False,
|
||||
domain=[('cutting_tool_material_id', '=', '夹头')])
|
||||
chuck_code = fields.Char('夹头序列号', readonly=True, compute='_compute_chuck_code')
|
||||
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_chuck_name')
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True,
|
||||
@@ -324,7 +324,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_sf_tool_brand_id_6(self):
|
||||
for record in self:
|
||||
if record.cutting_tool_cutterhead_model_id:
|
||||
self.sf_tool_brand_id_6 = self.cutting_tool_cutterhead_model_id.mrs_machine_brand_id.id
|
||||
self.sf_tool_brand_id_6 = self.cutting_tool_cutterhead_model_id.brand_id.id
|
||||
else:
|
||||
self.sf_tool_brand_id_6 = None
|
||||
|
||||
|
||||
@@ -143,28 +143,30 @@
|
||||
<group string="组装物料信息">
|
||||
<group>
|
||||
<field name="cutting_tool_integral_model_id" string="整体式刀具型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
||||
<field name="integral_code"
|
||||
attrs="{'invisible': [('cutting_tool_blade_model_id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_blade_model_id" string="刀片型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
||||
<field name="blade_code"
|
||||
attrs="{'invisible': [('cutting_tool_integral_model_id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cutterbar_model_id" string="刀杆型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
||||
<field name="bar_code"
|
||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterpad_model_id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cutterpad_model_id" string="刀盘型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"
|
||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
||||
<field name="pad_code"
|
||||
attrs="{'invisible': ['|',('cutting_tool_integral_model_id', '!=', False),('cutting_tool_cutterbar_model_id', '!=', False)]}"/>
|
||||
<field name="cutting_tool_cutterhandle_model_id" string="刀柄型号" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutting_tool_cutterhandle_model_id" string="刀柄型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"/>
|
||||
<field name="handle_code"/>
|
||||
<field name="cutting_tool_cutterhead_model_id" string="夹头型号" options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="cutting_tool_cutterhead_model_id" string="夹头型号"
|
||||
options="{'no_create': True, 'no_quick_create': True}" placeholder="请选择"/>
|
||||
<field name="chuck_code"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
BIN
web_enterprise/static/img/jikimo_backgroud.png
Normal file
BIN
web_enterprise/static/img/jikimo_backgroud.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
@@ -9,7 +9,7 @@
|
||||
radial-gradient(at 7% 13%, hsla(268,5%,47%,0.42) 0px, transparent 50%),
|
||||
radial-gradient(at 96% 94%, hsla(267,5%,46%,0.51) 0px, transparent 50%),
|
||||
radial-gradient(at 3% 96%, hsla(289,17%,21%,0.41) 0px, transparent 50%),
|
||||
url("/web_enterprise/static/img/home-menu-bg-overlay.svg")
|
||||
url("/web_enterprise/static/img/jikimo_backgroud.png")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,10 +684,19 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
||||
const stopDate = this.state.stopDate;
|
||||
let day = this.state.startDate;
|
||||
const dates = [];
|
||||
while (day <= stopDate) {
|
||||
dates.push(day);
|
||||
day = day.clone().add(1, token);
|
||||
const shift_time = 8;
|
||||
if (this.state.scale == "day") {
|
||||
while (day <= stopDate) {
|
||||
dates.push(day);
|
||||
day = day.clone().add(shift_time, token);
|
||||
}
|
||||
} else {
|
||||
while (day <= stopDate) {
|
||||
dates.push(day);
|
||||
day = day.clone().add(1, token);
|
||||
}
|
||||
}
|
||||
console.log(dates)
|
||||
return dates;
|
||||
},
|
||||
/**
|
||||
@@ -806,6 +815,7 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
||||
* @override
|
||||
*/
|
||||
async _renderView() {
|
||||
console.log('this.state', this.state)
|
||||
const oldRowWidgets = Object.keys(this.rowWidgets).map((rowId) => {
|
||||
return this.rowWidgets[rowId];
|
||||
});
|
||||
|
||||
@@ -261,12 +261,18 @@ var GanttRow = Widget.extend({
|
||||
_adaptPills: function () {
|
||||
var self = this;
|
||||
var dateStartField = this.state.dateStartField;
|
||||
console.log("dateStartField",dateStartField)
|
||||
var dateStopField = this.state.dateStopField;
|
||||
console.log("dateStopField",dateStopField)
|
||||
var ganttStartDate = this.state.startDate;
|
||||
console.log("ganttStartDate",ganttStartDate)
|
||||
var ganttStopDate = this.state.stopDate;
|
||||
console.log("ganttStopDate",ganttStopDate)
|
||||
this.pills.forEach(function (pill) {
|
||||
var pillStartDate = self._convertToUserTime(pill[dateStartField]);
|
||||
console.log("pillStartDate",pillStartDate)
|
||||
var pillStopDate = self._convertToUserTime(pill[dateStopField]);
|
||||
console.log("pillStopDate",pillStopDate)
|
||||
if (pillStartDate < ganttStartDate) {
|
||||
pill.startDate = ganttStartDate;
|
||||
pill.disableStartResize = true;
|
||||
@@ -457,16 +463,50 @@ var GanttRow = Widget.extend({
|
||||
this.pills.forEach(function (pill) {
|
||||
let widthPill;
|
||||
let margin;
|
||||
const shift_time = 8;
|
||||
switch (self.state.scale) {
|
||||
case 'day':
|
||||
left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
||||
pill.leftMargin = (left / 60) * 100;
|
||||
// left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
||||
left = pill.startDate.diff(pill.startDate.clone().startOf('day'), 'minutes') % (shift_time * 60);
|
||||
|
||||
console.log('left', left)
|
||||
pill.leftMargin = (left / (shift_time * 60)) * 100;
|
||||
console.log('pill.leftMargin', pill.leftMargin)
|
||||
diff = pill.stopDate.diff(pill.startDate, 'minutes');
|
||||
var gapSize = pill.stopDate.diff(pill.startDate, 'hours') - 1; // Eventually compensate border(s) width
|
||||
widthPill = (diff / 60) * 100;
|
||||
console.log('diff', diff)
|
||||
var gapSize = pill.stopDate.diff(pill.startDate, 'hours') - shift_time; // Eventually compensate border(s) width
|
||||
console.log('gapSize', gapSize)
|
||||
widthPill = (diff / (shift_time * 60)) * 100;
|
||||
console.log('widthPill', widthPill)
|
||||
margin = pill.aggregatedPills ? 0 : 4;
|
||||
console.log('margin', margin)
|
||||
pill.width = gapSize > 0 ? `calc(${widthPill}% + ${gapSize}px - ${margin}px)` : `calc(${widthPill}% - ${margin}px)`;
|
||||
console.log('pill.width', pill.width)
|
||||
break;
|
||||
|
||||
// left = pill.startDate.diff(pill.startDate.clone().startOf('hour'), 'minutes');
|
||||
// console.log('left', left)
|
||||
// left = (left / (8 * 60)) * 100; // 修改这里,以8小时为单位
|
||||
// console.log('adjusted left', left)
|
||||
// pill.leftMargin = left;
|
||||
//
|
||||
// diff = pill.stopDate.diff(pill.startDate, 'minutes');
|
||||
// console.log('diff', diff)
|
||||
// diff = (diff / (8 * 60)) * 100; // 修改这里,以8小时为单位
|
||||
// console.log('adjusted diff', diff)
|
||||
//
|
||||
// var gapSize = pill.stopDate.diff(pill.startDate, 'hours') / 8 - 1; // 修改这里,以8小时为单位
|
||||
// console.log('gapSize', gapSize)
|
||||
//
|
||||
// widthPill = diff;
|
||||
// console.log('widthPill', widthPill)
|
||||
//
|
||||
// margin = pill.aggregatedPills ? 0 : 4;
|
||||
// console.log('margin', margin)
|
||||
//
|
||||
// pill.width = gapSize > 0 ? `calc(${widthPill}% + ${gapSize}px - ${margin}px)` : `calc(${widthPill}% - ${margin}px)`;
|
||||
// console.log('pill.width', pill.width)
|
||||
// break;
|
||||
case 'week':
|
||||
case 'month':
|
||||
left = pill.startDate.diff(pill.startDate.clone().startOf('day'), 'hours');
|
||||
@@ -666,21 +706,28 @@ var GanttRow = Widget.extend({
|
||||
* @private
|
||||
*/
|
||||
_insertIntoSlot: function () {
|
||||
console.log('this.slots', this.slots);
|
||||
var slotsToFill = this.slots;
|
||||
this.pills.forEach(function (currentPill) {
|
||||
var skippedSlots = [];
|
||||
slotsToFill.some(function (currentSlot) {
|
||||
console.log('currentPill.startDate1111111111', currentPill)
|
||||
// console.log('currentSlot.stop2222222222222', currentSlot.stop)
|
||||
var fitsInThisSlot = currentPill.startDate < currentSlot.stop;
|
||||
console.log('fitsInThisSlot', fitsInThisSlot)
|
||||
if (fitsInThisSlot) {
|
||||
currentSlot.pills.push(currentPill);
|
||||
console.log('currentSlot.pills', currentSlot.pills)
|
||||
} else {
|
||||
skippedSlots.push(currentSlot);
|
||||
console.log('skippedSlots', skippedSlots)
|
||||
}
|
||||
return fitsInThisSlot;
|
||||
});
|
||||
// Pills are sorted by start date, so any slot that was skipped
|
||||
// for this pill will not be suitable for any of the next pills
|
||||
slotsToFill = _.difference(slotsToFill, skippedSlots);
|
||||
console.log('slotsToFill', slotsToFill)
|
||||
});
|
||||
},
|
||||
/**
|
||||
@@ -727,7 +774,7 @@ var GanttRow = Widget.extend({
|
||||
let index = 0;
|
||||
for (const date of this.viewInfo.slots) {
|
||||
const slotStart = date;
|
||||
const slotStop = date.clone().add(1, interval);
|
||||
const slotStop = date.clone().add(8, interval);
|
||||
const isToday = date.isSame(new Date(), 'day') && this.state.scale !== 'day';
|
||||
|
||||
let slotStyle = '';
|
||||
@@ -759,6 +806,7 @@ var GanttRow = Widget.extend({
|
||||
stop: slotStop,
|
||||
pills: [],
|
||||
});
|
||||
console.log('啊啊啊啊this啊啊啊啊.啊啊啊啊slots啊啊啊啊', this.slots)
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -76,8 +76,17 @@
|
||||
<div t-attf-class="col position-relative o_gantt_header_cell text-center p-2 #{isToday? 'o_gantt_today' : ''} ">
|
||||
<t t-if="widget.state.scale in formats" t-esc="slot.format(formats[widget.state.scale])"/>
|
||||
<small t-else="">
|
||||
<b t-esc="slot.format('k')"/>
|
||||
<span class="d-block d-xl-inline-block" t-esc="slot.format('a')"/>
|
||||
<t t-if="slot.format('k') == 24">
|
||||
<div>夜班</div>
|
||||
</t>
|
||||
<t t-if="slot.format('k') == 8">
|
||||
<div>早班</div>
|
||||
</t>
|
||||
<t t-if="slot.format('k') == 16">
|
||||
<div>晚班</div>
|
||||
</t>
|
||||
<!-- <b t-esc="slot.format('k')"/> -->
|
||||
<!-- <span class="d-block d-xl-inline-block" t-esc="slot.format('a')"/> -->
|
||||
</small>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user