[MODULE] +raise explicit exception master
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Thu, 30 Jan 2020 14:32:31 +0000 (15:32 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Thu, 30 Jan 2020 14:32:31 +0000 (15:32 +0100)
.gitignore [new file with mode: 0644]
__init__.py [new file with mode: 0644]
__openerp__.py [new file with mode: 0644]
account_voucher.py [new file with mode: 0644]
i18n/account_voucher_improvement.pot [new file with mode: 0644]
i18n/fr.po [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..0d20b64
--- /dev/null
@@ -0,0 +1 @@
+*.pyc
diff --git a/__init__.py b/__init__.py
new file mode 100644 (file)
index 0000000..f40c8a7
--- /dev/null
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Account voucher module improvement for OpenERP, Improve some account
+#    module problems Copyright (C) 2020 L'Heureux Cyclage
+#    (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+#    This file is a part of Account module improvement
+#
+#    Account module improvement is free software: you can redistribute it
+#    and/or modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    Account module improvement is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License along
+#    with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_voucher
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/__openerp__.py b/__openerp__.py
new file mode 100644 (file)
index 0000000..03228b6
--- /dev/null
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Account voucher module improvement for OpenERP, Improve some account
+#    module problems Copyright (C) 2020 L'Heureux Cyclage
+#    (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+#    This file is a part of Account module improvement
+#
+#    Account module improvement is free software: you can redistribute it
+#    and/or modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    Account module improvement is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License along
+#    with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+    'name': 'Account voucher module improvement',
+    'author': 'L\'Heureux Cyclage',
+    'version': '0.1',
+    'category': 'Accounting & Finance',
+    'description': """
+Account voucher module improvement
+==================================
+
+This module adds some improvements to account voucher functionnalities :
+    * Help for debug;
+    * …
+    """,
+    'website': 'http://www.heureux-cyclage.org',
+    'images': [],
+    'depends': [
+        'account_voucher',
+    ],
+    'init_xml': [
+    ],
+    'update_xml': [
+    ],
+    'installable': True,
+    'auto_install': False,
+}
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/account_voucher.py b/account_voucher.py
new file mode 100644 (file)
index 0000000..823aae0
--- /dev/null
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Account voucher module improvement for OpenERP, Improve some account
+#    module problems Copyright (C) 2020 L'Heureux Cyclage
+#    (<http://www.heureux-cyclage.org>) Ludovic CHEVALIER
+#
+#    This file is a part of Account module improvement
+#
+#    Account module improvement is free software: you can redistribute it
+#    and/or modify it under the terms of the GNU General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    Account module improvement is distributed in the hope that it will be
+#    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+#    Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License along
+#    with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.osv import osv
+from openerp.osv import orm
+from openerp.osv import fields
+from openerp.tools.translate import _
+
+
+class account_voucher(orm.Model):
+    _inherit = 'account.voucher'
+
+    def _get_exchange_lines(self, cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None):
+        try:
+            super(account_voucher, self)._get_exchange_lines(cr, uid, line, move_id, amount_residual, company_currency, current_currency, context=None)
+        except:
+            raise osv.except_osv(_('Error!'),_('An error occured due to a voucher.\nYou should try to modify it to solve this issue.\n-ID:%d\n- Name: %s\n- Type: %s') % (line.voucher_id.id, line.voucher_id.name, line.voucher_id.type))
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/i18n/account_voucher_improvement.pot b/i18n/account_voucher_improvement.pot
new file mode 100644 (file)
index 0000000..8376e6d
--- /dev/null
@@ -0,0 +1,38 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#      * account_voucher_improvement
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-01-30 13:52+0000\n"
+"PO-Revision-Date: 2020-01-30 13:52+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: account_voucher_improvement
+#: code:addons/account_voucher_improvement/account_voucher.py:37
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: account_voucher_improvement
+#: model:ir.model,name:account_voucher_improvement.model_account_voucher
+msgid "Accounting Voucher"
+msgstr ""
+
+#. module: account_voucher_improvement
+#: code:addons/account_voucher_improvement/account_voucher.py:37
+#, python-format
+msgid "An error occured due to a voucher.\n"
+" You should try to modify it to solve this issue.\n"
+"  - ID:%d\n"
+" - Name: %s\n"
+" - Type: %s"
+msgstr ""
+
diff --git a/i18n/fr.po b/i18n/fr.po
new file mode 100644 (file)
index 0000000..5a270c1
--- /dev/null
@@ -0,0 +1,45 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+#      * account_voucher_improvement
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-01-30 13:52+0000\n"
+"PO-Revision-Date: 2020-01-30 15:19+0100\n"
+"Last-Translator: Ludovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>\n"
+"Language-Team: \n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Poedit 2.2.4\n"
+
+#. module: account_voucher_improvement
+#: code:addons/account_voucher_improvement/account_voucher.py:37
+#, python-format
+msgid "Error!"
+msgstr "Erreur!"
+
+#. module: account_voucher_improvement
+#: model:ir.model,name:account_voucher_improvement.model_account_voucher
+msgid "Accounting Voucher"
+msgstr "Gestion des paiements"
+
+#. module: account_voucher_improvement
+#: code:addons/account_voucher_improvement/account_voucher.py:37
+#, python-format
+msgid ""
+"An error occured due to a voucher.\n"
+" You should try to modify it to solve this issue.\n"
+"  - ID:%d\n"
+" - Name: %s\n"
+" - Type: %s"
+msgstr ""
+"Erreur liée à un paiement\n"
+"Vous devriez essayer de modifier ce paiement pour résoudre ce problème\n"
+"- ID:%d\n"
+"- Nom: %s\n"
+"- Type: %s"