Skip to content

Commit 17a59be

Browse files
committed
[FIX] purchase_duplicate_check: functional is updated after confirmation_wizard is updated
1 parent d938a67 commit 17a59be

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

purchase_duplicate_check/models/purchase_order.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ def _is_activity_enabled(self) -> bool:
3636

3737
def _check_pending_order(self):
3838
"""Check for pending orders and trigger confirmation wizard if needed."""
39-
if self._is_activity_enabled() and not self._context.get(
40-
"skip_rfq_confirmation"
41-
):
42-
return (
43-
self.env["confirmation.wizard"]
44-
.with_context(skip_rfq_confirmation=True)
45-
.confirm_pending_order(self)
46-
)
39+
if self._is_activity_enabled():
40+
action = self.env["confirmation.wizard"].confirm_pending_order(self)
41+
if action:
42+
return action
4743

4844
def button_confirm(self):
4945
"""

purchase_duplicate_check/tests/test_purchase_order.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_check_pending_order(self):
5454
result = self.order1._check_pending_order()
5555
self.assertIsNone(result, "Result should be None")
5656
order2 = self._get_and_create_purchase_order()
57-
result = order2.with_context(skip_rfq_confirmation=True)._check_pending_order()
57+
result = order2.with_context(skip_confirm_message=True)._check_pending_order()
5858
self.assertIsNone(result, "Result should be None")
5959
result = order2._check_pending_order()
6060
self.assertIsInstance(result, dict, "Result should be dict")
@@ -68,7 +68,7 @@ def test_button_confirm(self):
6868
order2 = self._get_and_create_purchase_order()
6969
order3 = self._get_and_create_purchase_order()
7070

71-
order3.with_context(skip_rfq_confirmation=True).button_confirm()
71+
order3.with_context(skip_confirm_message=True).button_confirm()
7272

7373
self.assertEqual(order2.state, "draft", "Order should be draft")
7474
line1, line2 = order2.order_line
@@ -93,7 +93,7 @@ def test_button_confirm(self):
9393
"Callback method must be 'nutton_confirm'",
9494
)
9595

96-
result = wizard.with_context(skip_rfq_confirmation=True).action_confirm()
96+
result = wizard.with_context(skip_confirm_message=True).action_confirm()
9797
self.assertTrue(result, "Result should be True")
9898
self.assertEqual(order2.state, "purchase", "Order state must be 'purchase'")
9999
activity = order2.activity_ids

purchase_duplicate_check/wizard/confirmation_wizard.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ def action_confirm(self):
5353
"purchase_duplicate_check.repeating_orders_activity_type_id", False
5454
)
5555
)
56-
if self._context.get("skip_rfq_confirmation") and action_type_id:
56+
if action_type_id:
5757
self._create_po_activity(int(action_type_id))
5858
return super().action_confirm()

0 commit comments

Comments
 (0)