diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py
index 105cd241..2352c3a6 100644
--- a/sf_base/__manifest__.py
+++ b/sf_base/__manifest__.py
@@ -10,7 +10,7 @@
""",
'category': 'YZ',
'website': 'https://www.sf.jikimo.com',
- 'depends': ['account'],
+ 'depends': ['account', 'base'],
'data': [
'security/group_security.xml',
'security/ir.model.access.csv',
diff --git a/sf_base/models/__init__.py b/sf_base/models/__init__.py
index e53038fc..27b447be 100644
--- a/sf_base/models/__init__.py
+++ b/sf_base/models/__init__.py
@@ -1,3 +1,2 @@
-
from. import sf_base
from. import sf_common
diff --git a/sf_base/models/sf_base.py b/sf_base/models/sf_base.py
index 05334842..abe0255b 100644
--- a/sf_base/models/sf_base.py
+++ b/sf_base/models/sf_base.py
@@ -80,47 +80,7 @@ class MachineTool(models.Model):
active = fields.Boolean('有效', default=True)
- # @api.depends('type_id')
- # def _compute_type_id(self):
- # to_reset = self.filtered(lambda e: e.type_id != e.type_id.id)
- # to_reset.type_id = False
- # 编码规则:加工工厂编码-品牌编码-注册年月-00001
- # def get_machine_tool_code(self):
- # partner = self.env['res.partner'].sudo().search(
- # [('is_factory', '=', True)],
- # limit=1,
- # order="id desc")
- # brand = self.env['mrs.machine.brand'].sudo().search(
- # [('tag_ids', '=', '机床')],
- # limit=1,
- # order="id desc")
- # if not brand:
- # num = item.brand_id.code + "%04d" % 1
- # item.code = num
- # else:
- # print('--------')
- # print(type)
- # m = int(type.code[-4:]) + 1
- # num = item.brand_id.code + "%04d" % m
- # item.code = num
-
- # 选择机床型号时,该型号的基本信息带出并赋给机床对应的信息里
-
- # @api.onchange('type_id')
- # def get_type_info(self):
- # for item in self:
- # item.knife_type = item.type_id.knife_type
- # item.number_of_knife_library = item.type_id.number_of_knife_library
- # item.number_of_axles = item.type_id.number_of_axles
- # item.rotate_speed = item.type_id.rotate_speed
- # item.precision = item.type_id.precision
- # item.control_system_id = item.type_id.control_system_id
- # item.x_axis = item.type_id.x_axis
- # item.y_axis = item.type_id.y_axis
- # item.z_axis = item.type_id.z_axis
- # item.b_axis = item.type_id.b_axis
- # item.c_axis = item.type_id.c_axis
class MachineToolType(models.Model):
@@ -153,48 +113,15 @@ class MachineToolType(models.Model):
active = fields.Boolean('有效', default=True)
code = fields.Char('编码')
- # @api.onchange('brand_id')
- # def get_machine_tool_type_code(self):
- # for item in self:
- # if not item.brand_id:
- # return False
- # type = self.env['mrs.machine_tool.type'].sudo().search(
- # [('brand_id', '=', item.brand_id.id)],
- # limit=1,
- # order="id desc"
- # )
- # print(item.brand_id.id)
- # if not type:
- # num = item.brand_id.code + "%04d" % 1
- # item.code = num
- # print(item.code)
- # else:
- # print('----------')
- # m = int(type.code[-4:]) + 1
- # num = item.brand_id.code + "%04d" % m
- # item.code = num
- # print(item.code)
-
# 刀具
class CuttingTool(models.Model):
_name = 'mrs.cutting_tool.category'
_description = '刀具类别'
- # def get_cutting_tool_category_code(self):
- # code = self.env['mrs.cutting_tool.category'].sudo().search(
- # [('code', '!=', False)], limit=1,
- # order="id desc")
- # if not code:
- # num = "%03d" % 1
- # else:
- # m = int(code.code) + 1
- # num = "%03d" % m
- # return num
-
code = fields.Char('编码')
name = fields.Char('名称')
- # type_ids = fields.One2many('mrs.cutting_tool.type', 'category_id', string='刀具型号')
+
remark = fields.Text('备注')
active = fields.Boolean('有效', default=True)
@@ -216,23 +143,3 @@ class CuttingToolType(models.Model):
brand_id = fields.Many2one('mrs.machine.brand', string='品牌')
remark = fields.Text('备注')
active = fields.Boolean('有效', default=True)
-
- # @api.onchange('brand_id', 'category_id')
- # def get_cutting_tool_type_code(self):
- # for item in self:
- # if not item.brand_id:
- # return False
- # if not item.category_id:
- # return False
- # type = self.env['mrs.cutting_tool.type'].sudo().search(
- # [('brand_id', '=', item.brand_id.id), ('brand_id', '=', item.category_id.id)],
- # limit=1,
- # order="id desc"
- # )
- # if not type:
- # num = item.brand_id.code + item.category_id.code + "%03d" % 1
- # item.code = num
- # else:
- # m = int(type.code[-4:]) + 1
- # num = item.brand_id.code + item.category_id.code + "%03d" % m
- # item.code = num
diff --git a/sf_base/models/sf_common.py b/sf_base/models/sf_common.py
index 17bd0a79..95dd6595 100644
--- a/sf_base/models/sf_common.py
+++ b/sf_base/models/sf_common.py
@@ -23,12 +23,12 @@ class MrsMaterialModel(models.Model):
_description = '材料型号'
remark = fields.Text("备注")
name = fields.Char('型号名')
- need_h = fields.Boolean("需要热处理", default="false")
- mf_materia_post = fields.Char("热处理后硬度")
+ need_h = fields.Boolean("热处理", default="false")
+ mf_materia_post = fields.Char("热处理后密度")
density = fields.Float("密度(kg/m³)")
materials_id = fields.Many2one('mrs.production.materials', "材料名")
materials_num = fields.Char("编码号")
- material_no = fields.Char("编码")
+ materials_no = fields.Char("编码")
active = fields.Boolean('有效', default=True)
@@ -52,9 +52,10 @@ class MrsProcessingTechnology(models.Model):
remark = fields.Text('备注', index=True)
process_encode = fields.Char("编码")
processing_order_ids = fields.Many2many('mrs.processing.order', 'mrs_associated_processes',
- index=True, string='工序')
+ index=True, string='工序')
active = fields.Boolean('有效', default=True)
+
class MrsProcessingOrder(models.Model):
_name = 'mrs.processing.order'
_description = '工序'
@@ -66,6 +67,7 @@ class MrsProcessingOrder(models.Model):
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
+
class ProductTemplate(models.Model):
_inherit = 'product.template'
_description = '产品'
diff --git a/sf_base/security/group_security.xml b/sf_base/security/group_security.xml
index fdbc3ae5..c32538c7 100644
--- a/sf_base/security/group_security.xml
+++ b/sf_base/security/group_security.xml
@@ -1,5 +1,27 @@
+ [机床注册] +
++
+