From 3226942ed3d0e1b7b2532e35768ec0e32a725c47 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Fri, 19 Jan 2024 15:45:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E4=BA=A7=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=88=AB=E5=92=8C=E8=AE=A1=E9=87=8F=E5=8D=95=E4=BD=8D=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?= =?UTF-8?q?2.=E4=BC=98=E5=8C=96bfm=E6=B4=BE=E5=8D=95=E8=87=B3sf=E7=9A=84?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E6=B5=81=E7=A8=8B3.?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=A2=9E=E5=8A=A0=E7=BC=96=E7=A0=81=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm/data/product_data.xml | 1 + sf_manufacturing/data/stock_data.xml | 7 +++ .../models/mrp_routing_workcenter.py | 9 ++- sf_manufacturing/models/product_template.py | 4 +- .../views/mrp_routing_workcenter_view.xml | 3 + sf_sale/models/auto_quatotion_common.py | 2 +- sf_sale/models/quick_easy_order.py | 4 +- sf_sale/models/sale_order.py | 6 +- sf_sale/security/ir.model.access.csv | 2 +- sf_sale/views/sale_order_view.xml | 2 +- sf_warehouse/models/model.py | 24 ------- sf_warehouse/views/view.xml | 63 ------------------- 12 files changed, 26 insertions(+), 101 deletions(-) diff --git a/sf_dlm/data/product_data.xml b/sf_dlm/data/product_data.xml index f4a256bd..95d19c39 100644 --- a/sf_dlm/data/product_data.xml +++ b/sf_dlm/data/product_data.xml @@ -1,5 +1,6 @@ + 坯料 坯料 diff --git a/sf_manufacturing/data/stock_data.xml b/sf_manufacturing/data/stock_data.xml index 74d02b4a..6bd0fe53 100644 --- a/sf_manufacturing/data/stock_data.xml +++ b/sf_manufacturing/data/stock_data.xml @@ -1,6 +1,13 @@ + + 工序编码规则 + mrp.routing.workcenter + 4 + + + YourCompany Sequence ocout WH/OCOUT/ diff --git a/sf_manufacturing/models/mrp_routing_workcenter.py b/sf_manufacturing/models/mrp_routing_workcenter.py index c8e7d8aa..95c70533 100644 --- a/sf_manufacturing/models/mrp_routing_workcenter.py +++ b/sf_manufacturing/models/mrp_routing_workcenter.py @@ -1,5 +1,6 @@ import logging -from odoo import fields, models +from odoo import fields, models, api +from odoo.exceptions import UserError class ResMrpRoutingWorkcenter(models.Model): @@ -21,13 +22,17 @@ class ResMrpRoutingWorkcenter(models.Model): bom_id = fields.Many2one('mrp.bom', required=False) surface_technics_id = fields.Many2one('sf.production.process', string="表面工艺") + def generate_code(self): + return self.env['ir.sequence'].next_by_code('mrp.routing.workcenter') + + code = fields.Char('编码', default=generate_code) + # 获得当前登陆者公司 def get_company_id(self): self.company_id = self.env.user.company_id.id company_id = fields.Many2one('res.company', compute="get_company_id", related=False) - # 排产的时候, 根据坯料的长宽高比对一下机床的最大加工尺寸.不符合就不要分配给这个加工中心(机床). # 工单对应的工作中心,根据工序中的工作中心去匹配, # 如果只配置了一个工作中心,则默认采用该工作中心; diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 7a341c36..42a392e2 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -6,8 +6,8 @@ import os from odoo import models, fields, api, _ from odoo.exceptions import ValidationError from odoo.modules import get_resource_path -# from OCC.Extend.DataExchange import read_step_file -# from OCC.Extend.DataExchange import write_stl_file +from OCC.Extend.DataExchange import read_step_file +from OCC.Extend.DataExchange import write_stl_file class ResProductMo(models.Model): diff --git a/sf_manufacturing/views/mrp_routing_workcenter_view.xml b/sf_manufacturing/views/mrp_routing_workcenter_view.xml index d0db3a7b..5ab745db 100644 --- a/sf_manufacturing/views/mrp_routing_workcenter_view.xml +++ b/sf_manufacturing/views/mrp_routing_workcenter_view.xml @@ -6,6 +6,9 @@ mrp.routing.workcenter + + +