From 5c129331e054911f26a00d88e42f2ee0bbb16f80 Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Tue, 23 Jan 2024 16:13:53 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=9F=E8=83=BD=EF=BC=9A?=
=?UTF-8?q?=E5=BD=93=E4=B8=BA=E9=9D=9E=E2=80=9C=E8=87=AA=E6=8F=90=E2=80=9D?=
=?UTF-8?q?=E5=8D=95=E6=97=B6=EF=BC=8C=E5=BF=85=E9=A1=BB=E8=BF=9B=E8=A1=8C?=
=?UTF-8?q?=E7=89=A9=E6=B5=81=E4=B8=8B=E5=8D=95=E6=89=8D=E8=83=BD=E8=BF=9B?=
=?UTF-8?q?=E8=A1=8C=E5=87=BA=E5=BA=93=E6=93=8D=E4=BD=9C=E3=80=82=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=AF=B9=E5=AD=97=E6=AE=B5=E7=9A=84=E6=98=BE=E9=9A=90?=
=?UTF-8?q?=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_bf_connect/models/jd_eclp.py | 15 +++++++++++++--
sf_bf_connect/views/view.xml | 9 +++++----
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/sf_bf_connect/models/jd_eclp.py b/sf_bf_connect/models/jd_eclp.py
index 8961e482..49337083 100644
--- a/sf_bf_connect/models/jd_eclp.py
+++ b/sf_bf_connect/models/jd_eclp.py
@@ -46,9 +46,20 @@ class JdEclp(models.Model):
is_bill = fields.Boolean(string='是否下了快递单', default=False)
# 物流状态
logistics_status = fields.Selection([('0', '未下单'), ('1', '已下单'), ('2', '已获取物流面单'), ('3', '已打印物流单')],
- string='物流状态', default='0')
+ string='物流状态', default='0', readonly=True)
- logistics_way = fields.Selection([('自提', '自提'), ('到付', '到付'), ('在线支付', '在线支付')], string='物流方式')
+ 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 != '自提':
+ if self.logistics_status != '3':
+ raise ValidationError('非自提订单,必须先下物流单,并获取物流面单后才可出库!')
+ return res
@api.depends('name')
diff --git a/sf_bf_connect/views/view.xml b/sf_bf_connect/views/view.xml
index 90d36123..ce1cf437 100644
--- a/sf_bf_connect/views/view.xml
+++ b/sf_bf_connect/views/view.xml
@@ -31,10 +31,11 @@
+
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', True), ('logistics_way', '=', '自提')]}"/>
+ attrs="{'invisible': ['|', '|', '|', ('check_out', '!=', 'OUT'), ('state', '!=', 'assigned'), ('is_bill', '=', False), ('logistics_way', '=', '自提')]}"/>
@@ -46,8 +47,8 @@
-
-
+
+