Bugfix
authorFabien Pinckaers <fp@tinyerp.com>
Tue, 17 Jun 2008 12:56:35 +0000 (12:56 +0000)
committerFabien Pinckaers <fp@tinyerp.com>
Tue, 17 Jun 2008 12:56:35 +0000 (12:56 +0000)
bzr revid: fp@tinyerp.com-f0bf449f5418afbca3eb754969cc859643a0f58a

bin/osv/osv.py
bin/tools/amount_to_text.py

index d75dafc..4a76577 100644 (file)
@@ -135,12 +135,14 @@ class osv_pool(netsvc.Service):
        def exec_workflow(self, db, uid, obj, method, *args):
                cr = pooler.get_db(db).cursor()
                try:
-                       try:
-                               res = self.exec_workflow_cr(cr, uid, obj, method, *args)
-                               cr.commit()
-                       except Exception:
-                               cr.rollback()
-                               raise
+                       res = self.exec_workflow_cr(cr, uid, obj, method, *args)
+                       cr.commit()
+               except orm.except_orm, inst:
+                       cr.rollback()
+                       self.abortResponse(1, inst.name, 'warning', inst.value)
+               except except_osv, inst:
+                       cr.rollback()
+                       self.abortResponse(1, inst.name, inst[0], inst.value)
                finally:
                        cr.close()
                return res
index f509d79..e7ef353 100644 (file)
@@ -205,9 +205,9 @@ if __name__=='__main__':
        lang = 'nl'
        if len(argv) < 2:
                for i in range(1,200):
-                       print i, ">>", int_to_text(i, lang)
+                       print i, ">>", amount_to_text(i, lang)
                for i in range(200,999999,139):
-                       print i, ">>", int_to_text(i, lang)
+                       print i, ">>", amount_to_text(i, lang)
        else:
-               print int_to_text(int(argv[1]), lang)
+               print amount_to_text(int(argv[1]), lang)