From 04244dd17abc207e0a27e4863bfe6880dfdb07cd Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 30 Jan 2024 09:12:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=A7=E4=BD=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/models/model.py | 6 +++++- sf_warehouse/views/shelf_location.xml | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 06a56386..978a3b93 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -279,7 +279,7 @@ class ShelfLocation(models.Model): ('空闲', '空闲'), ('占用', '占用'), ('禁用', '禁用') - ], string='货位状态', default='空闲') + ], string='货位状态', default='空闲', readonly=True) # product_id = fields.Many2one('product.template', string='产品') product_id = fields.Many2one('product.product', string='产品', compute='_compute_product_id', readonly=True) product_sn_id = fields.Many2one('stock.lot', string='产品序列号') @@ -287,6 +287,10 @@ class ShelfLocation(models.Model): hide_shelf = fields.Boolean(compute='_compute_hide_what', string='隐藏货架') hide_location = fields.Boolean(compute='_compute_hide_what', string='隐藏货位') + # 修改货位状态为禁用 + def action_location_status_disable(self): + self.location_status = '禁用' + @api.onchange('shelf_location_id') def _onchange_shelf_location_id(self): """ diff --git a/sf_warehouse/views/shelf_location.xml b/sf_warehouse/views/shelf_location.xml index f19a6421..3bf6df80 100644 --- a/sf_warehouse/views/shelf_location.xml +++ b/sf_warehouse/views/shelf_location.xml @@ -55,8 +55,11 @@