新增名称校验

This commit is contained in:
jinling.yang
2024-05-30 11:01:29 +08:00
parent 17678c53c9
commit d883a7ff22
4 changed files with 6 additions and 6 deletions

View File

@@ -1342,7 +1342,7 @@ class WorkPieceDelivery(models.Model):
if self.type == '运送空料架':
wd = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
if wd:
raise ValidationError("该名称已存在")
raise UserError("该名称已存在")
def action_delivery_history(self):
return {

View File

@@ -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):

View File

@@ -667,7 +667,7 @@
<field name="name">空料架配送</field>
<field name="model">sf.workpiece.delivery</field>
<field name="arch" type="xml">
<tree string="工件配送" editable="bottom" class="center" delete="0">
<tree string="工件配送" editable="bottom" class="center" delete="0" create="1">
<header>
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
</header>

View File

@@ -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