From c3a7a6c4d6b2e5c80665ce673fb11703fa0a7b2d Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Tue, 25 Oct 2022 17:30:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=A2=9E=E5=8A=A0=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E7=BC=96=E7=A0=81,=E6=98=AF=E5=90=A6=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E6=8E=92=E5=BA=8F=EF=BC=9B=E7=94=A8xml?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90CNC=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=E7=9A=84=E6=A0=87=E5=87=86=E5=B7=A5=E5=BA=8F=EF=BC=9B=20?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E5=A2=9E=E5=8A=A0=E6=A8=A1=E5=9E=8B=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AF=B9=E8=B1=A1=E5=92=8C=E5=8A=A0=E5=B7=A5=E7=9A=84?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=8C=85=E6=8B=AC=E8=83=9A=E6=96=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/views/mrs_common_view.xml | 1 - sf_bpm_api/__manifest__.py | 5 +- sf_bpm_api/data/process_data.xml | 79 ++++++++++++++++++++ sf_bpm_api/models/__init__.py | 1 + sf_bpm_api/models/process.py | 11 +++ sf_bpm_api/models/product_template.py | 15 ++++ sf_bpm_api/security/ir.model.access.csv | 5 +- sf_bpm_api/views/product_template_view.xml | 86 +++++++++++++--------- 8 files changed, 162 insertions(+), 41 deletions(-) create mode 100644 sf_bpm_api/data/process_data.xml create mode 100644 sf_bpm_api/models/process.py 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 @@ - - - + + + - - + + - + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +