From 8a982ceb2f66513167e815abbab9eae140c62ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 7 Mar 2026 14:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E7=94=9F=E6=88=90=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_purchase/models/inherit_purchase_order.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py index ec8014882..d0d67ea05 100644 --- a/yuthon_purchase/models/inherit_purchase_order.py +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -196,10 +196,8 @@ class InheritPurchaseOrderLine(models.Model): # 去掉状态限制,所有状态都可以确认 order.order_line._validate_analytic_distribution() order._add_supplier_to_product() - if order._approval_allowed(): - order.button_approve() - else: - order.write({'state': 'to approve'}) + # 强制调用 button_approve 生成入库单 + order.button_approve() if order.partner_id not in order.message_partner_ids: order.message_subscribe([order.partner_id.id]) return True