Skip to content

Commit 2621206

Browse files
committed
[IMP] sale_exception: Use hook to popup exception after rollback
With OCA/server-tools#3590 changing the way exceptions are detected, the error raising doesn't allow to call _popup_exception as we used to, but we can use the new hook to have the popup displayed as it used to.
1 parent b88811a commit 2621206

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sale_exception/models/sale_order.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ def sale_check_exception(self):
4747
if orders:
4848
orders._check_exception()
4949

50+
def _must_popup_exception(self):
51+
return self.env.company.sale_exception_show_popup
52+
5053
def action_confirm(self):
5154
if self.detect_exceptions():
52-
if not self.env.company.sale_exception_show_popup:
53-
return
54-
return self._popup_exceptions()
55+
return
5556
return super().action_confirm()
5657

5758
def action_draft(self):

0 commit comments

Comments
 (0)