From c8dd778b4450fb16be17e2bcf9eea78d030c0e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 22 Jun 2009 11:20:51 +0200 Subject: [PATCH] Catch exception when saving many2one --- tryton/gui/window/view_form/view/form_gtk/many2one.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/many2one.py b/tryton/gui/window/view_form/view/form_gtk/many2one.py index 36b6952201..adc34f2ba0 100644 --- a/tryton/gui/window/view_form/view/form_gtk/many2one.py +++ b/tryton/gui/window/view_form/view/form_gtk/many2one.py @@ -136,7 +136,12 @@ class Dialog(object): while True: res = self.dia.run() if res == gtk.RESPONSE_OK: - if self.screen.save_current(): + obj_id = None + try: + obj_id = self.screen.save_current() + except Exception, exception: + common.process_exception(exception, self.dia) + if obj_id: return (True, (self.screen.current_model.id, self.screen.current_model.rec_name())) else: