diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py
index a7e9398c..211054a7 100644
--- a/sf_manufacturing/models/mrp_production.py
+++ b/sf_manufacturing/models/mrp_production.py
@@ -363,15 +363,10 @@ class MrpProduction(models.Model):
# if production.state == 'pending_cam':
# if all(wo_state in 'done' for wo_state in production.workorder_ids.mapped('state')):
# production.state = 'done'
- if any(
- (
- wo.test_results == '返工' and wo.state == 'done' and production.programming_state in [
- '已编程']) or (
- wo.state == 'rework' and production.programming_state == '编程中') or (
- wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中',
- '已编程'])
- for wo in
- production.workorder_ids):
+ if any((wo.test_results == '返工' and wo.state == 'done' and production.programming_state in ['已编程'])
+ or (wo.state == 'rework' and production.programming_state == '编程中')
+ or (wo.is_rework is True and wo.state == 'done' and production.programming_state in ['编程中', '已编程'])
+ for wo in production.workorder_ids) and production.state not in ['progress']:
production.state = 'rework'
if any(wo.test_results == '报废' and wo.state == 'done' for wo in production.workorder_ids):
production.state = 'scrap'
diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml
index bce50f1f..76cd4c74 100644
--- a/sf_sale/views/purchase_order_view.xml
+++ b/sf_sale/views/purchase_order_view.xml
@@ -42,7 +42,7 @@