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