From 5269d09d0e2af0d7805900616a7054c1305297ce Mon Sep 17 00:00:00 2001
From: mgw <1392924357@qq.com>
Date: Mon, 23 Sep 2024 12:08:02 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=B7=A5=E5=8D=95=E6=98=8E?=
=?UTF-8?q?=E7=BB=86=E5=A4=84=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=EF=BC=9B?=
=?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=E5=B7=A5=E5=8D=95=E5=8F=9624?=
=?UTF-8?q?=E5=B0=8F=E6=97=B6=E5=86=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sf_machine_connect/controllers/controllers.py | 8 +++++++-
sf_manufacturing/views/mrp_production_addional_change.xml | 4 ++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/sf_machine_connect/controllers/controllers.py b/sf_machine_connect/controllers/controllers.py
index 937960f3..23452b43 100644
--- a/sf_machine_connect/controllers/controllers.py
+++ b/sf_machine_connect/controllers/controllers.py
@@ -626,10 +626,16 @@ class Sf_Dashboard_Connect(http.Controller):
('production_id.state', 'not in', ['cancel', 'done']), ('active', '=', True)
])
# print(not_done_orders)
+
# 完成订单
+ # 获取当前时间,并计算24小时前的时间
+ current_time = datetime.now()
+ time_24_hours_ago = current_time - timedelta(hours=24)
+
finish_orders = plan_obj.search([
('production_line_id.name', '=', line), ('state', 'in', ['finished']),
- ('production_id.state', 'not in', ['cancel']), ('active', '=', True)
+ ('production_id.state', 'not in', ['cancel']), ('active', '=', True),
+ ('actual_end_time', '>=', time_24_hours_ago)
])
# print(finish_orders)
diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml
index 58dc1513..c6ae49ad 100644
--- a/sf_manufacturing/views/mrp_production_addional_change.xml
+++ b/sf_manufacturing/views/mrp_production_addional_change.xml
@@ -296,6 +296,10 @@
+
+
+
+