From ae3f7c9c0c089f23a8d6a761edc9953b9dfe1202 Mon Sep 17 00:00:00 2001
From: yuxianghui <1608204036@qq.com>
Date: Wed, 6 Sep 2023 17:24:08 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=87=E5=89=8A?=
=?UTF-8?q?=E9=80=9F=E5=BA=A6Vc=E5=AF=B9=E8=B1=A1=EF=BC=8C=E4=BA=A7?=
=?UTF-8?q?=E5=93=81-=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7?=
=?UTF-8?q?=E7=89=A9=E6=96=99=E6=96=B0=E5=A2=9E=E5=88=87=E5=89=8A=E9=80=9F?=
=?UTF-8?q?=E5=BA=A6Vc=E5=85=B3=E8=81=94=E5=AD=97=E6=AE=B5=EF=BC=9B?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86=E4=BA=A7=E5=93=81-?=
=?UTF-8?q?=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7=E5=90=8C=E6=AD=A5?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE-=E5=88=80=E5=85=B7=E5=9E=8B=E5=8F=B7-?=
=?UTF-8?q?=E6=95=B4=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7=E5=8F=82=E6=95=B0?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_base/models/tool_other_features.py | 34 ++++++++++++++++++-
sf_base/security/ir.model.access.csv | 1 +
sf_base/views/tool_other_features_view.xml | 33 +++++++++++++++++++
sf_dlm/views/product_template_view.xml | 3 ++
sf_manufacturing/models/product_template.py | 36 ++-------------------
5 files changed, 72 insertions(+), 35 deletions(-)
diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py
index 52acf25c..129b0199 100644
--- a/sf_base/models/tool_other_features.py
+++ b/sf_base/models/tool_other_features.py
@@ -38,4 +38,36 @@ class SuitableCoolant(models.Model):
_description = '适合冷却液'
name = fields.Char('名称')
- image = fields.Image('图片')
\ No newline at end of file
+ image = fields.Image('图片')
+
+
+class CuttingSpeed(models.Model):
+ _name = 'sf.cutting.speed'
+ _description = '切削速度Vc'
+
+ # def _get_order(self):
+ # last_tool = self.search([], order='id desc', limit=1)
+ # if last_tool:
+ # last_order = int(last_tool.order)
+ # new_order = last_order + 1
+ # else:
+ # new_order = '1'
+ # return new_order
+ #
+ # order = fields.Char('序', default=_get_order, readonly=True)
+
+ execution_standard_id = fields.Char('执行标准')
+ material_code = fields.Char('材料代号')
+ material_name = fields.Char('材料名称')
+ material_grade = fields.Char('材料牌号')
+ tensile_strength = fields.Char('拉伸强度 (N/mm²)')
+ hardness = fields.Char('硬度(HRC)')
+
+ cutting_speed_n1 = fields.Char('径向切宽 ae=100%D1 ap=1*D1 切削速度Vc')
+ cutting_speed_n2 = fields.Char('径向切宽 ae=50%D1 ap=1.5*D1 切削速度Vc')
+ cutting_speed_n3 = fields.Char('径向切宽 ae=25%D1 ap=L1max 切削速度Vc')
+ cutting_speed_n4 = fields.Char('径向切宽 ae=15%D1 ap=L1max 切削速度Vc')
+ cutting_speed_n5 = fields.Char('径向切宽 ae=5%D1 ap=L1max 切削速度Vc')
+ rough_machining = fields.Char('粗加工 Vc(m/min)')
+ precision_machining = fields.Char('精加工 Vc(m/min)')
+ application = fields.Selection([('主应用', '主应用'), ('次应用', '次应用')], '主/次应用')
\ No newline at end of file
diff --git a/sf_base/security/ir.model.access.csv b/sf_base/security/ir.model.access.csv
index ba3fb3d0..73661ae8 100644
--- a/sf_base/security/ir.model.access.csv
+++ b/sf_base/security/ir.model.access.csv
@@ -29,6 +29,7 @@ access_sf_blade_tip_characteristics,sf_blade_tip_characteristics,model_sf_blade_
access_sf_handle_type,sf_handle_type,model_sf_handle_type,base.group_user,1,1,1,1
access_sf_cutting_direction,sf_cutting_direction,model_sf_cutting_direction,base.group_user,1,1,1,1
access_sf_suitable_coolant,sf_suitable_coolant,model_sf_suitable_coolant,base.group_user,1,1,1,1
+access_sf_cutting_speed,sf_cutting_speed,model_sf_cutting_speed,base.group_user,1,1,1,1
diff --git a/sf_base/views/tool_other_features_view.xml b/sf_base/views/tool_other_features_view.xml
index e094a376..df614171 100644
--- a/sf_base/views/tool_other_features_view.xml
+++ b/sf_base/views/tool_other_features_view.xml
@@ -98,4 +98,37 @@
sf.suitable.coolant
tree
+
+
+
+
+ 切削速度Vc
+ sf.cutting.speed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 切削速度Vc
+ ir.actions.act_window
+ sf.cutting.speed
+ tree
+
\ No newline at end of file
diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml
index c7622563..9a2f3b4f 100644
--- a/sf_dlm/views/product_template_view.xml
+++ b/sf_dlm/views/product_template_view.xml
@@ -225,6 +225,9 @@
+
+
+
diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py
index 2a91f7f1..98e4247a 100644
--- a/sf_manufacturing/models/product_template.py
+++ b/sf_manufacturing/models/product_template.py
@@ -100,6 +100,8 @@ class ResProductMo(models.Model):
cutting_direction_ids = fields.Many2many('sf.cutting.direction', 'rel_cutting_direction_product_template', '走刀方向')
suitable_coolant_ids = fields.Many2many('sf.suitable.coolant', 'rel_suitable_coolant_product_template', '适合冷却液')
+ cutting_speed_ids = fields.Many2many('sf.cutting.speed', 'rel_sf_cutting_speed', '切削速度Vc')
+
@api.constrains('suitable_machining_method_ids')
def _check_suitable_machining_method_ids(self):
for record in self:
@@ -421,23 +423,6 @@ class ResProductMo(models.Model):
item.coating_material = item.cutting_tool_model_id.coating_material
item.cutting_tool_total_length = item.cutting_tool_model_id.total_length
item.cutting_tool_shank_length = item.cutting_tool_model_id.shank_length
- item.integral_neck_length = item.cutting_tool_model_id.integral_neck_length
- item.integral_shank_diameter = item.cutting_tool_model_id.integral_shank_diameter
- item.integral_blade_diameter = item.cutting_tool_model_id.integral_blade_diameter
- item.integral_neck_diameter = item.cutting_tool_model_id.integral_neck_diameter
- item.integral_blade_tip_diameter = item.cutting_tool_model_id.integral_blade_tip_diameter
- item.integral_blade_tip_taper = item.cutting_tool_model_id.integral_blade_tip_taper
- item.integral_blade_helix_angle = item.cutting_tool_model_id.integral_blade_helix_angle
- item.integral_blade_type = item.cutting_tool_model_id.integral_blade_type
- item.integral_coarse_medium_fine = item.cutting_tool_model_id.integral_coarse_medium_fine
- item.integral_hardness = item.cutting_tool_model_id.integral_hardness
- item.integral_run_out_accuracy_max = item.cutting_tool_model_id.integral_run_out_accuracy_max
- item.integral_run_out_accuracy_min = item.cutting_tool_model_id.integral_run_out_accuracy_min
- item.suitable_machining_method_ids = self._get_ids(item.cutting_tool_model_id.suitable_machining_method_ids)
- item.blade_tip_characteristics_ids = self._get_ids(item.cutting_tool_model_id.blade_tip_characteristics_ids)
- item.handle_type_ids = self._get_ids(item.cutting_tool_model_id.handle_type_ids)
- item.cutting_direction_ids = self._get_ids(item.cutting_tool_model_id.cutting_direction_ids)
- item.suitable_coolant_ids = self._get_ids(item.cutting_tool_model_id.suitable_coolant_ids)
item.cutting_tool_diameter = item.cutting_tool_model_id.diameter
item.cutting_tool_blade_number = item.cutting_tool_model_id.blade_number
item.cutting_tool_front_angle = item.cutting_tool_model_id.front_angle
@@ -476,23 +461,6 @@ class ResProductMo(models.Model):
item.cutting_tool_total_length = False
item.cutting_tool_shank_length = False
item.cutting_tool_blade_length = False
- item.integral_neck_length = False
- item.integral_shank_diameter = False
- item.integral_blade_diameter = False
- item.integral_neck_diameter = False
- item.integral_blade_tip_diameter = False
- item.integral_blade_tip_taper = False
- item.integral_blade_helix_angle = False
- item.integral_blade_type = False
- item.integral_coarse_medium_fine = False
- item.integral_hardness = False
- item.integral_run_out_accuracy_max = False
- item.integral_run_out_accuracy_min = False
- item.suitable_machining_method_ids = False
- item.blade_tip_characteristics_ids = False
- item.handle_type_ids = False
- item.cutting_direction_ids = False
- item.suitable_coolant_ids = False
item.cutting_tool_diameter = False
item.cutting_tool_blade_number = False
item.cutting_tool_front_angle = False
From 78e3a0f24f72c53d4b92ffefe5f5747cbf331a02 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 7 Sep 2023 12:33:35 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89widget=E6=98=BE?=
=?UTF-8?q?=E7=A4=BAmany2many=E5=9B=BE=E6=96=87=E5=9F=BA=E6=9C=AC=E5=AE=9E?=
=?UTF-8?q?=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_plan/__manifest__.py | 2 ++
sf_plan/static/src/js/custom_many2many.js | 22 ++++++++++++++++++++
sf_plan/static/src/xml/custom_many2many.xml | 23 +++++++++++++++++++++
3 files changed, 47 insertions(+)
create mode 100644 sf_plan/static/src/js/custom_many2many.js
create mode 100644 sf_plan/static/src/xml/custom_many2many.xml
diff --git a/sf_plan/__manifest__.py b/sf_plan/__manifest__.py
index ba43169d..b39ad8af 100644
--- a/sf_plan/__manifest__.py
+++ b/sf_plan/__manifest__.py
@@ -24,6 +24,8 @@
'web.assets_qweb': [
],
'web.assets_backend': [
+ 'sf_plan/static/src/js/custom_many2many.js',
+ 'sf_plan/static/src/xml/custom_many2many.xml',
'sf_plan/static/src/scss/gannt_change.scss',
'sf_plan/static/src/css/button_color.css'
],
diff --git a/sf_plan/static/src/js/custom_many2many.js b/sf_plan/static/src/js/custom_many2many.js
new file mode 100644
index 00000000..df3c6e48
--- /dev/null
+++ b/sf_plan/static/src/js/custom_many2many.js
@@ -0,0 +1,22 @@
+/** @odoo-module **/
+
+import { Many2ManyCheckboxesField } from "@web/views/fields/many2many_checkboxes/many2many_checkboxes_field";
+import { registry } from "@web/core/registry";
+
+export class MyCustomWidget extends Many2ManyCheckboxesField {
+ // 你可以重写或者添加一些方法和属性
+ // 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量
+ setup() {
+ console.log('111111111222222222222')
+ super.setup(); // 调用父类的setup方法
+ // 你自己的代码
+ }
+ onImageClick(event) {
+ // 放大图片逻辑
+ console.log('chongchongchong')
+ }
+}
+MyCustomWidget.template = "sf_plan.MyCustomWidget"
+// MyCustomWidget.supportedTypes = ['many2many'];
+
+registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget);
diff --git a/sf_plan/static/src/xml/custom_many2many.xml b/sf_plan/static/src/xml/custom_many2many.xml
new file mode 100644
index 00000000..805de6e3
--- /dev/null
+++ b/sf_plan/static/src/xml/custom_many2many.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From e0bfea40e1becc58368b1947882a856270e510bb Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 7 Sep 2023 15:16:03 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E6=94=BE=E5=A4=A7=E5=9B=BE=E7=89=87=E7=9A=84?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_plan/__manifest__.py | 1 +
sf_plan/static/src/css/img_scale.css | 6 ++++++
sf_plan/static/src/js/custom_many2many.js | 8 +++++++-
sf_plan/static/src/xml/custom_many2many.xml | 10 +++++++---
4 files changed, 21 insertions(+), 4 deletions(-)
create mode 100644 sf_plan/static/src/css/img_scale.css
diff --git a/sf_plan/__manifest__.py b/sf_plan/__manifest__.py
index b39ad8af..3acff39e 100644
--- a/sf_plan/__manifest__.py
+++ b/sf_plan/__manifest__.py
@@ -26,6 +26,7 @@
'web.assets_backend': [
'sf_plan/static/src/js/custom_many2many.js',
'sf_plan/static/src/xml/custom_many2many.xml',
+ 'sf_plan/static/src/css/img_scale.css',
'sf_plan/static/src/scss/gannt_change.scss',
'sf_plan/static/src/css/button_color.css'
],
diff --git a/sf_plan/static/src/css/img_scale.css b/sf_plan/static/src/css/img_scale.css
new file mode 100644
index 00000000..de17fabb
--- /dev/null
+++ b/sf_plan/static/src/css/img_scale.css
@@ -0,0 +1,6 @@
+.zoomed {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%) scale(20);
+}
diff --git a/sf_plan/static/src/js/custom_many2many.js b/sf_plan/static/src/js/custom_many2many.js
index df3c6e48..99a09309 100644
--- a/sf_plan/static/src/js/custom_many2many.js
+++ b/sf_plan/static/src/js/custom_many2many.js
@@ -12,8 +12,14 @@ export class MyCustomWidget extends Many2ManyCheckboxesField {
// 你自己的代码
}
onImageClick(event) {
- // 放大图片逻辑
+ // 放大图片逻辑
console.log('chongchongchong')
+ // 获取图片元素
+ const img = event.target;
+
+ // 实现放大图片逻辑
+ // 比如使用 CSS 放大
+ img.classList.add('zoomed');
}
}
MyCustomWidget.template = "sf_plan.MyCustomWidget"
diff --git a/sf_plan/static/src/xml/custom_many2many.xml b/sf_plan/static/src/xml/custom_many2many.xml
index 805de6e3..541afc60 100644
--- a/sf_plan/static/src/xml/custom_many2many.xml
+++ b/sf_plan/static/src/xml/custom_many2many.xml
@@ -11,10 +11,14 @@
onChange="(ev) => this.onChange(item[0], ev)"
>
-
-
-
+
+
+
+
+
+
+
From 797a7207e9880742f8164564db68fade01bb86bf Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 7 Sep 2023 15:32:15 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E2=80=9C=E7=A8=8B?=
=?UTF-8?q?=E5=BA=8F=E4=B8=8B=E8=BD=BD=E2=80=9D=E6=8C=89=E9=92=AE=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_machine_connect/views/compensation.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sf_machine_connect/views/compensation.xml b/sf_machine_connect/views/compensation.xml
index 5ec6f382..f79c539e 100644
--- a/sf_machine_connect/views/compensation.xml
+++ b/sf_machine_connect/views/compensation.xml
@@ -6,7 +6,8 @@
-
+
From 121217d70f3acce6e87229ddba5b14aa2d1553d8 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Thu, 7 Sep 2023 17:54:07 +0800
Subject: [PATCH 5/5] =?UTF-8?q?custom=5Fmany2many=20widget=E6=95=B4?=
=?UTF-8?q?=E5=90=88=E5=88=B0=E5=89=8D=E7=AB=AF=E5=8C=85=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jikimo_frontend/__manifest__.py | 3 ++-
.../custom_many2many_checkboxes.css | 0
.../custom_many2many_checkboxes.js | 4 +---
.../custom_many2many_checkboxes.xml | 2 +-
sf_plan/__manifest__.py | 3 ---
5 files changed, 4 insertions(+), 8 deletions(-)
rename sf_plan/static/src/css/img_scale.css => jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css (100%)
rename sf_plan/static/src/js/custom_many2many.js => jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js (89%)
rename sf_plan/static/src/xml/custom_many2many.xml => jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml (92%)
diff --git a/jikimo_frontend/__manifest__.py b/jikimo_frontend/__manifest__.py
index 7c17b18a..fc3c7549 100644
--- a/jikimo_frontend/__manifest__.py
+++ b/jikimo_frontend/__manifest__.py
@@ -10,7 +10,7 @@
""",
'category': 'sf',
'website': 'https://www.sf.jikimo.com',
- 'depends': ['account', 'base', 'mrp_workorder', 'sale'],
+ 'depends': [],
'data': [
],
@@ -21,6 +21,7 @@
'web.assets_qweb': [
],
'web.assets_backend': [
+ 'jikimo_frontend/static/src/fields/custom_many2many_checkboxes/*',
'jikimo_frontend/static/src/scss/test.scss',
],
diff --git a/sf_plan/static/src/css/img_scale.css b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css
similarity index 100%
rename from sf_plan/static/src/css/img_scale.css
rename to jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css
diff --git a/sf_plan/static/src/js/custom_many2many.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
similarity index 89%
rename from sf_plan/static/src/js/custom_many2many.js
rename to jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
index 99a09309..f3cadea1 100644
--- a/sf_plan/static/src/js/custom_many2many.js
+++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js
@@ -7,14 +7,12 @@ export class MyCustomWidget extends Many2ManyCheckboxesField {
// 你可以重写或者添加一些方法和属性
// 例如,你可以重写setup方法来添加一些事件监听器或者初始化一些变量
setup() {
- console.log('111111111222222222222')
super.setup(); // 调用父类的setup方法
// 你自己的代码
}
onImageClick(event) {
// 放大图片逻辑
- console.log('chongchongchong')
- // 获取图片元素
+ // 获取图片元素
const img = event.target;
// 实现放大图片逻辑
diff --git a/sf_plan/static/src/xml/custom_many2many.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
similarity index 92%
rename from sf_plan/static/src/xml/custom_many2many.xml
rename to jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
index 541afc60..91eaff59 100644
--- a/sf_plan/static/src/xml/custom_many2many.xml
+++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/sf_plan/__manifest__.py b/sf_plan/__manifest__.py
index 3acff39e..ba43169d 100644
--- a/sf_plan/__manifest__.py
+++ b/sf_plan/__manifest__.py
@@ -24,9 +24,6 @@
'web.assets_qweb': [
],
'web.assets_backend': [
- 'sf_plan/static/src/js/custom_many2many.js',
- 'sf_plan/static/src/xml/custom_many2many.xml',
- 'sf_plan/static/src/css/img_scale.css',
'sf_plan/static/src/scss/gannt_change.scss',
'sf_plan/static/src/css/button_color.css'
],