From d3c7f8cd5686012afee61d888cd2cb8a773c46e6 Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Tue, 25 Jul 2023 17:42:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=88=80=E5=85=B7=E5=88=97=E8=A1=A8=E7=9A=84form=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E7=AE=80=E5=8C=96=E4=BA=86tree=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/base.py | 93 +++++++++++++--- sf_tool_management/views/tool_base_views.xml | 108 +++++++++++++++---- 2 files changed, 166 insertions(+), 35 deletions(-) diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index b20ba2b0..f5d88caf 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -12,7 +12,7 @@ class FunctionalCuttingToolEntity(models.Model): _inherits = {'sf.functional.cutting.tool': 'sf_functional_cutting_tool_entity_id'} # 新添加的关联到原模型的字段 - sf_functional_cutting_tool_entity_id = fields.Many2one('sf.functional.cutting.tool', ondelete='cascade') + 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) # 功能刀具预警 特有字段 @@ -53,18 +53,18 @@ class FunctionalCuttingToolEntity(models.Model): # remark = fields.Text(string='备注/说明') # 功能刀具实时分布 - tool_stock_num = fields.Text(string='刀具房库存数量') - side_shelf_num = fields.Text(string='线边货架货架数量') - on_tool_stock_num = fields.Text(string='机内刀库库存数量') - tool_stock_total = fields.Text(string='合计') - return_reuse_num_re = fields.Text(string='归还再用数量(精)') - return_reuse_num_co = fields.Text(string='归还再用数量(粗)') - return_processing_num = fields.Text(string='归还需磨削数量') - return_total = fields.Text(string='合计') - total = fields.Text(string='总计') - + 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='备注/说明') + # @api.onchange('functional_cutting_tool_id') # def get_functional_cutting_tool_info(self): # for item in self: @@ -90,7 +90,6 @@ class FunctionalCuttingToolEntity(models.Model): @api.model def create(self, vals): - if not vals.get('order'): vals['order'] = self._generate_code() return super(FunctionalCuttingToolEntity, self).create(vals) @@ -105,6 +104,76 @@ class FunctionalCuttingToolEntity(models.Model): new_code = '001' return new_code +# 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('备注') + + class MachineTableToolChangingApply(models.Model): _name = 'sf.machine.table.tool.changing.apply' diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml index 00d72f7a..9d235025 100644 --- a/sf_tool_management/views/tool_base_views.xml +++ b/sf_tool_management/views/tool_base_views.xml @@ -6,37 +6,102 @@ sf.functional.cutting.tool.entity.list.tree sf.functional.cutting.tool.entity - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + sf.functional.cutting.tool.entity.list.form + sf.functional.cutting.tool.entity + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + sf.functional.cutting.tool.entity.list.tree + sf.functional.cutting.tool.entity + + + + + + + + + + + + + + + + + + 功能刀具列表 ir.actions.act_window sf.functional.cutting.tool.entity - tree + tree,form,search @@ -49,7 +114,6 @@ - @@ -106,7 +170,6 @@ - @@ -164,7 +227,6 @@ -