diff --git a/sf_base/views/mrs_common_view.xml b/sf_base/views/mrs_common_view.xml index 1877de05..8c3e92d2 100644 --- a/sf_base/views/mrs_common_view.xml +++ b/sf_base/views/mrs_common_view.xml @@ -284,7 +284,6 @@ - diff --git a/sf_bpm_api/__manifest__.py b/sf_bpm_api/__manifest__.py index b659bd14..51ff2a57 100644 --- a/sf_bpm_api/__manifest__.py +++ b/sf_bpm_api/__manifest__.py @@ -10,9 +10,12 @@ """, 'category': 'sf', 'website': 'https://www.sf.cs.jikimo.com', - 'depends': ['sale', 'sf_base'], + 'depends': ['sale', 'sf_base', 'mrp'], 'data': [ + 'security/group_security.xml', + 'security/ir.model.access.csv', 'data/product_data.xml', + 'data/process_data.xml', 'views/product_template_view.xml', 'views/sale_order_view.xml' ], diff --git a/sf_bpm_api/data/process_data.xml b/sf_bpm_api/data/process_data.xml new file mode 100644 index 00000000..1447fc13 --- /dev/null +++ b/sf_bpm_api/data/process_data.xml @@ -0,0 +1,79 @@ + + + + + + Assembly Line 1 + false + + + + + + 1 + false + + + + 获取自动编码程序 + automatic coding + manual + + + 60 + false + + + + 装夹 + clamping + manual + + + 60 + false + + + + 前置三元定位检测 + pre-ternary positioning detection + manual + + + 60 + false + + + + CNC加工 + CNC machining + manual + + + 60 + false + + + + 后置三元质量检测 + post ternary quality inspection + manual + + + 60 + false + + + + 解除装夹 + remove the clamping + manual + + + 60 + false + + + + + \ No newline at end of file diff --git a/sf_bpm_api/models/__init__.py b/sf_bpm_api/models/__init__.py index 4c183668..0dc63d28 100644 --- a/sf_bpm_api/models/__init__.py +++ b/sf_bpm_api/models/__init__.py @@ -2,5 +2,6 @@ from . import sale_order from . import product_template from . import http from . import models +from . import process diff --git a/sf_bpm_api/models/process.py b/sf_bpm_api/models/process.py new file mode 100644 index 00000000..056b824d --- /dev/null +++ b/sf_bpm_api/models/process.py @@ -0,0 +1,11 @@ +from odoo import fields, models, api + + +class ResMrpRoutingWorkcenter(models.Model): + _inherit = 'mrp.routing.workcenter' + + code = fields.Char('唯一编码') + is_repeat = fields.Boolean('重复',default=False) + sort = fields.Integer('排序') + + diff --git a/sf_bpm_api/models/product_template.py b/sf_bpm_api/models/product_template.py index 08f2237c..0c1d4b12 100644 --- a/sf_bpm_api/models/product_template.py +++ b/sf_bpm_api/models/product_template.py @@ -13,6 +13,8 @@ class ResProductTemplate(models.Model): model_precision = fields.Float('精度要求', digits=(16, 3)) model_materials_id = fields.Many2one('mrs.production.materials', string='材料') model_materials_type_id = fields.Many2one('mrs.materials.model', string='型号') + model_type_id = fields.Many2one('sf.model.type', string='类型') + processing_panel = fields.Char('加工面板') # 胚料的长,宽,高 embryo_long = fields.Float('长[mm]', digits=(16, 3)) embryo_width = fields.Float('宽[mm]', digits=(16, 3)) @@ -20,6 +22,7 @@ class ResProductTemplate(models.Model): embryo_materials_id = fields.Many2one('mrs.production.materials', string='材料') embryo_materials_type_id = fields.Many2one('mrs.materials.model', string='型号') + # 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品 def product_create(self, product_id, item, order_id, order_number, i): copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy() @@ -84,3 +87,15 @@ class ResMrpBom(models.Model): 'product_uom_id': 1 } return self.env['mrp.bom.line'].create(vals) + + +class ModelType(models.Model): + _name = 'sf.model.type' + _description = '模型类型' + + name = fields.Char('名称') + code = fields.Char('编码') + + + + diff --git a/sf_bpm_api/security/ir.model.access.csv b/sf_bpm_api/security/ir.model.access.csv index 963679d4..c36d0d05 100644 --- a/sf_bpm_api/security/ir.model.access.csv +++ b/sf_bpm_api/security/ir.model.access.csv @@ -1,5 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink - - - - +access_sf_model_type,sf_model_type,model_sf_model_type,base.group_user,1,1,1,1 diff --git a/sf_bpm_api/views/product_template_view.xml b/sf_bpm_api/views/product_template_view.xml index 406330e3..fea34c5c 100644 --- a/sf_bpm_api/views/product_template_view.xml +++ b/sf_bpm_api/views/product_template_view.xml @@ -7,51 +7,67 @@ - - - + + + - - + + - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +