From e5c5aa6cdd19a01d13fea1e0f3b1a6d13c33d07b Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Wed, 26 Jul 2023 15:17:12 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=80=E5=85=B7=E7=AE=A1=E7=90=86-=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E9=A2=84=E8=AD=A6?=
=?UTF-8?q?=E3=80=81=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E5=AE=9E=E6=97=B6?=
=?UTF-8?q?=E5=88=86=E5=B8=83=E3=80=81=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7?=
=?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95=E5=AF=B9=E8=B1=A1?=
=?UTF-8?q?=EF=BC=88tree=E8=A7=86=E5=9B=BE=E3=80=81form=E8=A7=86=E5=9B=BE?=
=?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=EF=BC=89=EF=BC=9B=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=88=80=E5=85=B7=E7=AE=A1=E7=90=86=E5=AF=B9=E8=B1=A1=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E5=AF=B9=E8=B1=A1=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96?=
=?UTF-8?q?=E4=BA=86=E5=AD=97=E6=AE=B5=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E4=BA=86tree=E8=A7=86=E5=9B=BE=E5=B1=95=E7=A4=BA?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=96=B0=E5=A2=9Eform=E8=A7=86?=
=?UTF-8?q?=E5=9B=BE=EF=BC=9B=E8=A7=A3=E9=99=A4=E4=BA=86=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E5=88=80=E5=85=B7=E5=88=97=E8=A1=A8=E5=AF=B9=E8=B1=A1=E4=B8=8E?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E5=AF=B9=E8=B1=A1=E7=9A=84?=
=?UTF-8?q?=E7=BB=A7=E6=89=BF=E5=85=B3=E7=B3=BB=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 417 ++++++++------
.../security/ir.model.access.csv | 4 +
sf_tool_management/views/menu_view.xml | 8 +-
sf_tool_management/views/tool_base_views.xml | 515 +++++++++++++-----
4 files changed, 659 insertions(+), 285 deletions(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index f5d88caf..596e54bb 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -5,174 +5,283 @@ from odoo import fields, models, api
# class FunctionalCuttingToolEntity(models.Model):
# _name = 'sf.functional.cutting.tool.entity'
# _inherit = 'sf.functional.cutting.tool'
+# _inherits = {'sf.functional.cutting.tool': 'sf_functional_cutting_tool_entity_id'}
# _description = '功能刀具管理'
class FunctionalCuttingToolEntity(models.Model):
_name = 'sf.functional.cutting.tool.entity'
- _description = '功能刀具管理'
- _inherits = {'sf.functional.cutting.tool': 'sf_functional_cutting_tool_entity_id'}
+ _description = '功能刀具列表'
+
+
+ code = fields.Char('编码')
+ name = fields.Char('名称')
+ mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
+ mrs_cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='刀具型号')
+
+ # 整体式刀具型号
+ mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_cutting_tool_entity_id',
+ string='整体式刀具型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '整体式刀具')])
+ # 刀片型号
+ mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model', 'sf_functional_cutting_tool_entity_id',
+ string='刀片型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '刀片')])
+ # 刀杆型号
+ mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_cutting_tool_entity_id',
+ string='刀杆型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '刀杆')])
+ # 刀盘型号
+ mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_cutting_tool_entity_id',
+ string='刀盘型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '刀盘')])
+ # 刀柄型号
+ mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_cutting_tool_entity_id',
+ string='刀柄型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '刀柄')])
+ # 夹头型号
+ mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_cutting_tool_entity_id',
+ string='夹头型号', domain=
+ [('mrs_cutting_tool_material_name', '=', '夹头')])
+
+ diameter = fields.Float('直径(mm)')
+ tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
+ string='刀具等级')
+ machining_accuracy = fields.Float('加工精度(mm)')
+ tool_length = fields.Float('装刀长')
+ blade_number = fields.Integer('刃数')
+ integral_blade_length = fields.Float('整体刃长(mm)')
+ effective_blade_length = fields.Float('有效刃长(mm)')
+ max_life = fields.Float('最大寿命值')
+ is_standard = fields.Boolean('是否标准刀')
+ applicable_range = fields.Char('适用范围')
+ image = fields.Binary('图片')
+
+ def _get_functional_tool_model_ids(self, functional_tool_model_code):
+ functional_tool_model_ids = []
+ for item in functional_tool_model_code:
+ functional_tool_model = self.env['sf.cutting.tool.model'].search([('code', '=', item)])
+ functional_tool_model_ids.append(functional_tool_model.id)
+ return [(6, 0, functional_tool_model_ids)]
+
+
+class FunctionalToolWarning(models.Model):
+ _name = 'sf.functional.tool.warning'
+ _description = '功能刀具预警'
+
+ functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
+
+ code = fields.Char('编码', readonly=True)
+ name = fields.Char('名称', invisible=True, readonly=True)
+ mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
+
+ # 整体式刀具型号
+ mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='整体式刀具型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '整体式刀具')])
+ # 刀片型号
+ mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='刀片型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀片')])
+ # 刀杆型号
+ mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='刀杆型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀杆')])
+ # 刀盘型号
+ mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='刀盘型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀盘')])
+ # 刀柄型号
+ mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='刀柄型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀柄')])
+ # 夹头型号
+ mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_functional_tool_warning_id',
+ string='夹头型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '夹头')])
+
+ diameter = fields.Float('直径(mm)', readonly=True)
+ tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
+ string='刀具等级', readonly=True)
+ machining_accuracy = fields.Float('加工精度(mm)', readonly=True)
+ tool_length = fields.Float('装刀长', readonly=True)
+ blade_number = fields.Integer('刃数', readonly=True)
+ integral_blade_length = fields.Float('整体刃长(mm)', readonly=True)
+ effective_blade_length = fields.Float('有效刃长(mm)', readonly=True)
+ max_life = fields.Float('最大寿命值', readonly=True)
+ is_standard = fields.Boolean('是否标准刀', readonly=True)
+ applicable_range = fields.Char('适用范围', readonly=True)
+ image = fields.Binary('图片', readonly=True)
- # 新添加的关联到原模型的字段
- sf_functional_cutting_tool_entity_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具')
- order = fields.Char(string='序')
- functional_cutting_tool_id = fields.Char(string='功能刀具', invisible=True)
# 功能刀具预警 特有字段
- install_tool_time = fields.Char("装刀时间")
- outbound_time = fields.Char('出库时间')
- on_board_time = fields.Char('上机时间')
- machine_tool_code = fields.Char('机台号')
- cutting_tool_code = fields.Char('刀位号')
- idle_time = fields.Char('闲置时长')
- alarm_value = fields.Char('报警值')
- used_value = fields.Char('已使用值')
- alarm_type = fields.Char('报警类型')
- alarm_time = fields.Char('报警时间')
- dispose_user = fields.Char('处理人')
- dispose_time = fields.Char('处理时间')
- dispose_func = fields.Char('处理方法/措施')
- remark = fields.Char('备注')
+ install_tool_time = fields.Char("装刀时间", readonly=True)
+ outbound_time = fields.Char('出库时间', readonly=True)
+ on_board_time = fields.Char('上机时间', readonly=True)
+ machine_tool_code = fields.Char('机台号', readonly=True)
+ cutting_tool_code = fields.Char('刀位号', readonly=True)
+ idle_time = fields.Char('闲置时长', readonly=True)
+ alarm_value = fields.Char('报警值', readonly=True)
+ used_value = fields.Char('已使用值', readonly=True)
+ alarm_type = fields.Char('报警类型', readonly=True)
+ alarm_time = fields.Char('报警时间', readonly=True)
+ dispose_user = fields.Char('处理人', readonly=True)
+ dispose_time = fields.Char('处理时间', readonly=True)
+ dispose_func = fields.Char('处理方法/措施', readonly=True)
+ remark = fields.Char('备注', readonly=True)
- # 功能刀具出入库记录 特有字段
- thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '精')], string='粗/中/精')
- max_life_span = fields.Char(string='最大寿命值')
- # alarm_value = fields.Char(string='报警值')
- # used_value = fields.Char(string='已使用值')
- current_state = fields.Char(string='当前状态')
- current_store_area = fields.Char(string='当前库区')
- current_store_place = fields.Char(string='当前库位')
- number = fields.Integer(string='数量')
- reason_application = fields.Char(string='申请原因')
- applicant = fields.Char(string='申请人')
- return_staff = fields.Char(string='归还人')
- return_time = fields.Date(string='归还入库时间')
- tool_state = fields.Char(string="刀具状态")
- tool_install_staff = fields.Char(string='装刀人')
- tool_install_time = fields.Datetime(string='装刀时间')
- receive_equipment = fields.Char(string='领用机台')
- receive_staff = fields.Char(string='领用人')
- receive_time = fields.Char(string='领用出库时间')
- # remark = fields.Text(string='备注/说明')
+ @api.onchange('functional_cutting_tool_id')
+ def onchange_functional_cutting_tool_id(self):
+ print(self.functional_cutting_tool_id.name)
+
+
+class RealTimeDistributionOfFunctionalTools(models.Model):
+ _name = 'sf.real.time.distribution.of.functional.tools'
+ _description = '功能刀具实时分布'
+
+ functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
+ code = fields.Char('编码', readonly=True)
+ name = fields.Char('名称', invisible=True, readonly=True)
+ mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
+
+ # 整体式刀具型号
+ mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='整体式刀具型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '整体式刀具')])
+ # 刀片型号
+ mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='刀片型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀片')])
+ # 刀杆型号
+ mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='刀杆型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀杆')])
+ # 刀盘型号
+ mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='刀盘型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀盘')])
+ # 刀柄型号
+ mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='刀柄型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀柄')])
+ # 夹头型号
+ mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_real_time_distribution_of_functional_tools_id',
+ string='夹头型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '夹头')])
+
+ diameter = fields.Float('直径(mm)', readonly=True)
+ tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
+ string='刀具等级', readonly=True)
+ machining_accuracy = fields.Float('加工精度(mm)', readonly=True)
+ tool_length = fields.Float('装刀长', readonly=True)
+ blade_number = fields.Integer('刃数', readonly=True)
+ integral_blade_length = fields.Float('整体刃长(mm)', readonly=True)
+ effective_blade_length = fields.Float('有效刃长(mm)', readonly=True)
+ max_life = fields.Float('最大寿命值', readonly=True)
+ is_standard = fields.Boolean('是否标准刀', readonly=True)
+ applicable_range = fields.Char('适用范围', readonly=True)
+ image = fields.Binary('图片', readonly=True)
# 功能刀具实时分布
- tool_stock_num = fields.Char(string='刀具房库存数量')
- side_shelf_num = fields.Char(string='线边货架货架数量')
- on_tool_stock_num = fields.Char(string='机内刀库库存数量')
- tool_stock_total = fields.Char(string='合计')
- return_reuse_num_re = fields.Char(string='归还再用数量(精)')
- return_reuse_num_co = fields.Char(string='归还再用数量(粗)')
- return_processing_num = fields.Char(string='归还需磨削数量')
- return_total = fields.Char(string='合计')
- total = fields.Char(string='总计')
- # remark = fields.Char(string='备注/说明')
+ tool_stock_num = fields.Char(string='刀具房库存数量', readonly=True)
+ side_shelf_num = fields.Char(string='线边货架货架数量', readonly=True)
+ on_tool_stock_num = fields.Char(string='机内刀库库存数量', readonly=True)
+ tool_stock_total = fields.Char(string='合计', readonly=True)
+ return_reuse_num_re = fields.Char(string='归还再用数量(精)', readonly=True)
+ return_reuse_num_co = fields.Char(string='归还再用数量(粗)', readonly=True)
+ return_processing_num = fields.Char(string='归还需磨削数量', readonly=True)
+ return_total = fields.Char(string='合计', readonly=True)
+ total = fields.Char(string='总计', readonly=True)
+ remark = fields.Char(string='备注/说明', readonly=True)
- # @api.onchange('functional_cutting_tool_id')
- # def get_functional_cutting_tool_info(self):
- # for item in self:
- # item.code = item.functional_cutting_tool_id.code,
- # item.name = item.functional_cutting_tool_id.name,
- # item.functional_model_number = item.functional_cutting_tool_id.functional_model_number,
- # item.integral_model_number = item.functional_cutting_tool_id.integral_model_number,
- # item.blade_model_number = item.functional_cutting_tool_id.blade_model_number,
- # item.cutterbar_model_number = item.functional_cutting_tool_id.cutterbar_model_number,
- # item.cutterpad_model_number = item.functional_cutting_tool_id.cutterpad_model_number,
- # item.handle_model_number = item.functional_cutting_tool_id.handle_model_number,
- # item.chuck_model_number = item.functional_cutting_tool_id.chuck_model_number,
- # item.diameter = item.functional_cutting_tool_id.diameter,
- # item.tool_grade = item.functional_cutting_tool_id.tool_grade,
- # item.machining_accuracy = item.functional_cutting_tool_id.machining_accuracy,
- # item.ctool_lengthode = item.functional_cutting_tool_id.tool_length,
- # item.blade_number = item.functional_cutting_tool_id.blade_number,
- # item.integral_blade_length = item.functional_cutting_tool_id.integral_blade_length,
- # item.effective_blade_length = item.functional_cutting_tool_id.effective_blade_length,
- # item.max_life = item.functional_cutting_tool_id.max_life,
- # item.is_standard = item.functional_cutting_tool_id.is_standard,
- # item.applicable_range = item.functional_cutting_tool_id.applicable_range,
+class InboundAndOutboundRecordsOfFunctionalTools(models.Model):
+ _name = 'sf.inbound.and.outbound.records.of.functional.tools'
+ _description = '功能刀具出入库记录'
- @api.model
- def create(self, vals):
- if not vals.get('order'):
- vals['order'] = self._generate_code()
- return super(FunctionalCuttingToolEntity, self).create(vals)
+ functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool.entity', '功能刀具', readonly=True)
+ code = fields.Char('编码', readonly=True)
+ name = fields.Char('名称', invisible=True, readonly=True)
+ mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
- @api.model
- def _generate_code(self):
- last_tool = self.search([], order='id desc', limit=1)
- if last_tool:
- last_code = int(last_tool.code.split('-')[-1])
- new_code = '{:03d}'.format(last_code + 1)
- else:
- new_code = '001'
- return new_code
+ # 整体式刀具型号
+ mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='整体式刀具型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '整体式刀具')])
+ # 刀片型号
+ mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='刀片型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀片')])
+ # 刀杆型号
+ mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='刀杆型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀杆')])
+ # 刀盘型号
+ mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='刀盘型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀盘')])
+ # 刀柄型号
+ mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='刀柄型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '刀柄')])
+ # 夹头型号
+ mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
+ 'sf_inbound_and_outbound_records_of_functional_tools_id',
+ string='夹头型号', readonly=True, domain=
+ [('mrs_cutting_tool_material_name', '=', '夹头')])
-# class FunctionalToolWarning(models.Model):
-# _name = 'sf.functional.tool.warning'
-# _description = '功能刀具预警'
-#
-# functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool', '功能刀具')
-#
-# code = fields.Char('编码')
-# name = fields.Char('名称')
-# mrs_cutting_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
-#
-# # 整体式刀具型号
-# mrs_cutting_tool_integral_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_integral_model_functional_sf',
-# string='整体式刀具型号', domain=
-# [('mrs_cutting_tool_material_name', '=', '整体式刀具')])
-# # 刀片型号
-# mrs_cutting_tool_blade_model_ids = fields.Many2many('sf.cutting.tool.model', 'rel_blade_model_functional_sf',
-# string='刀片型号', domain=
-# [('mrs_cutting_tool_material_name', '=', '刀片')])
-# # 刀杆型号
-# mrs_cutting_tool_cutterbar_model_ids = fields.Many2many('sf.cutting.tool.model',
-# 'rel_cutterbar_model_functional_sf',
-# string='刀杆型号', domain=
-# [('mrs_cutting_tool_material_name', '=', '刀杆')])
-# # 刀盘型号
-# mrs_cutting_tool_cutterpad_model_ids = fields.Many2many('sf.cutting.tool.model',
-# 'rel_cutterpad_model_functional_sf',
-# string='刀盘型号', domain=
-# [('mrs_cutting_tool_material_name', '=', '刀盘')])
-# # 刀柄型号
-# mrs_cutting_tool_cutterhandle_model_ids = fields.Many2many('sf.cutting.tool.model',
-# 'rel_cutterhandle_model_functional_sf',
-# string='刀柄型号',
-# domain=
-# [('mrs_cutting_tool_material_name', '=', '刀柄')])
-# # 夹头型号
-# mrs_cutting_tool_cutterhead_model_ids = fields.Many2many('sf.cutting.tool.model',
-# 'rel_cutterhead_model_functional_sf',
-# string='夹头型号', domain=
-# [('mrs_cutting_tool_material_name', '=', '夹头')])
-#
-# diameter = fields.Float('直径(mm)')
-# tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
-# string='刀具等级')
-# machining_accuracy = fields.Float('加工精度(mm)')
-# tool_length = fields.Float('装刀长')
-# blade_number = fields.Integer('刃数')
-# integral_blade_length = fields.Float('整体刃长(mm)')
-# effective_blade_length = fields.Float('有效刃长(mm)')
-# max_life = fields.Float('最大寿命值')
-# is_standard = fields.Boolean('是否标准刀')
-# applicable_range = fields.Char('适用范围')
-# image = fields.Binary('图片')
-#
-# # 功能刀具预警 特有字段
-# install_tool_time = fields.Char("装刀时间")
-# outbound_time = fields.Char('出库时间')
-# on_board_time = fields.Char('上机时间')
-# machine_tool_code = fields.Char('机台号')
-# cutting_tool_code = fields.Char('刀位号')
-# idle_time = fields.Char('闲置时长')
-# alarm_value = fields.Char('报警值')
-# used_value = fields.Char('已使用值')
-# alarm_type = fields.Char('报警类型')
-# alarm_time = fields.Char('报警时间')
-# dispose_user = fields.Char('处理人')
-# dispose_time = fields.Char('处理时间')
-# dispose_func = fields.Char('处理方法/措施')
-# remark = fields.Char('备注')
+ diameter = fields.Float('直径(mm)', readonly=True)
+ tool_grade = fields.Selection([('1', 'P1'), ('2', 'P2'), ('3', 'P3'), ('4', 'P4'), ('5', 'P5'), ('6', 'P6')],
+ string='刀具等级', readonly=True)
+ machining_accuracy = fields.Float('加工精度(mm)', readonly=True)
+ tool_length = fields.Float('装刀长', readonly=True)
+ blade_number = fields.Integer('刃数', readonly=True)
+ integral_blade_length = fields.Float('整体刃长(mm)', readonly=True)
+ effective_blade_length = fields.Float('有效刃长(mm)', readonly=True)
+ max_life = fields.Float('最大寿命值', readonly=True)
+ is_standard = fields.Boolean('是否标准刀', readonly=True)
+ applicable_range = fields.Char('适用范围', readonly=True)
+ image = fields.Binary('图片', readonly=True)
+ # 功能刀具出入库记录 特有字段
+ thickness = fields.Selection([('1', '粗'), ('2', '中'), ('3', '精')], string='粗/中/精', readonly=True)
+ max_life_span = fields.Char(string='最大寿命值', readonly=True)
+ alarm_value = fields.Char(string='报警值', readonly=True)
+ used_value = fields.Char(string='已使用值', readonly=True)
+ current_state = fields.Char(string='当前状态', readonly=True)
+ current_store_area = fields.Char(string='当前库区', readonly=True)
+ current_store_place = fields.Char(string='当前库位', readonly=True)
+ number = fields.Integer(string='数量', readonly=True)
+ reason_application = fields.Char(string='申请原因', readonly=True)
+ applicant = fields.Char(string='申请人', readonly=True)
+ return_staff = fields.Char(string='归还人', readonly=True)
+ return_time = fields.Date(string='归还入库时间', readonly=True)
+ tool_state = fields.Char(string="刀具状态", readonly=True)
+ tool_install_staff = fields.Char(string='装刀人', readonly=True)
+ tool_install_time = fields.Datetime(string='装刀时间', readonly=True)
+ receive_equipment = fields.Char(string='领用机台', readonly=True)
+ receive_staff = fields.Char(string='领用人', readonly=True)
+ receive_time = fields.Char(string='领用出库时间', readonly=True)
+ remark = fields.Text(string='备注/说明', readonly=True)
class MachineTableToolChangingApply(models.Model):
diff --git a/sf_tool_management/security/ir.model.access.csv b/sf_tool_management/security/ir.model.access.csv
index 6cb8bc16..65b027b6 100644
--- a/sf_tool_management/security/ir.model.access.csv
+++ b/sf_tool_management/security/ir.model.access.csv
@@ -1,5 +1,9 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sf_functional_cutting_tool_entity,sf.functional.cutting.tool.entity,model_sf_functional_cutting_tool_entity,base.group_user,1,1,1,1
+access_sf.functional.tool.warning,sf.functional.tool.warning,model_sf_functional_tool_warning,base.group_user,1,0,1,0
+access_sf.real.time.distribution.of.functional.tools,sf.real.time.distribution.of.functional.tools,model_sf_real_time_distribution_of_functional_tools,base.group_user,1,0,1,0
+access_sf.inbound.and.outbound.records.of.functional.tools,sf.inbound.and.outbound.records.of.functional.tools,model_sf_inbound_and_outbound_records_of_functional_tools,base.group_user,1,0,1,0
+
access_sf_cam_work_order_program_knife_plan,sf.cam.work.order.program.knife.plan,model_sf_cam_work_order_program_knife_plan,base.group_user,1,1,1,1
access_sf_machine_table_tool_changing_apply,sf.machine.table.tool.changing.apply,model_sf_machine_table_tool_changing_apply,base.group_user,1,1,1,1
diff --git a/sf_tool_management/views/menu_view.xml b/sf_tool_management/views/menu_view.xml
index 24c246ea..301233c4 100644
--- a/sf_tool_management/views/menu_view.xml
+++ b/sf_tool_management/views/menu_view.xml
@@ -17,18 +17,18 @@
@@ -36,7 +36,7 @@
sequence="10"
name="功能刀具出入库记录"
id="menu_sf_function_tool_entry_exit_records"
- action="sf_function_tool_entry_exit_records_view_act"
+ action="sf_inbound_and_outbound_records_of_functional_tools_view_act"
parent="menu_sf_tool_manage"
/>
diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml
index 9d235025..fddba05e 100644
--- a/sf_tool_management/views/tool_base_views.xml
+++ b/sf_tool_management/views/tool_base_views.xml
@@ -40,7 +40,6 @@
-
@@ -106,164 +105,426 @@
-
- sf.functional.cutting.tool.entity.tree
- sf.functional.cutting.tool.entity
+
+ sf.functional.tool.warning.tree
+ sf.functional.tool.warning
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sf.functional.tool.warning.form
+ sf.functional.tool.warning
+
+
+
+
+
+
+ sf.functional.tool.warning.search
+ sf.functional.tool.warning
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
功能刀具预警
ir.actions.act_window
- sf.functional.cutting.tool.entity
- tree
-
-
-
-
-
-
- 功能刀具出入库记录
- sf.functional.cutting.tool.entity
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 功能刀具出入库记录
- ir.actions.act_window
- sf.functional.cutting.tool.entity
- tree
-
+ sf.functional.tool.warning
+ tree,form,search
-
+
功能刀具实时分布
- sf.functional.cutting.tool.entity
+ sf.real.time.distribution.of.functional.tools
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+ 功能刀具实时分布
+ sf.real.time.distribution.of.functional.tools
+
+
+
+
+
+
+ 功能刀具实时分布
+ sf.real.time.distribution.of.functional.tools
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
功能刀具实时分布
ir.actions.act_window
- sf.functional.cutting.tool.entity
- tree
-
+ sf.real.time.distribution.of.functional.tools
+ tree,form,search
+
+
+
+
+
+
+ 功能刀具出入库记录
+ sf.inbound.and.outbound.records.of.functional.tools
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具出入库记录
+ sf.inbound.and.outbound.records.of.functional.tools
+
+
+
+
+
+
+ 功能刀具出入库记录
+ sf.inbound.and.outbound.records.of.functional.tools
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具出入库记录
+ ir.actions.act_window
+ sf.inbound.and.outbound.records.of.functional.tools
+ tree,form,search