From a6ac46617d740cc06f16c6a1d7db0eec696d72f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Mon, 24 Mar 2025 09:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=89=A9=E6=B5=81=E5=8D=95?= =?UTF-8?q?=E5=B1=8F=E8=94=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_bf_connect/models/jd_eclp.py | 21 ++++++++++----------- sf_bf_connect/views/view.xml | 5 ++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py index 43b8424c..aa27736c 100644 --- a/sf_bf_connect/models/jd_eclp.py +++ b/sf_bf_connect/models/jd_eclp.py @@ -50,17 +50,16 @@ class JdEclp(models.Model): logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式', readonly=True) - # 暂时屏蔽非自提必须走物流单的逻辑 - # def button_validate(self): - # """ - # 重写出库方法,获取物流面单 - # """ - # res = super(JdEclp, self).button_validate() - # if self.check_out == 'OUT': - # if self.logistics_way != '自提' and self.logistics_way: - # if self.logistics_status != '2': - # raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!') - # return res + def button_validate(self): + """ + 重写出库方法,获取物流面单 + """ + res = super(JdEclp, self).button_validate() + if self.check_out == 'OUT': + if self.logistics_way != '自提' and self.logistics_way: + if self.logistics_status != '2': + raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!') + return res @api.depends('name') diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml index c40c36ca..f4245343 100644 --- a/sf_bf_connect/views/view.xml +++ b/sf_bf_connect/views/view.xml @@ -32,11 +32,10 @@ - - + attrs="{'invisible': ['|', '|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('logistics_status', '=', '2'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>