diff --git a/sf_bf_connect/models/process_status.py b/sf_bf_connect/models/process_status.py index 69eb84f1..497544dd 100644 --- a/sf_bf_connect/models/process_status.py +++ b/sf_bf_connect/models/process_status.py @@ -72,7 +72,7 @@ class StatusChange(models.Model): logging.info('函数已经执行=============') # 使用super()来调用原始方法(在本例中为'sale.order'模型的'action_cancel'方法) - res = super(StatusChange, self).action_cancel() + res = super(StatusChange, self.with_context(disable_cancel_warning=True)).action_cancel() # 原有方法执行后,进行额外的操作(如调用外部API) logging.info('函数已经执行=============2') diff --git a/sf_manufacturing/views/sale_order_views.xml b/sf_manufacturing/views/sale_order_views.xml index bfaca560..dbf7093f 100644 --- a/sf_manufacturing/views/sale_order_views.xml +++ b/sf_manufacturing/views/sale_order_views.xml @@ -40,6 +40,12 @@ type="object" attrs="{'invisible': [('state', 'not in', ['sale', 'processing'])]}" /> +