Skip to content

Commit

Permalink
Merge pull request #731 from Som-Energia/fix_wizard_indexada_errors
Browse files Browse the repository at this point in the history
Fix wizards move to indexada to show errors
  • Loading branch information
anxodio authored Oct 1, 2024
2 parents 936da7c + cfe6950 commit 92fb652
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions som_indexada/wizard/wizard_change_to_indexada.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def change_to_indexada(self, cursor, uid, ids, context=None):
self.send_indexada_modcon_created_email(cursor, uid, polissa)
except Exception:
polissa.send_signal("undo_modcontractual")
raise exceptions.UnexpectedException()

wizard.write({"state": "end"})
return polissa.modcontractuals_ids[0].id
Expand Down
13 changes: 13 additions & 0 deletions som_polissa/exceptions/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import traceback
from osv import osv
from tools.translate import _

Expand All @@ -21,6 +22,18 @@ def to_dict(self):
)


class UnexpectedException(SomPolissaException):
def __init__(self):
super(UnexpectedException, self).__init__(
title=_("Unexpected exception"),
text=traceback.format_exc()
)

@property
def code(self):
return "Unexpected"


class PolissaModcontractual(SomPolissaException):
def __init__(self, polissa_number):
super(PolissaModcontractual, self).__init__(
Expand Down

0 comments on commit 92fb652

Please sign in to comment.