智能工厂定时同步基础数据完成

This commit is contained in:
gqh
2022-09-28 17:37:22 +08:00
parent 3c3e5216d6
commit d9e6f45bc4
6 changed files with 75 additions and 54 deletions

View File

@@ -18,10 +18,10 @@ class MachineBrandTags(models.Model):
class MachineControlSystem(models.Model):
_name = 'mrs.machine_tool.type.control_system'
_description = '控制系统'
code = fields.Char('编码')
name = fields.Char('名称', size=50)
# type_id = fields.Many2one('mrs.machine_tool.type')
active = fields.Boolean('有效', default=True)
# 品牌标签
class MachineBrand(models.Model):

View File

@@ -38,8 +38,7 @@ class MrsProductionProcess(models.Model):
_description = '表面工艺'
name = fields.Char('表面工艺')
remark = fields.Text("备注")
processing_technology_ids = fields.Many2many('mrs.processing.technology', 'mrs_associated_processes',
index=True)
processing_order_ids = fields.One2many('mrs.processing.order', 'production_process_id', string='工序')
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
process_encode = fields.Char("编码")
active = fields.Boolean('有效', default=True)
@@ -49,14 +48,23 @@ class MrsProcessingTechnology(models.Model):
_name = 'mrs.processing.technology'
_description = '加工工艺'
remark = fields.Text("备注")
sequence = fields.Integer('Sequence', index=True)
name = fields.Char('加工工艺', index=True)
remark = fields.Text('备注', index=True)
process_encode = fields.Char("编码")
production_process_ids = fields.Many2many('mrs.production.process', 'mrs_associated_processes',
index=True)
processing_order_ids = fields.Many2many('mrs.processing.order', 'mrs_associated_processes',
index=True, string='工序')
active = fields.Boolean('有效', default=True)
class MrsProcessingOrder(models.Model):
_name = 'mrs.processing.order'
_description = '工序'
sequence = fields.Integer('Sequence')
processing_technology_ids = fields.Many2many('mrs.processing.technology', 'mrs_associated_processes',
index=True, string='加工工艺')
production_process_id = fields.Many2one('mrs.production.process', string="表面工艺")
class ProductTemplate(models.Model):
_inherit = 'product.template'

View File

@@ -7,7 +7,7 @@ access_mrs_machine_brand,mrs_machine_brand,model_mrs_machine_brand,base.group_us
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,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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_mrs_machine_brand_tags mrs_machine_brand_tags model_mrs_machine_brand_tags base.group_user 1 1 1 1
8 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
9 access_mrs_production_process access_mrs_processing_order mrs_production_process mrs_processing_order model_mrs_production_process model_mrs_processing_order base.group_user 1 1 1 1
10 access_mrs_production_materials access_mrs_production_process mrs_production_materials mrs_production_process model_mrs_production_materials model_mrs_production_process base.group_user 1 1 1 1
11 access_mrs_materials_model access_mrs_production_materials mrs_materials_model mrs_production_materials model_mrs_materials_model model_mrs_production_materials base.group_user 1 1 1 1
12 access_mrs_processing_technology access_mrs_materials_model mrs_processing_technology mrs_materials_model model_mrs_processing_technology model_mrs_materials_model base.group_user 1 1 1 1
13 access_mrs_processing_technology mrs_processing_technology model_mrs_processing_technology base.group_user 1 1 1 1

View File

@@ -70,14 +70,19 @@
</group>
<notebook>
<page string="加工工艺">
<field name='processing_technology_ids' widget="many2many">
<tree editable="bottom" widget="selection">
<page string="工序">
<field name='processing_order_ids' options="{'no_create':True}" widget="one2many">
<tree editable='bottom'>
<field name="sequence" widget="handle"/>
<field name="process_encode" readonly="1"/>
<field name="name"/>
<field name="remark"/>
<field name="processing_technology_ids" widget="many2many_tags" >
</field>
</tree>
<form >
<field name="processing_technology_ids" widget="many2many">
</field>
</form>
</field>
</page>
</notebook>