新增名称校验
This commit is contained in:
@@ -1342,7 +1342,7 @@ class WorkPieceDelivery(models.Model):
|
|||||||
if self.type == '运送空料架':
|
if self.type == '运送空料架':
|
||||||
wd = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
|
wd = self.sudo().search([('name', '=', self.name), ('id', '!=', self.id)])
|
||||||
if wd:
|
if wd:
|
||||||
raise ValidationError("该名称已存在")
|
raise UserError("该名称已存在")
|
||||||
|
|
||||||
def action_delivery_history(self):
|
def action_delivery_history(self):
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import os
|
|||||||
from odoo import models, fields, api, _
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import ValidationError
|
from odoo.exceptions import ValidationError
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
|
|
||||||
|
|
||||||
class ResProductMo(models.Model):
|
class ResProductMo(models.Model):
|
||||||
|
|||||||
@@ -667,7 +667,7 @@
|
|||||||
<field name="name">空料架配送</field>
|
<field name="name">空料架配送</field>
|
||||||
<field name="model">sf.workpiece.delivery</field>
|
<field name="model">sf.workpiece.delivery</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="工件配送" editable="bottom" class="center" delete="0">
|
<tree string="工件配送" editable="bottom" class="center" delete="0" create="1">
|
||||||
<header>
|
<header>
|
||||||
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
<button name="button_delivery" type="object" string="配送" class="oe_highlight"/>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import os
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from stl import mesh
|
from stl import mesh
|
||||||
# from OCC.Core.GProp import GProp_GProps
|
# from OCC.Core.GProp import GProp_GProps
|
||||||
# from OCC.Extend.DataExchange import read_step_file
|
from OCC.Extend.DataExchange import read_step_file
|
||||||
# from OCC.Extend.DataExchange import write_stl_file
|
from OCC.Extend.DataExchange import write_stl_file
|
||||||
from odoo.addons.sf_base.commons.common import Common
|
from odoo.addons.sf_base.commons.common import Common
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.modules import get_resource_path
|
from odoo.modules import get_resource_path
|
||||||
|
|||||||
Reference in New Issue
Block a user