From 7118596e1cd986021e5f425f52886b054ff64636 Mon Sep 17 00:00:00 2001 From: gqh Date: Mon, 7 Nov 2022 16:42:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_base/__manifest__.py | 10 ++- sf_base/views/menu_view.xml | 14 ++-- sf_base/views/mrs_base_view.xml | 66 +++++++++++++++++-- sf_base/views/mrs_common_view.xml | 27 -------- sf_bpm_api/__manifest__.py | 3 +- .../models/sf_production.py | 24 ------- sf_route_workcenter/models/workcenter.py | 12 +++- sf_route_workcenter/views/sf_workorder.xml | 14 +++- 8 files changed, 100 insertions(+), 70 deletions(-) diff --git a/sf_base/__manifest__.py b/sf_base/__manifest__.py index 77165cde..967e1ba1 100644 --- a/sf_base/__manifest__.py +++ b/sf_base/__manifest__.py @@ -10,13 +10,19 @@ """, 'category': 'YZ', 'website': 'https://www.sf.jikimo.com', - 'depends': ['account', 'base', 'mrp'], + 'depends': ['account', 'base', 'mrp','sale'], 'data': [ 'security/group_security.xml', 'security/ir.model.access.csv', + 'data/product_data.xml', 'views/mrs_base_view.xml', 'views/mrs_common_view.xml', - "views/menu_view.xml" + 'views/menu_view.xml', + 'views/sale_order_view.xml', + 'views/product_template_view.xml', + 'views/mrp_routing_workcenter_view.xml', + + ], 'demo': [ diff --git a/sf_base/views/menu_view.xml b/sf_base/views/menu_view.xml index 42c9602c..4babedb1 100644 --- a/sf_base/views/menu_view.xml +++ b/sf_base/views/menu_view.xml @@ -142,13 +142,13 @@ action="action_mrs_machine_control_system"/> - - - - - - - + diff --git a/sf_base/views/mrs_base_view.xml b/sf_base/views/mrs_base_view.xml index 1d6aeaf3..b7f61d4f 100644 --- a/sf_base/views/mrs_base_view.xml +++ b/sf_base/views/mrs_base_view.xml @@ -355,11 +355,11 @@
-
- + - + @@ -406,7 +407,7 @@ - + @@ -489,4 +490,61 @@

+ + #------------------模型类型------------------ + + + search.sf.model.type + sf.model.type + + + + + + + + + tree.sf.model.type + sf.model.type + + + + + + + + + form.sf.model.type + sf.model.type + + + + + + + + + + + + + + + + + + + 模型类型 + ir.actions.act_window + sf.model.type + tree,form + +

+ [模型类型] 还没有哦!点左上角的[创建]按钮,沙发归你了! +

+

+

+
+
\ No newline at end of file diff --git a/sf_base/views/mrs_common_view.xml b/sf_base/views/mrs_common_view.xml index 966bccec..c5ab6744 100644 --- a/sf_base/views/mrs_common_view.xml +++ b/sf_base/views/mrs_common_view.xml @@ -293,24 +293,10 @@ sf.tray.search sf.tray - - - - - - - - - - - - - - @@ -347,18 +333,5 @@ - - 托盘 - ir.actions.act_window - sf.tray - tree,form - -

- 创建托盘吧 -

-
-
- - \ No newline at end of file diff --git a/sf_bpm_api/__manifest__.py b/sf_bpm_api/__manifest__.py index b659bd14..f8e6070f 100644 --- a/sf_bpm_api/__manifest__.py +++ b/sf_bpm_api/__manifest__.py @@ -13,8 +13,7 @@ 'depends': ['sale', 'sf_base'], 'data': [ 'data/product_data.xml', - 'views/product_template_view.xml', - 'views/sale_order_view.xml' + ], 'demo': [ ], diff --git a/sf_manufacturing_orders/models/sf_production.py b/sf_manufacturing_orders/models/sf_production.py index c55cac6e..fcce77c1 100644 --- a/sf_manufacturing_orders/models/sf_production.py +++ b/sf_manufacturing_orders/models/sf_production.py @@ -99,30 +99,6 @@ class StockRule(models.Model): # in order to to batch the read. We also make a sanitary check on the # `location_src_id` field. - # list1 = [] - # for item in procurements: - # num = int(item[0].product_qty) - # if num > 1: - # for no in range(1, num+1): - # - # Procurement = namedtuple('Procurement', ['product_id', 'product_qty', - # 'product_uom', 'location_id', 'name', 'origin', - # 'company_id', - # 'values']) - # s = Procurement(product_id=item[0].product_id,product_qty=1.0,product_uom=item[0].product_uom, - # location_id=item[0].location_id, - # name=item[0].name, - # origin=item[0].origin, - # company_id=item[0].company_id, - # values=item[0].values, - # ) - # item1 = list(item) - # item1[0]=s - # - # list1.append(tuple(item1)) - # else: - # list1.append(item) - for procurement, rule in procurements: if not rule.location_src_id: msg = _('No source location defined on stock rule: %s!') % (rule.name,) diff --git a/sf_route_workcenter/models/workcenter.py b/sf_route_workcenter/models/workcenter.py index 8b0f9451..fc20a4e9 100644 --- a/sf_route_workcenter/models/workcenter.py +++ b/sf_route_workcenter/models/workcenter.py @@ -84,14 +84,15 @@ class MrpWorkOrder(models.Model): _inherit = 'mrp.workorder' _description = '工单' + cnc_id = fields.Many2one('ir.attachment', string='CNC程序') tray_ids = fields.One2many('sf.tray', 'workorder_id', string='托盘') # def get_tray_info(self): # @api.onchange('X_axis', 'Y_axis', 'Z_axis') # def get_center_point(self): # return 'X:%s,Y:%s,Z:%s' % (self.X_axis, self.Y_axis, self.Z_axis) # 加工面 - surface = fields.Selection([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"), - ("上面", "上面")], string="加工面1") + # surface = fields.Selection([("前面", "前面"), ("后面", "后面"), ("左面", "左面"), ("右面", "右面"), + # ("上面", "上面")], string="加工面1") material_center_point = fields.Char(string='配料中心点') X1_axis = fields.Float(string='Lx1', default=0) @@ -203,3 +204,10 @@ class MrpProduction(models.Model): _description = "制造订单" tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘") + +class Attachment(models.Model): + _inherit = 'ir.attachment' + + cnc_model = fields.Binary('cnc文件', attachment=False) + model_name = fields.Char('模型名称') + diff --git a/sf_route_workcenter/views/sf_workorder.xml b/sf_route_workcenter/views/sf_workorder.xml index 6d79a348..f0b38b58 100644 --- a/sf_route_workcenter/views/sf_workorder.xml +++ b/sf_route_workcenter/views/sf_workorder.xml @@ -6,10 +6,20 @@ mrp.workorder + + + + + + + + + + - +