Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
|
||||
from. import sf_base
|
||||
from. import sf_common
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = '产品'
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<record model="ir.module.category" id="module_category_employee">
|
||||
<field name="name">员工</field>
|
||||
<field name="sequence">1</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.module.category" id="module_category_manage">
|
||||
<field name="name">管理</field>
|
||||
<field name="sequence">2</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- <!– 系统管理相关 –>-->
|
||||
<!-- <record id="group_master_data_manager" model="res.groups">-->
|
||||
<!-- <field name="name">基础设置</field>-->
|
||||
<!-- <field name="category_id" ref="base.module_category_employee"/>-->
|
||||
<!-- <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,17 +1,17 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_mrs_machine_tool,mrs_machine_tool,model_mrs_machine_tool,base.group_user,1,0,0,0
|
||||
access_mrs_cutting_tool_category,mrs_cutting_tool_category,model_mrs_cutting_tool_category,base.group_user,1,0,0,0
|
||||
access_mrs_machine_tool_type,mrs_machine_tool_type,model_mrs_machine_tool_type,base.group_user,1,0,0,0
|
||||
access_mrs_cutting_tool_type,mrs_cutting_tool_type,model_mrs_cutting_tool_type,base.group_user,1,0,0,0
|
||||
access_mrs_machine_brand,mrs_machine_brand,model_mrs_machine_brand,base.group_user,1,0,0,0
|
||||
access_mrs_machine_brand_tags,mrs_machine_brand_tags,model_mrs_machine_brand_tags,base.group_user,1,0,0,0
|
||||
access_mrs_machine_tool_type_control_system,mrs_machine_tool_type_control_system,model_mrs_machine_tool_type_control_system,base.group_user,1,0,0,0
|
||||
access_mrs_machine_tool,mrs_machine_tool,model_mrs_machine_tool,base.group_user,1,1,1,1
|
||||
access_mrs_cutting_tool_category,mrs_cutting_tool_category,model_mrs_cutting_tool_category,base.group_user,1,1,1,1
|
||||
access_mrs_machine_tool_type,mrs_machine_tool_type,model_mrs_machine_tool_type,base.group_user,1,1,1,1
|
||||
access_mrs_cutting_tool_type,mrs_cutting_tool_type,model_mrs_cutting_tool_type,base.group_user,1,1,1,1
|
||||
access_mrs_machine_brand,mrs_machine_brand,model_mrs_machine_brand,base.group_user,1,1,1,1
|
||||
access_mrs_machine_brand_tags,mrs_machine_brand_tags,model_mrs_machine_brand_tags,base.group_user,1,1,1,1
|
||||
access_mrs_machine_tool_type_control_system,mrs_machine_tool_type_control_system,model_mrs_machine_tool_type_control_system,base.group_user,1,1,1,1
|
||||
|
||||
access_mrs_processing_order,mrs_processing_order,model_mrs_processing_order,base.group_user,1,0,0,0
|
||||
access_mrs_production_process,mrs_production_process,model_mrs_production_process,base.group_user,1,0,0,0
|
||||
access_mrs_production_materials,mrs_production_materials,model_mrs_production_materials,base.group_user,1,0,0,0
|
||||
access_mrs_materials_model,mrs_materials_model,model_mrs_materials_model,base.group_user,1,0,0,0
|
||||
access_mrs_processing_technology,mrs_processing_technology,model_mrs_processing_technology,base.group_user,1,0,0,0
|
||||
access_mrs_processing_order,mrs_processing_order,model_mrs_processing_order,base.group_user,1,1,1,1
|
||||
access_mrs_production_process,mrs_production_process,model_mrs_production_process,base.group_user,1,1,1,1
|
||||
access_mrs_production_materials,mrs_production_materials,model_mrs_production_materials,base.group_user,1,1,1,1
|
||||
access_mrs_materials_model,mrs_materials_model,model_mrs_materials_model,base.group_user,1,1,1,1
|
||||
access_mrs_processing_technology,mrs_processing_technology,model_mrs_processing_technology,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -2,20 +2,43 @@
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- <menuitem action="mrp_production_action"-->
|
||||
<!-- id="menu_mrp_production_action"-->
|
||||
<!-- parent="menu_mrp_manufacturing"-->
|
||||
<!-- sequence="1"/>-->
|
||||
<!-- name="Manufacturing-->
|
||||
<!-- menu_mrp_configuration-->
|
||||
<!--parent="menu_mrp_configuration"-->
|
||||
<!-- <menuitem id="menu_mrp_config"
|
||||
name="Settings"
|
||||
parent="menu_mrp_configuration"
|
||||
sequence="0"
|
||||
action="action_mrp_configuration"
|
||||
groups="base.group_system"/>-->
|
||||
<menuitem
|
||||
id="menu_mrs_machine_tool"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
name="机床注册"
|
||||
sequence="0"
|
||||
action="action_mrs_machine_tool"
|
||||
/>
|
||||
|
||||
<menuitem sequence="0"
|
||||
name="基础数据"
|
||||
id="menu_mrs_base"
|
||||
/>
|
||||
<menuitem
|
||||
sequence="0"
|
||||
name="基础数据"
|
||||
id="menu_mrs_base"
|
||||
action="mrs_production_materials"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_mrs_production_materials_1"
|
||||
name="原材料"
|
||||
parent="menu_mrs_base"
|
||||
sequence="1"
|
||||
action="mrs_production_materials"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="0"
|
||||
|
||||
/>
|
||||
|
||||
<menuitem
|
||||
<menuitem
|
||||
id="menu_sf_product_template"
|
||||
name="产品"
|
||||
parent="menu_mrs_base"
|
||||
@@ -26,10 +49,8 @@
|
||||
<menuitem
|
||||
id="menu_mrs_production_process_1"
|
||||
name="工艺"
|
||||
parent="menu_mrs_base"
|
||||
sequence="1"
|
||||
action="mrs_production_process"
|
||||
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
sequence="0"
|
||||
|
||||
/>
|
||||
|
||||
@@ -38,10 +59,8 @@
|
||||
id="menu_mrs_production_process"
|
||||
name="表面工艺"
|
||||
parent="menu_mrs_production_process_1"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="mrs_production_process"
|
||||
|
||||
|
||||
/>
|
||||
|
||||
|
||||
@@ -49,7 +68,7 @@
|
||||
id="menu_mrs_production_materials"
|
||||
name="材料"
|
||||
parent="menu_mrs_production_materials_1"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="mrs_production_materials"
|
||||
|
||||
|
||||
@@ -58,7 +77,7 @@
|
||||
id="menu_mrs_materials_model"
|
||||
name="材料型号"
|
||||
parent="menu_mrs_production_materials_1"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="mrs_materials_model"
|
||||
|
||||
|
||||
@@ -69,13 +88,10 @@
|
||||
id="menu_mrs_processing_technology"
|
||||
name="加工工艺"
|
||||
parent="menu_mrs_production_process_1"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="mrs_processing_technology"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_machine_brand"
|
||||
parent="menu_mrs_base"
|
||||
@@ -92,27 +108,24 @@
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool"
|
||||
parent="menu_mrs_base"
|
||||
parent="mrp.menu_mrp_configuration"
|
||||
name="刀具"
|
||||
sequence="1"/>
|
||||
sequence="0"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool_category"
|
||||
parent="menu_mrs_cutting_tool"
|
||||
name="刀具类别"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="action_mrs_cutting_tool_category"/>
|
||||
|
||||
<menuitem
|
||||
id="menu_mrs_cutting_tool_type"
|
||||
parent="menu_mrs_cutting_tool"
|
||||
name="刀具型号"
|
||||
sequence="2"
|
||||
sequence="1"
|
||||
action="action_mrs_cutting_tool_type"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -312,4 +312,97 @@
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
#------------------机床注册------------------
|
||||
|
||||
<record model="ir.ui.view" id="search_mrs_machine_tool_view">
|
||||
<field name="name">search.mrs.machine_tool</field>
|
||||
<field name="model">mrs.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="机床">
|
||||
<field name="name" string="模糊搜索"
|
||||
filter_domain="['|',('name', 'ilike', self),('remark', 'ilike', self)]"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="tree_mrs_machine_tool_view">
|
||||
<field name="name">tree.mrs.machine_tool</field>
|
||||
<field name="model">mrs.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="机床">
|
||||
<field name="code"/>
|
||||
<field name="name"/>
|
||||
<field name="brand_id"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="form_mrs_machine_tool">
|
||||
<field name="name">form.mrs.machine_tool</field>
|
||||
<field name="model">mrs.machine_tool</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="机床">
|
||||
<group string="基本信息">
|
||||
<group>
|
||||
<field name="code" force_save="1" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="brand_id" required="1"
|
||||
domain="[('tag_ids', '=', '机床')]"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="参数">
|
||||
<group>
|
||||
<field name="knife_type" required="1"/>
|
||||
<field name="number_of_knife_library" required="1" options="{'format': false}"/>
|
||||
<field name="number_of_axles" required="1" widget="radio" options="{'horizontal': true}"/>
|
||||
<label for="x_axis" string="加工行程(mm)"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}"/>
|
||||
<div class="o_address_format"
|
||||
attrs="{'invisible': [('number_of_axles', '=', False)]}">
|
||||
<label for="x_axis" string="x"/>
|
||||
<field name="x_axis" class="o_address_city" required="1"/>
|
||||
<label for="y_axis" string="y"/>
|
||||
<field name="y_axis" class="o_address_zip" required="1"/>
|
||||
<label for="z_axis" string="z"/>
|
||||
<field name="z_axis" class="o_address_zip" required="1"/>
|
||||
<label for="b_axis" string="b"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '3轴')]}"/>
|
||||
<field name="b_axis" class="o_address_city" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', '=', '3轴')]}"/>
|
||||
<label for="c_axis" string="c"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['3轴','4轴'])]}"/>
|
||||
<field name="c_axis" class="o_address_zip" required="1"
|
||||
attrs="{'invisible': [('number_of_axles', 'in', ['3轴','4轴'])]}"/>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="rotate_speed" string="转速(min)" required="1" options="{'format': false}"/>
|
||||
<field name="precision" required="1" string="加工精度(mm)" />
|
||||
<field name="control_system_id" required="1" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="其它">
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_mrs_machine_tool" model="ir.actions.act_window">
|
||||
<field name="name">机床注册</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">mrs.machine_tool</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
[机床注册]
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -109,7 +109,7 @@
|
||||
<form string="材料型号">
|
||||
<group>
|
||||
<group>
|
||||
<field name="material_no" readonly="1"/>
|
||||
<field name="materials_no" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -136,7 +136,7 @@
|
||||
<field name="model">mrs.materials.model</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="材料型号">
|
||||
<field name="material_no"/>
|
||||
<field name="materials_no"/>
|
||||
<field name="name"/>
|
||||
<field name="need_h"/>
|
||||
<field name="density"/>
|
||||
@@ -150,7 +150,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="name" string="型号名搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="material_no" string="编码搜索" filter_domain="[('material_no','ilike',self)]"/>
|
||||
<field name="materials_no" string="编码搜索" filter_domain="[('materials_no','ilike',self)]"/>
|
||||
<searchpanel class="account_root">
|
||||
<field name="materials_id" icon="fa-filter"/>
|
||||
</searchpanel>
|
||||
@@ -173,7 +173,7 @@
|
||||
</group>
|
||||
<field name="materials_model_ids" widget="ony2many">
|
||||
<tree string="材料型号">
|
||||
<field name="material_no"/>
|
||||
<field name="materials_no"/>
|
||||
<field name="name"/>
|
||||
<field name="need_h"/>
|
||||
<field name="mf_materia_post"/>
|
||||
|
||||
Reference in New Issue
Block a user