diff --git a/sf_base/models/tool_other_features.py b/sf_base/models/tool_other_features.py
index b4f8b191..56c8c8a6 100644
--- a/sf_base/models/tool_other_features.py
+++ b/sf_base/models/tool_other_features.py
@@ -6,6 +6,7 @@ class ToolMaterialsBasicParameters(models.Model):
_description = '刀具物料基本参数'
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀具标准库')
+ specification_id = fields.Many2one('sf.cutting_tool.specification.wizard', string='刀具规格')
cutting_tool_type = fields.Char(related='standard_library_id.cutting_tool_type', string='刀具物料类型',
store=True)
# cutting_tool_type_1 = fields.Char(related='cutting_tool_type', string='类型', store=True)
@@ -288,7 +289,8 @@ class CuttingSpeed(models.Model):
_name = 'sf.cutting.speed'
_description = '切削速度Vc'
- # product_template_id = fields.Many2one('product.template', string='产品')
+ product_template_id = fields.Many2one('product.template')
+ specification_id = fields.Many2one('sf.cutting_tool.specification.wizard', string='刀具规格')
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
execution_standard_id = fields.Many2one('sf.international.standards', string='执行标准', store=True)
material_code = fields.Char('材料代号')
@@ -333,8 +335,9 @@ class FeedPerTooth(models.Model):
_description = '每齿走刀量fz'
_order = 'machining_method desc, blade_diameter, materials_type_id'
- # product_template_id = fields.Many2one('product.template', string='产品')
+ product_template_id = fields.Many2one('product.template')
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
+ specification_id = fields.Many2one('sf.cutting_tool.specification.wizard', string='刀具规格')
cutting_speed = fields.Char('径向切宽 ae(mm)')
machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式')
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
diff --git a/sf_base/static/src/scss/test.scss b/sf_base/static/src/scss/test.scss
index a54eb808..d8761b94 100644
--- a/sf_base/static/src/scss/test.scss
+++ b/sf_base/static/src/scss/test.scss
@@ -161,4 +161,22 @@ td.o_required_modifier {
display: flex !important;
justify-content: flex-start !important;
align-items: center !important;
-}
\ No newline at end of file
+}
+
+//用于label外的div
+.type_label {
+ display: flex;
+ align-items: center;
+}
+
+.button_width button {
+ width:11rem;
+ margin-top: -9px;
+ height: 2.5rem;
+ line-height: 1.5rem;
+}
+
+.button_width{
+ display: flex;
+}
+
diff --git a/sf_dlm/__init__.py b/sf_dlm/__init__.py
index 737b4772..40272379 100644
--- a/sf_dlm/__init__.py
+++ b/sf_dlm/__init__.py
@@ -1 +1 @@
-# from . import models
+from . import wizard
diff --git a/sf_dlm/__manifest__.py b/sf_dlm/__manifest__.py
index 42c4598a..85906b2b 100644
--- a/sf_dlm/__manifest__.py
+++ b/sf_dlm/__manifest__.py
@@ -16,7 +16,9 @@
'data': [
'data/product_data.xml',
'data/uom_data.xml',
- # 'views/product_template_view.xml',
+ 'security/ir.model.access.csv',
+ 'wizard/cutting_tool_specification_wizard.xml',
+ 'views/product_template_view.xml',
'views/product_workorder.xml'
],
'demo': [
diff --git a/sf_dlm/security/group_security.xml b/sf_dlm/security/group_security.xml
new file mode 100644
index 00000000..b8668782
--- /dev/null
+++ b/sf_dlm/security/group_security.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/sf_dlm/security/ir.model.access.csv b/sf_dlm/security/ir.model.access.csv
new file mode 100644
index 00000000..9039e2c1
--- /dev/null
+++ b/sf_dlm/security/ir.model.access.csv
@@ -0,0 +1,12 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_sf_cutting_tool_specification_wizard,sf_cutting_tool_specification_wizard,model_sf_cutting_tool_specification_wizard,base.group_user,1,1,1,1
+
+
+
+
+
+
+
+
+
+
diff --git a/sf_dlm/views/product_template_view.xml b/sf_dlm/views/product_template_view.xml
index 055898f5..bcb0e894 100644
--- a/sf_dlm/views/product_template_view.xml
+++ b/sf_dlm/views/product_template_view.xml
@@ -51,6 +51,18 @@
attrs="{'invisible': ['|',('categ_type', '!=', '表面工艺'),('categ_type', '=', False)]}"/>
+
+
+
+
+
-
-
-
+
+
+
@@ -309,19 +321,19 @@
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
-->
-
+
@@ -385,7 +397,6 @@
attrs="{'readonly': [('cutting_speed','!=',False)]}"/>
-
diff --git a/sf_dlm/wizard/__init__.py b/sf_dlm/wizard/__init__.py
new file mode 100644
index 00000000..2e93b759
--- /dev/null
+++ b/sf_dlm/wizard/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import cutting_tool_specification_wizard
diff --git a/sf_dlm/wizard/cutting_tool_specification_wizard.py b/sf_dlm/wizard/cutting_tool_specification_wizard.py
new file mode 100644
index 00000000..2a79d27e
--- /dev/null
+++ b/sf_dlm/wizard/cutting_tool_specification_wizard.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+
+from odoo import models, fields, api, _
+from odoo.exceptions import ValidationError
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class Cutting_toolSpecificationWizard(models.TransientModel):
+ _name = "sf.cutting_tool.specification.wizard"
+ _description = u'刀具规格'
+
+ cutting_tool_library_id = fields.Many2one('sf.cutting_tool.standard.library', '刀具标准库')
+ cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', '刀具物料')
+ cutting_tool_type = fields.Char(related=cutting_tool_material_id.name)
+ cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', '刀具类型')
+ brand_id = fields.Many2one('sf.machine.brand', '品牌')
+ integral_tool_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='整体式刀具基本参数')
+ blade_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='刀片基本参数')
+ cutter_bar_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='刀杆基本参数')
+ cutter_head_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='刀盘基本参数')
+ knife_handle_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='刀柄基本参数')
+ chuck_basic_parameters_ids = fields.One2many('sf.tool.materials.basic.parameters',
+ 'specification_id', string='夹头基本参数')
+ cutting_speed_ids = fields.One2many('sf.cutting.speed', 'specification_id', string='切削速度Vc')
+ feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
+ domain=[('cutting_speed', '!=', False)])
+ feed_per_tooth_ids_2 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
+ domain=[('machining_method', '!=', False)])
+ feed_per_tooth_ids_3 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
+ domain=[('cutting_speed', '!=', False)])
+ feed_per_tooth_ids_4 = fields.One2many('sf.feed.per.tooth', 'specification_id', '每齿走刀量fz',
+ domain=[('machining_method', '!=', False)])
+
+ @api.depends('cutting_tool_library_id')
+ def set_specification(self):
+ for vals in self.cutting_tool_library_id.integral_tool_basic_parameters_ids:
+ vals.write({'specification_id': self.id})
diff --git a/sf_dlm/wizard/cutting_tool_specification_wizard.xml b/sf_dlm/wizard/cutting_tool_specification_wizard.xml
new file mode 100644
index 00000000..fee87e2d
--- /dev/null
+++ b/sf_dlm/wizard/cutting_tool_specification_wizard.xml
@@ -0,0 +1,266 @@
+
+
+
+ sf.cutting_tool.specification.wizard.form.view
+ sf.cutting_tool.specification.wizard
+
+
+
+
+
+
+ 刀具规格
+ sf.cutting_tool.specification.wizard
+ form
+
+ new
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sf_manufacturing/__init__.py b/sf_manufacturing/__init__.py
index 0650744f..899bcc97 100644
--- a/sf_manufacturing/__init__.py
+++ b/sf_manufacturing/__init__.py
@@ -1 +1,2 @@
from . import models
+
diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py
index 61b92c81..7ee17fb2 100644
--- a/sf_manufacturing/models/product_template.py
+++ b/sf_manufacturing/models/product_template.py
@@ -63,10 +63,8 @@ class ResProductMo(models.Model):
cutting_tool_material_id = fields.Many2one('sf.cutting.tool.material', string='刀具物料')
cutting_tool_type = fields.Char(string="刀具物料类型", related='cutting_tool_material_id.name', store=True)
- cutting_tool_model_id = fields.Many2one('sf.cutting.tool.model', string='型号',
- )
+ cutting_tool_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='型号')
- cutting_tool_model = fields.Char('型号')
cutting_tool_type_id = fields.Many2one('sf.cutting.tool.type', string='类型',
domain="[('cutting_tool_material_id.name', '=', cutting_tool_type)]")
@@ -178,8 +176,8 @@ class ResProductMo(models.Model):
# if self.integral_run_out_accuracy_min <= 0 and self.cutting_tool_type == '整体式刀具':
# raise ValidationError("端跳精度最小(min)不能为0")
- # cutting_speed_ids = fields.One2many('sf.cutting.speed', 'product_template_id', string='切削速度Vc')
- # feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'product_template_id', string='每齿走刀量fz')
+ cutting_speed_ids = fields.One2many('sf.cutting.speed', 'product_template_id', string='切削速度Vc')
+ feed_per_tooth_ids = fields.One2many('sf.feed.per.tooth', 'product_template_id', string='每齿走刀量fz')
# @api.constrains('suitable_machining_method_ids')
# def _check_suitable_machining_method_ids(self):
@@ -280,6 +278,21 @@ class ResProductMo(models.Model):
# domain="[('cutting_tool_type', '=', '刀柄')]",
# string='适用刀柄型号'
# )
+
+ # @api.onchange('cutting_tool_model_id')
+ # def onchange_method(self):
+ # if self.cutting_tool_model_id:
+ # return {
+ # 'name': 'Import your first bill',
+ # 'view_mode': 'form',
+ # 'target': 'new',
+ # 'view_type': 'form',
+ # 'res_model': 'sf.cutting_tool.standard.library',
+ # 'context': {'default_res_id': self.cutting_tool_model_id.id},
+ # 'views': [[False, 'form']],
+ # 'res_id': self.cutting_tool_model_id.id,
+ # 'type': 'ir.actions.act_window',
+ # }
# 夹具参数
fixture_material_id = fields.Many2one('sf.fixture.material', string="夹具物料")
fixture_model_id = fields.Many2one('sf.fixture.model', string="夹具型号")
@@ -408,41 +421,11 @@ class ResProductMo(models.Model):
self.detailed_type = 'product'
self.sale_ok = False
- @api.onchange('cutting_tool_material_id')
- def _onchange_cutting_tool_material_id(self):
- if self.cutting_tool_material_id:
- try:
- config = self.env['res.config.settings'].get_values()
- headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
- url = config['sf_url'] + '/api/cutting_model/list'
- res = {'token': config['token'], 'cutting_tool_material_code': self.cutting_tool_material_id.code}
- result = requests.post(url, json={}, data=res, headers=headers)
- result = result.json()
- if result['status'] == 1:
- data = result['data']
- model_ids = []
- for item in data:
- model_ids.append((0, 0, {
- 'name': item['name']
- }))
- self.cutting_tool_model = model_ids
- return {}
- except Exception as e:
- logging.info("获取刀具标准库失败")
+ # @api.onchange('cutting_tool_material_id')
+ # def _onchange_cutting_tool_material_id(self):
+ # if self.cutting_tool_material_id:
+
- @api.depends('cutting_tool_material_id')
- def _get_cutting_tool_model(self):
- try:
- config = self.env['res.config.settings'].get_values()
- headers = Common.get_headers(self, config['token'], config['sf_secret_key'])
- url = config['sf_url'] + '/api/cutting_model/list'
- res = {'token': config['token'], 'cutting_tool_material_code': self.cutting_tool_material_id.code}
- result = requests.post(url, json=res, data=None, headers=headers)
- cutting_model_data = result.json()
- if result['state'] == 1:
- return {'cutting_model_data': cutting_model_data}
- except Exception as e:
- logging.info("获取刀具标准库失败")
@api.onchange('fixture_material_id')
def _onchange_fixture_material_id(self):
diff --git a/sf_manufacturing/security/ir.model.access.csv b/sf_manufacturing/security/ir.model.access.csv
index dd7077d7..b20d0985 100644
--- a/sf_manufacturing/security/ir.model.access.csv
+++ b/sf_manufacturing/security/ir.model.access.csv
@@ -8,3 +8,4 @@ access_sf_production_line,sf.production.line,model_sf_production_line,base.group
access_maintenance_equipment_tool,maintenance_equipment_tool,model_maintenance_equipment_tool,base.group_user,1,1,1,1
+
diff --git a/sf_mrs_connect/models/sync_common.py b/sf_mrs_connect/models/sync_common.py
index 6a9b0964..f8febd9f 100644
--- a/sf_mrs_connect/models/sync_common.py
+++ b/sf_mrs_connect/models/sync_common.py
@@ -32,7 +32,7 @@ class MrStaticResourceDataSync(models.Model):
# logging.info("材料型号已每日同步成功")
# self.env['mrs.international.standards']._cron_mrs_international_standards_func()
# logging.info("材料型号材料应用已每日同步成功")
- # self.env['material.apply']._cron_material_apply_func()
+ self.env['material.apply']._cron_material_apply_func()
logging.info("材料型号材料应用已每日同步成功")
self.env['sf.production.process.category'].sync_production_process_category_yesterday()
logging.info("表面工艺类别已每日同步成功")
diff --git a/sf_tool_management/views/tool_material_search.xml b/sf_tool_management/views/tool_material_search.xml
index d461efce..383fb0e5 100644
--- a/sf_tool_management/views/tool_material_search.xml
+++ b/sf_tool_management/views/tool_material_search.xml
@@ -175,7 +175,7 @@
-
+