From 3236d477c0560c42cdfa93c0bcee313dec392a37 Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Tue, 13 Jun 2023 17:13:15 +0800
Subject: [PATCH 1/5] =?UTF-8?q?sf=E7=9A=84=E5=8A=9F=E8=83=BD=E5=88=80?=
=?UTF-8?q?=E5=85=B7=E5=AE=9E=E6=97=B6=E5=88=86=E5=B8=83=E5=92=8C=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=88=80=E5=85=B7=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0?=
=?UTF-8?q?=E5=BD=95=E8=A7=86=E5=9B=BE=E7=95=8C=E9=9D=A2=E5=B7=B2=E5=BB=BA?=
=?UTF-8?q?=E7=AB=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/__init__.py | 2 +
sf_tool_management/__manifest__.py | 35 +++++
sf_tool_management/models/__init__.py | 4 +
sf_tool_management/models/base.py | 3 +
.../function_tool_entry_exit_records.py | 47 +++++++
.../functional_tool_real_time_distribution.py | 38 ++++++
.../security/ir.model.access.csv | 3 +
.../function_tool_entry_exit_records_view.xml | 125 ++++++++++++++++++
...ional_tool_real_time_distribution_view.xml | 109 +++++++++++++++
sf_tool_management/views/menu_view.xml | 34 +++++
10 files changed, 400 insertions(+)
create mode 100644 sf_tool_management/__init__.py
create mode 100644 sf_tool_management/__manifest__.py
create mode 100644 sf_tool_management/models/__init__.py
create mode 100644 sf_tool_management/models/base.py
create mode 100644 sf_tool_management/models/function_tool_entry_exit_records.py
create mode 100644 sf_tool_management/models/functional_tool_real_time_distribution.py
create mode 100644 sf_tool_management/security/ir.model.access.csv
create mode 100644 sf_tool_management/views/function_tool_entry_exit_records_view.xml
create mode 100644 sf_tool_management/views/functional_tool_real_time_distribution_view.xml
create mode 100644 sf_tool_management/views/menu_view.xml
diff --git a/sf_tool_management/__init__.py b/sf_tool_management/__init__.py
new file mode 100644
index 00000000..041ffad6
--- /dev/null
+++ b/sf_tool_management/__init__.py
@@ -0,0 +1,2 @@
+# -*-coding:utf-8-*-
+from . import models
\ No newline at end of file
diff --git a/sf_tool_management/__manifest__.py b/sf_tool_management/__manifest__.py
new file mode 100644
index 00000000..29eb4eb3
--- /dev/null
+++ b/sf_tool_management/__manifest__.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+{
+ 'name': '机企猫智能工厂 刀具管理',
+ 'version': '1.0',
+ 'summary': '智能工厂刀具管理',
+ 'sequence': 1,
+ 'description': """
+在本模块,定义了主要的角色、菜单、基础业务对象
+ """,
+ 'category': 'sf',
+ 'website': 'https://www.sf.jikimo.com',
+ 'depends': ['account', 'sf_base', 'mrp'],
+ 'data': [
+ 'security/ir.model.access.csv',
+
+ 'views/functional_tool_real_time_distribution_view.xml',
+ 'views/function_tool_entry_exit_records_view.xml',
+ 'views/menu_view.xml',
+
+ ],
+ 'demo': [
+ ],
+ 'assets': {
+
+ 'web.assets_qweb': [
+ ],
+
+
+ },
+ 'license': 'LGPL-3',
+ 'installable': True,
+ 'application': False,
+ 'auto_install': False,
+}
diff --git a/sf_tool_management/models/__init__.py b/sf_tool_management/models/__init__.py
new file mode 100644
index 00000000..6ba6e9ad
--- /dev/null
+++ b/sf_tool_management/models/__init__.py
@@ -0,0 +1,4 @@
+from . import base
+from . import functional_tool_real_time_distribution
+from . import function_tool_entry_exit_records
+
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
new file mode 100644
index 00000000..faaaf799
--- /dev/null
+++ b/sf_tool_management/models/base.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+
diff --git a/sf_tool_management/models/function_tool_entry_exit_records.py b/sf_tool_management/models/function_tool_entry_exit_records.py
new file mode 100644
index 00000000..d40c7478
--- /dev/null
+++ b/sf_tool_management/models/function_tool_entry_exit_records.py
@@ -0,0 +1,47 @@
+from odoo import models,fields,api
+
+
+class FunctionToolEntryExitRecords(models.Model):
+ _name = 'sf.function.tool.entry.exit.records'
+ _description = '功能刀具出入库记录'
+ _inherit = 'sf.functional.cutting.tool'
+
+ order = fields.Char(string='序')
+
+ 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.model
+ def create(self, vals):
+
+ if not vals.get('order'):
+ vals['order'] = self._generate_code()
+ return super(FunctionToolEntryExitRecords, self).create(vals)
+
+ @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
\ No newline at end of file
diff --git a/sf_tool_management/models/functional_tool_real_time_distribution.py b/sf_tool_management/models/functional_tool_real_time_distribution.py
new file mode 100644
index 00000000..7e7fbca8
--- /dev/null
+++ b/sf_tool_management/models/functional_tool_real_time_distribution.py
@@ -0,0 +1,38 @@
+from odoo import fields, models,api
+
+
+class FunctionalToolRealTimeDistribution(models.Model):
+ _name = 'sf.functional.tool.real.time.distribution'
+ _description = "功能刀具实时分布"
+ _inherit = 'sf.functional.cutting.tool'
+
+ order = fields.Char(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='总计')
+ remark = fields.Text(string='备注/说明')
+
+ @api.model
+ def create(self, vals):
+
+ if not vals.get('order'):
+ vals['order'] = self._generate_code()
+ return super(FunctionalToolRealTimeDistribution, self).create(vals)
+
+ @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
\ No newline at end of file
diff --git a/sf_tool_management/security/ir.model.access.csv b/sf_tool_management/security/ir.model.access.csv
new file mode 100644
index 00000000..b902d4e5
--- /dev/null
+++ b/sf_tool_management/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_sf_functional_tool_real_time_distribution,sf.functional.tool.real.time.distribution,model_sf_functional_tool_real_time_distribution,base.group_user,1,1,1,1
+access_sf_function_tool_entry_exit_records,sf.function.tool.entry.exit.records,model_sf_function_tool_entry_exit_records,base.group_user,1,1,1,1
diff --git a/sf_tool_management/views/function_tool_entry_exit_records_view.xml b/sf_tool_management/views/function_tool_entry_exit_records_view.xml
new file mode 100644
index 00000000..b82dce71
--- /dev/null
+++ b/sf_tool_management/views/function_tool_entry_exit_records_view.xml
@@ -0,0 +1,125 @@
+
+
+
+ 功能刀具出入库记录
+ sf.function.tool.entry.exit.records
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具出入库记录
+ sf.function.tool.entry.exit.records
+
+
+
+
+
+
+ 功能刀具出入库记录
+ ir.actions.act_window
+ sf.function.tool.entry.exit.records
+ tree,form
+
+
\ No newline at end of file
diff --git a/sf_tool_management/views/functional_tool_real_time_distribution_view.xml b/sf_tool_management/views/functional_tool_real_time_distribution_view.xml
new file mode 100644
index 00000000..4133bf1f
--- /dev/null
+++ b/sf_tool_management/views/functional_tool_real_time_distribution_view.xml
@@ -0,0 +1,109 @@
+
+
+
+ 功能刀具实时分布
+ sf.functional.tool.real.time.distribution
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具实时分布
+ sf.functional.tool.real.time.distribution
+
+
+
+
+
+
+
+ 功能刀具实时分布
+ ir.actions.act_window
+ sf.functional.tool.real.time.distribution
+ tree,form
+
+
\ No newline at end of file
diff --git a/sf_tool_management/views/menu_view.xml b/sf_tool_management/views/menu_view.xml
new file mode 100644
index 00000000..841f368c
--- /dev/null
+++ b/sf_tool_management/views/menu_view.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 24fd92fa3b12d2ee06187dcb140fa3d8979e6990 Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Wed, 14 Jun 2023 16:27:16 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=AF=B9=E5=8A=9F=E8=83=BD=E5=88=80?=
=?UTF-8?q?=E5=85=B7=E9=A2=84=E8=AD=A6=E3=80=81=E5=AE=9E=E6=97=B6=E5=88=86?=
=?UTF-8?q?=E5=B8=83=E5=92=8C=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95?=
=?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E8=BF=9B=E8=A1=8C=E4=BA=86=E5=90=88?=
=?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/__init__.py | 2 +-
sf_tool_management/__manifest__.py | 5 +-
sf_tool_management/models/__init__.py | 2 -
sf_tool_management/models/base.py | 73 +++++++++
.../function_tool_entry_exit_records.py | 47 ------
.../functional_tool_real_time_distribution.py | 38 -----
.../security/group_security.xml | 4 +
.../security/ir.model.access.csv | 8 +-
.../function_tool_entry_exit_records_view.xml | 125 ---------------
...ional_tool_real_time_distribution_view.xml | 109 -------------
sf_tool_management/views/menu_view.xml | 35 ++++-
sf_tool_management/views/tool_base_views.xml | 146 ++++++++++++++++++
12 files changed, 259 insertions(+), 335 deletions(-)
delete mode 100644 sf_tool_management/models/function_tool_entry_exit_records.py
delete mode 100644 sf_tool_management/models/functional_tool_real_time_distribution.py
create mode 100644 sf_tool_management/security/group_security.xml
delete mode 100644 sf_tool_management/views/function_tool_entry_exit_records_view.xml
delete mode 100644 sf_tool_management/views/functional_tool_real_time_distribution_view.xml
create mode 100644 sf_tool_management/views/tool_base_views.xml
diff --git a/sf_tool_management/__init__.py b/sf_tool_management/__init__.py
index 041ffad6..c081ee06 100644
--- a/sf_tool_management/__init__.py
+++ b/sf_tool_management/__init__.py
@@ -1,2 +1,2 @@
# -*-coding:utf-8-*-
-from . import models
\ No newline at end of file
+from . import models
diff --git a/sf_tool_management/__manifest__.py b/sf_tool_management/__manifest__.py
index 29eb4eb3..8368f528 100644
--- a/sf_tool_management/__manifest__.py
+++ b/sf_tool_management/__manifest__.py
@@ -12,10 +12,9 @@
'website': 'https://www.sf.jikimo.com',
'depends': ['account', 'sf_base', 'mrp'],
'data': [
+ 'security/group_security.xml',
'security/ir.model.access.csv',
-
- 'views/functional_tool_real_time_distribution_view.xml',
- 'views/function_tool_entry_exit_records_view.xml',
+ 'views/tool_base_views.xml',
'views/menu_view.xml',
],
diff --git a/sf_tool_management/models/__init__.py b/sf_tool_management/models/__init__.py
index 6ba6e9ad..c1c7e803 100644
--- a/sf_tool_management/models/__init__.py
+++ b/sf_tool_management/models/__init__.py
@@ -1,4 +1,2 @@
from . import base
-from . import functional_tool_real_time_distribution
-from . import function_tool_entry_exit_records
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index faaaf799..af915884 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -1,3 +1,76 @@
# -*- coding: utf-8 -*-
+from odoo import fields, models, api
+class FunctionalCuttingToolEntity(models.Model):
+ _name = 'sf.functional.cutting.tool.entity'
+ _inherit = 'sf.functional.cutting.tool'
+ _description = '功能刀具管理'
+
+ order = fields.Char(string='序')
+
+ # 功能刀具预警 特有字段
+ 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('备注')
+
+ # 功能刀具出入库记录 特有字段
+ 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='备注/说明')
+
+ # 功能刀具实时分布
+ 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='总计')
+ # remark = fields.Text(string='备注/说明')
+
+ @api.model
+ def create(self, vals):
+
+ if not vals.get('order'):
+ vals['order'] = self._generate_code()
+ return super(FunctionalCuttingToolEntity, self).create(vals)
+
+ @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
diff --git a/sf_tool_management/models/function_tool_entry_exit_records.py b/sf_tool_management/models/function_tool_entry_exit_records.py
deleted file mode 100644
index d40c7478..00000000
--- a/sf_tool_management/models/function_tool_entry_exit_records.py
+++ /dev/null
@@ -1,47 +0,0 @@
-from odoo import models,fields,api
-
-
-class FunctionToolEntryExitRecords(models.Model):
- _name = 'sf.function.tool.entry.exit.records'
- _description = '功能刀具出入库记录'
- _inherit = 'sf.functional.cutting.tool'
-
- order = fields.Char(string='序')
-
- 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.model
- def create(self, vals):
-
- if not vals.get('order'):
- vals['order'] = self._generate_code()
- return super(FunctionToolEntryExitRecords, self).create(vals)
-
- @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
\ No newline at end of file
diff --git a/sf_tool_management/models/functional_tool_real_time_distribution.py b/sf_tool_management/models/functional_tool_real_time_distribution.py
deleted file mode 100644
index 7e7fbca8..00000000
--- a/sf_tool_management/models/functional_tool_real_time_distribution.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from odoo import fields, models,api
-
-
-class FunctionalToolRealTimeDistribution(models.Model):
- _name = 'sf.functional.tool.real.time.distribution'
- _description = "功能刀具实时分布"
- _inherit = 'sf.functional.cutting.tool'
-
- order = fields.Char(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='总计')
- remark = fields.Text(string='备注/说明')
-
- @api.model
- def create(self, vals):
-
- if not vals.get('order'):
- vals['order'] = self._generate_code()
- return super(FunctionalToolRealTimeDistribution, self).create(vals)
-
- @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
\ No newline at end of file
diff --git a/sf_tool_management/security/group_security.xml b/sf_tool_management/security/group_security.xml
new file mode 100644
index 00000000..b8668782
--- /dev/null
+++ b/sf_tool_management/security/group_security.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/sf_tool_management/security/ir.model.access.csv b/sf_tool_management/security/ir.model.access.csv
index b902d4e5..3156f716 100644
--- a/sf_tool_management/security/ir.model.access.csv
+++ b/sf_tool_management/security/ir.model.access.csv
@@ -1,3 +1,7 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_sf_functional_tool_real_time_distribution,sf.functional.tool.real.time.distribution,model_sf_functional_tool_real_time_distribution,base.group_user,1,1,1,1
-access_sf_function_tool_entry_exit_records,sf.function.tool.entry.exit.records,model_sf_function_tool_entry_exit_records,base.group_user,1,1,1,1
+access_sf_functional_cutting_tool_entity,sf.functional.cutting.tool.entity,model_sf_functional_cutting_tool_entity,base.group_user,1,1,1,1
+
+
+
+
+
diff --git a/sf_tool_management/views/function_tool_entry_exit_records_view.xml b/sf_tool_management/views/function_tool_entry_exit_records_view.xml
deleted file mode 100644
index b82dce71..00000000
--- a/sf_tool_management/views/function_tool_entry_exit_records_view.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
- 功能刀具出入库记录
- sf.function.tool.entry.exit.records
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 功能刀具出入库记录
- sf.function.tool.entry.exit.records
-
-
-
-
-
-
- 功能刀具出入库记录
- ir.actions.act_window
- sf.function.tool.entry.exit.records
- tree,form
-
-
\ No newline at end of file
diff --git a/sf_tool_management/views/functional_tool_real_time_distribution_view.xml b/sf_tool_management/views/functional_tool_real_time_distribution_view.xml
deleted file mode 100644
index 4133bf1f..00000000
--- a/sf_tool_management/views/functional_tool_real_time_distribution_view.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
- 功能刀具实时分布
- sf.functional.tool.real.time.distribution
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 功能刀具实时分布
- sf.functional.tool.real.time.distribution
-
-
-
-
-
-
-
- 功能刀具实时分布
- ir.actions.act_window
- sf.functional.tool.real.time.distribution
- tree,form
-
-
\ No newline at end of file
diff --git a/sf_tool_management/views/menu_view.xml b/sf_tool_management/views/menu_view.xml
index 841f368c..2abf6a11 100644
--- a/sf_tool_management/views/menu_view.xml
+++ b/sf_tool_management/views/menu_view.xml
@@ -1,18 +1,37 @@
-
+
+
+ 功能刀具预警
+ ir.actions.act_window
+ sf.functional.cutting.tool.entity
+ tree
+
+
+
+
+ name="功能刀具列表"
+ sequence="3"
+ action="sf_base.action_sf_functional_cutting_tool"
+ />
+
+
+
+ />
+ />
\ No newline at end of file
diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml
new file mode 100644
index 00000000..8bf5a904
--- /dev/null
+++ b/sf_tool_management/views/tool_base_views.xml
@@ -0,0 +1,146 @@
+
+
+
+
+
+ sf.functional.cutting.tool.entity.tree
+ sf.functional.cutting.tool.entity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具出入库记录
+ sf.functional.cutting.tool.entity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 功能刀具出入库记录
+ 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
+
+
+
+
+
From fc6b756aaf48d057c8a530ca10f4a3184d69d8eb Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Thu, 15 Jun 2023 09:57:14 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=85=B3=E8=81=94=E4=BA=86=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=88=80=E5=85=B7=E5=92=8C=E5=8A=9F=E8=83=BD=E5=88=80?=
=?UTF-8?q?=E5=85=B7=E7=AE=A1=E7=90=86=E4=BF=A9=E4=B8=AA=E5=AF=B9=E8=B1=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_tool_management/models/base.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py
index af915884..691b7268 100644
--- a/sf_tool_management/models/base.py
+++ b/sf_tool_management/models/base.py
@@ -8,7 +8,7 @@ class FunctionalCuttingToolEntity(models.Model):
_description = '功能刀具管理'
order = fields.Char(string='序')
-
+ functional_cutting_tool_id = fields.Many2one('sf.functional.cutting.tool', string='功能刀具', invisible=True)
# 功能刀具预警 特有字段
install_tool_time = fields.Char("装刀时间")
outbound_time = fields.Char('出库时间')
From b1da7a8fdafd0345038e3957cb563045d433a718 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 15 Jun 2023 12:20:26 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E5=9E=8B=E5=8F=B7=E5=AF=B9=E8=B1=A1?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=90=9C=E7=B4=A2=E8=A7=86=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/views/tool_base_views.xml | 89 +++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
diff --git a/sf_base/views/tool_base_views.xml b/sf_base/views/tool_base_views.xml
index 1dfb7ca7..2d4a88fb 100644
--- a/sf_base/views/tool_base_views.xml
+++ b/sf_base/views/tool_base_views.xml
@@ -35,6 +35,18 @@
+
+
+ sf.cutting.tool.material.search
+ sf.cutting.tool.material
+
+
+
+
+
+
+
+
sf.functional.cutting.tool.tree
@@ -100,6 +112,17 @@
+
+
+ sf.functional.cutting.tool.search
+ sf.functional.cutting.tool
+
+
+
+
+
+
+
@@ -169,6 +192,17 @@
+
+
+ sf.integral.cutting.tool.search
+ sf.integral.cutting.tool
+
+
+
+
+
+
+
sf.blade.tree
@@ -233,6 +267,17 @@
+
+
+ sf.blade.search
+ sf.blade
+
+
+
+
+
+
+
sf.cutter.bar.tree
@@ -300,6 +345,17 @@
+
+
+ sf.cutter.bar.search
+ sf.cutter.bar
+
+
+
+
+
+
+
@@ -366,6 +422,17 @@
+
+
+ sf.cutter.pad.search
+ sf.cutter.pad
+
+
+
+
+
+
+
@@ -434,6 +501,17 @@
+
+
+ sf.handle.search
+ sf.handle
+
+
+
+
+
+
+
@@ -499,6 +577,17 @@
+
+
+ sf.chuck.search
+ sf.chuck
+
+
+
+
+
+
+
From ba93adfb7b5a5498f37afefd3926667f0acb421d Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 15 Jun 2023 15:40:23 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5bug?=
=?UTF-8?q?=EF=BC=88=E5=88=80=E7=89=87=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5?=
=?UTF-8?q?=E6=97=A0=E5=80=BC=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/views/tool_base_menu.xml | 2 +-
sf_mrs_connect/models/res_config_setting.py | 97 +++++++++++----------
sf_mrs_connect/models/sync_common.py | 10 +--
3 files changed, 55 insertions(+), 54 deletions(-)
diff --git a/sf_base/views/tool_base_menu.xml b/sf_base/views/tool_base_menu.xml
index bfb56640..aef0c124 100644
--- a/sf_base/views/tool_base_menu.xml
+++ b/sf_base/views/tool_base_menu.xml
@@ -11,7 +11,7 @@
- 功能刀具型号
+ 功能刀具
ir.actions.act_window
sf.functional.cutting.tool
tree,form
diff --git a/sf_mrs_connect/models/res_config_setting.py b/sf_mrs_connect/models/res_config_setting.py
index c62f5be3..92433e1e 100644
--- a/sf_mrs_connect/models/res_config_setting.py
+++ b/sf_mrs_connect/models/res_config_setting.py
@@ -46,95 +46,96 @@ class ResConfigSettings(models.TransientModel):
_logger.info("同步资源库刀具")
# self.env['sf.production.process.parameter'].sync_all_production_process_parameter()
# _logger.info("同步表面工艺参数")
- _logger.info("定时同步每日功能刀具类型列表...")
- # self.env['sf.functional.cutting.tool.model'].sync_functional_cutting_tool_model()
- _logger.info("同步每日功能刀具类型完成")
+ # _logger.info("定时同步每日功能刀具类型列表...")
+ # # self.env['sf.functional.cutting.tool.model'].sync_functional_cutting_tool_model()
+ # _logger.info("同步每日功能刀具类型完成")
_logger.info("同步所有功能刀具类型...")
self.env['sf.functional.cutting.tool.model'].sync_all_functional_cutting_tool_model()
_logger.info("同步所有功能刀具类型完成")
- _logger.info("定时同步每日整体式刀具类型列表...")
- # self.env['sf.integral.cutting.tool'].sync_integral_cutting_tool()
- _logger.info("同步整体式刀具类型完成")
- _logger.info("同步每日刀具物料...")
- self.env['sf.cutting.tool.material'].sync_cutting_tool_material()
- _logger.info("同步每日刀具物料完成")
+ # _logger.info("定时同步每日整体式刀具类型列表...")
+ # # self.env['sf.integral.cutting.tool'].sync_integral_cutting_tool()
+ # _logger.info("同步整体式刀具类型完成")
+ # _logger.info("同步每日刀具物料...")
+ # self.env['sf.cutting.tool.material'].sync_cutting_tool_material()
+ # _logger.info("同步每日刀具物料完成")
_logger.info("同步所有刀具物料...")
self.env['sf.cutting.tool.material'].sync_all_cutting_tool_material()
- _logger.info("同步每日刀片类型列表...")
- self.env['sf.blade.model'].sync_blade_model()
- _logger.info("同步每日刀片类型完成")
+ _logger.info("同步所有刀具物料完成")
+ # _logger.info("同步每日刀片类型列表...")
+ # self.env['sf.blade.model'].sync_blade_model()
+ # _logger.info("同步每日刀片类型完成")
_logger.info("同步所有刀片类型列表...")
self.env['sf.blade.model'].sync_all_blade_model()
_logger.info("同步所有刀片类型完成")
- _logger.info("同步每日刀杆类型...")
- self.env['sf.cutter.bar.model'].sync_cutter_bar_model()
- _logger.info("同步每日刀杆类型完成")
+ # _logger.info("同步每日刀杆类型...")
+ # self.env['sf.cutter.bar.model'].sync_cutter_bar_model()
+ # _logger.info("同步每日刀杆类型完成")
_logger.info("同步所有刀杆类型...")
self.env['sf.cutter.bar.model'].sync_all_cutter_bar_model()
_logger.info("同步所有刀杆类型完成")
- _logger.info("同步每日刀盘类型...")
- self.env['sf.cutter.pad.model'].sync_cutter_pad_model()
- _logger.info("同步每日刀盘类型完成")
+ # _logger.info("同步每日刀盘类型...")
+ # self.env['sf.cutter.pad.model'].sync_cutter_pad_model()
+ # _logger.info("同步每日刀盘类型完成")
_logger.info("同步所有刀盘类型...")
self.env['sf.cutter.pad.model'].sync_all_cutter_pad_model()
_logger.info("同步所有刀盘类型完成")
- _logger.info("同步每日刀柄类型...")
- self.env['sf.handle.model'].sync_handle_model()
- _logger.info("同步每日刀柄类型完成")
+ # _logger.info("同步每日刀柄类型...")
+ # self.env['sf.handle.model'].sync_handle_model()
+ # _logger.info("同步每日刀柄类型完成")
_logger.info("同步所有刀柄类型...")
self.env['sf.handle.model'].sync_all_handle_model()
_logger.info("同步所有刀柄类型完成")
- _logger.info("同步每日夹头类型...")
- self.env['sf.chuck.model'].sync_chuck_model()
- _logger.info("同步每日夹头类型完成")
+ # _logger.info("同步每日夹头类型...")
+ # self.env['sf.chuck.model'].sync_chuck_model()
+ # _logger.info("同步每日夹头类型完成")
_logger.info("同步所有夹头类型...")
self.env['sf.chuck.model'].sync_all_chuck_model()
_logger.info("同步所有夹头类型完成")
- _logger.info("同步每日整体式刀具类型...")
- self.env['sf.integral.cutting.tool.model'].sync_integral_cutting_tool_model()
- _logger.info("同步每日整体式刀具类型完成")
+ # _logger.info("同步每日整体式刀具类型...")
+ # self.env['sf.integral.cutting.tool.model'].sync_integral_cutting_tool_model()
+ # _logger.info("同步每日整体式刀具类型完成")
_logger.info("同步所有整体式刀具类型...")
self.env['sf.integral.cutting.tool.model'].sync_all_integral_cutting_tool_model()
_logger.info("同步所有整体式刀具类型完成")
- _logger.info("同步每日刀片列表...")
- self.env['sf.blade'].sync_blade()
- _logger.info("同步每日刀片完成")
+ # _logger.info("同步每日刀片列表...")
+ # self.env['sf.blade'].sync_blade()
+ # _logger.info("同步每日刀片完成")
_logger.info("同步所有刀片列表...")
self.env['sf.blade'].sync_all_blade()
_logger.info("同步所有刀片完成")
- _logger.info("同步每日刀杆列表...")
- self.env['sf.cutter.bar'].sync_cutter_bar()
- _logger.info("同步每日刀杆完成")
+ # _logger.info("同步每日刀杆列表...")
+ # self.env['sf.cutter.bar'].sync_cutter_bar()
+ # _logger.info("同步每日刀杆完成")
_logger.info("同步所有刀杆列表...")
self.env['sf.cutter.bar'].sync_all_cutter_bar()
_logger.info("同步所有刀杆完成")
- _logger.info("同步每日刀盘列表...")
- self.env['sf.cutter.pad'].sync_cutter_pad()
- _logger.info("同步每日刀盘完成")
+ # _logger.info("同步每日刀盘列表...")
+ # self.env['sf.cutter.pad'].sync_cutter_pad()
+ # _logger.info("同步每日刀盘完成")
_logger.info("同步所有刀盘列表...")
self.env['sf.cutter.pad'].sync_all_cutter_pad()
_logger.info("同步所有刀盘完成")
- _logger.info("同步每日刀柄列表...")
- self.env['sf.handle'].sync_handle()
- _logger.info("同步每日刀柄完成")
+ # _logger.info("同步每日刀柄列表...")
+ # self.env['sf.handle'].sync_handle()
+ # _logger.info("同步每日刀柄完成")
_logger.info("同步所有刀柄列表...")
self.env['sf.handle'].sync_all_handle()
_logger.info("同步所有刀柄完成")
- _logger.info("同步每日夹头列表...")
- self.env['sf.chuck'].sync_chuck()
- _logger.info("同步每日夹头完成")
+ # _logger.info("同步每日夹头列表...")
+ # self.env['sf.chuck'].sync_chuck()
+ # _logger.info("同步每日夹头完成")
_logger.info("同步所有夹头列表...")
self.env['sf.chuck'].sync_all_chuck()
_logger.info("同步所有夹头完成")
- _logger.info("同步每日整体式刀具列表...")
- self.env['sf.integral.cutting.tool'].sync_integral_cutting_tool()
- _logger.info("同步每日整体式刀具完成")
+ # _logger.info("同步每日整体式刀具列表...")
+ # self.env['sf.integral.cutting.tool'].sync_integral_cutting_tool()
+ # _logger.info("同步每日整体式刀具完成")
_logger.info("同步所有整体式刀具列表...")
self.env['sf.integral.cutting.tool'].sync_all_integral_cutting_tool()
_logger.info("同步所有整体式刀具完成")
- _logger.info("同步每日同步功能刀具列表...")
- self.env['sf.functional.cutting.tool'].sync_functional_cutting_tool()
- _logger.info("同步每日功能刀具列表完成")
+ # _logger.info("同步每日同步功能刀具列表...")
+ # self.env['sf.functional.cutting.tool'].sync_functional_cutting_tool()
+ # _logger.info("同步每日功能刀具列表完成")
_logger.info("同步所有功能刀具列表...")
self.env['sf.functional.cutting.tool'].sync_all_functional_cutting_tool()
_logger.info("同步所有功能刀具列表完成")
diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py
index 8fcbee28..b1bfde46 100644
--- a/sf_mrs_connect/models/sync_common.py
+++ b/sf_mrs_connect/models/sync_common.py
@@ -2150,7 +2150,7 @@ class SyncCutterBar(models.Model):
self.env['sf.cutter.bar'].create({
"code": item['code'],
"name": item['name'],
- "cutter_bar_model_number": self.env['sf.cutter.bar'].search(
+ "cutter_bar_model_number": self.env['sf.cutter.bar.model'].search(
[("code", '=', item['cutter_bar_model_number'])]).id,
"brand": self.env['sf.machine.brand'].search(
[("code", '=', item['brand'])]).id,
@@ -2175,7 +2175,7 @@ class SyncCutterBar(models.Model):
brand.write({
"code": item['code'],
"name": item['name'],
- "cutter_bar_model_number": self.env['sf.cutter.bar'].search(
+ "cutter_bar_model_number": self.env['sf.cutter.bar.model'].search(
[("code", '=', item['cutter_bar_model_number'])]).id,
"brand": self.env['sf.machine.brand'].search(
[("code", '=', item['brand'])]).id,
@@ -2211,7 +2211,7 @@ class SyncCutterBar(models.Model):
r = requests.post(strUrl, json={}, data=None, headers=headers)
r = r.json()
result = json.loads(r['result'])
- # print('result:%s' % result)
+ print('result:%s' % result)
if result['status'] == 1:
if result.get('mrs_cutter_bar_all_list'):
for item in result['mrs_cutter_bar_all_list']:
@@ -2232,7 +2232,7 @@ class SyncCutterBar(models.Model):
self.env['sf.cutter.bar'].create({
"code": item['code'],
"name": item['name'],
- "cutter_bar_model_number": self.env['sf.cutter.bar'].search(
+ "cutter_bar_model_number": self.env['sf.cutter.bar.model'].search(
[("code", '=', item['cutter_bar_model_number'])]).id,
"brand": self.env['sf.machine.brand'].search(
[("code", '=', item['brand'])]).id,
@@ -2257,7 +2257,7 @@ class SyncCutterBar(models.Model):
brand.write({
"code": item['code'],
"name": item['name'],
- "cutter_bar_model_number": self.env['sf.cutter.bar'].search(
+ "cutter_bar_model_number": self.env['sf.cutter.bar.model'].search(
[("code", '=', item['cutter_bar_model_number'])]).id,
"brand": self.env['sf.machine.brand'].search(
[("code", '=', item['brand'])]).id,