From 5ea6158e8dea29f77b89dce276747134b876b449 Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Tue, 29 Aug 2023 17:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=A8=A1=E5=9D=97=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=AD=A6=E5=91=8A=E4=BF=A1=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/models/model.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index ea707463..eafdffac 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -10,7 +10,7 @@ class SfLocation(models.Model): # 重写字段定义 name = fields.Char('Location Name', required=True, size=20) - barcode = fields.Char('Barcode', copy=False, required=True, size=15) + barcode = fields.Char('Barcode', copy=False, size=15) # 仓库类别(selection:库区、库位、货位) location_type = fields.Selection([ @@ -34,14 +34,14 @@ class SfLocation(models.Model): # 产品类别 (关联:product.category) product_type = fields.Many2many('product.category', string='产品类别') # 货架独有字段:通道、方向、货架高度(m)、货架层数、层数容量 - channel = fields.Char(string='通道', required=True) + channel = fields.Char(string='通道') direction = fields.Selection([ ('R', 'R'), ('L', 'L') - ], string='方向', required=True) + ], string='方向') shelf_height = fields.Float(string='货架高度(m)') - shelf_layer = fields.Integer(string='货架层数', required=True) - layer_capacity = fields.Integer(string='层数容量', required=True) + shelf_layer = fields.Integer(string='货架层数') + layer_capacity = fields.Integer(string='层数容量') # 货位独有字段:货位状态、产品(关联产品对象)、产品序列号(关联产品序列号对象) location_status = fields.Selection([ @@ -54,9 +54,9 @@ class SfLocation(models.Model): product_sn_id = fields.Many2one('stock.lot', string='产品序列号') # time_test = fields.Char(string='time') # 添加SQL约束 - _sql_constraints = [ - ('name_uniq', 'unique(name)', '位置名称必须唯一!'), - ] + # _sql_constraints = [ + # ('name_uniq', 'unique(name)', '位置名称必须唯一!'), + # ] hide_location_type = fields.Boolean(compute='_compute_hide_what', string='隐藏仓库') hide_area = fields.Boolean(compute='_compute_hide_what', string='隐藏库区')