From c437c185a40eebd83a5394165971a0c8ba72a2a8 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Wed, 29 May 2024 17:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=96=99=E6=9E=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=8E=BB=E9=87=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 7 +++++++ sf_manufacturing/models/product_template.py | 4 ++-- sf_sale/models/quick_easy_order_old.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index c3342744..09defd8e 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1335,6 +1335,13 @@ class WorkPieceDelivery(models.Model): obj = super(WorkPieceDelivery, self).create(vals) return obj + @api.constrains('name') + def _check_name(self): + if self.type == '运送空料架': + wd = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)]) + if wd: + raise ValidationError("该名称已存在") + def action_delivery_history(self): return { 'name': _('配送历史'), diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 7d9bbac5..49a7e483 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -7,8 +7,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_sale/models/quick_easy_order_old.py b/sf_sale/models/quick_easy_order_old.py index dc4c588f..f26b6f4a 100644 --- a/sf_sale/models/quick_easy_order_old.py +++ b/sf_sale/models/quick_easy_order_old.py @@ -6,8 +6,8 @@ import os from datetime import datetime from stl import mesh # from OCC.Core.GProp import GProp_GProps -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 from odoo.addons.sf_base.commons.common import Common from odoo import models, fields, api from odoo.modules import get_resource_path