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/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css new file mode 100644 index 00000000..de17fabb --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.css @@ -0,0 +1,6 @@ +.zoomed { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%) scale(20); +} diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js new file mode 100644 index 00000000..f3cadea1 --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.js @@ -0,0 +1,26 @@ +/** @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() { + super.setup(); // 调用父类的setup方法 + // 你自己的代码 + } + onImageClick(event) { + // 放大图片逻辑 + // 获取图片元素 + const img = event.target; + + // 实现放大图片逻辑 + // 比如使用 CSS 放大 + img.classList.add('zoomed'); + } +} +MyCustomWidget.template = "sf_plan.MyCustomWidget" +// MyCustomWidget.supportedTypes = ['many2many']; + +registry.category("fields").add("custom_many2many_checkboxes", MyCustomWidget); diff --git a/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml new file mode 100644 index 00000000..91eaff59 --- /dev/null +++ b/jikimo_frontend/static/src/fields/custom_many2many_checkboxes/custom_many2many_checkboxes.xml @@ -0,0 +1,27 @@ + + + + +
+ +
+ + + + + +
+
+ + + +
+
+
+
+ +
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 5c858f9a..de7c9ee0 100644 --- a/sf_dlm/views/product_template_view.xml +++ b/sf_dlm/views/product_template_view.xml @@ -359,6 +359,9 @@ + + + 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 @@ -