Kaynağa Gözat

commit inicial

Rodney Enciso Arias 8 yıl önce
işleme
cd7ecc6853

+ 38 - 0
README.rst

@@ -0,0 +1,38 @@
+Account invoice with tax required in invoice line
+==================================================
+
+This module adds functional a check on invoice
+to force user to set tax on invoice line.
+
+
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
+`here <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_invoice_tax_required%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
+
+
+Credits
+=======
+
+Contributors
+------------
+
+* Vincent Renaville <vincent.renaville@camptocamp.com>
+
+Maintainer
+----------
+
+.. image:: http://odoo-community.org/logo.png
+   :alt: Odoo Community Association
+   :target: http://odoo-community.org
+
+This module is maintained by the OCA.
+
+OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
+
+To contribute to this module, please visit http://odoo-community.org.
+

+ 20 - 0
__init__.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author Vincent Renaville. Copyright 2015 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import models

BIN
__init__.pyc


+ 31 - 0
__openerp__.py

@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author Vincent Renaville. Copyright 2015 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+    'name': "Tax required in invoice",
+    'version': "8.0.1.0.0",
+    "author": "Camptocamp,Odoo Community Association (OCA)",
+    'website': "http://www.camptocamp.com",
+    'category': "Localisation / Accounting",
+    'license': "AGPL-3",
+    'depends': ["account"],
+    'data': [
+    ],
+    'installable': True,
+}

+ 34 - 0
i18n/account_invoice_tax_require.pot

@@ -0,0 +1,34 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+#	* account_invoice_tax_required
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-06-15 11:36+0000\n"
+"PO-Revision-Date: 2015-06-15 11:36+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_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr ""
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr ""
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:39
+#, python-format
+msgid "No Taxes Defined!"
+msgstr ""
+

+ 36 - 0
i18n/de.po

@@ -0,0 +1,36 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+# Rudolf Schnapka <rs@techno-flex.de>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-11-08 01:04+0000\n"
+"PO-Revision-Date: 2015-11-24 16:22+0000\n"
+"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
+"Language-Team: German (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/de/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: de\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Rechnung"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "Rechnung hat eine Position mit Produkt %s ohne Versteuerung"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "Keine Versteurung festgelegt!"

+ 35 - 0
i18n/en.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-07-01 13:27+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
+"Language-Team: English (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/en/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Invoice"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "Invoice has a line with product %s with no taxes"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "No Taxes Defined!"

+ 36 - 0
i18n/es.po

@@ -0,0 +1,36 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+# Carles Antolí <carlesantoli@hotmail.com>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-12-05 01:25+0000\n"
+"PO-Revision-Date: 2015-12-06 18:24+0000\n"
+"Last-Translator: Carles Antolí <carlesantoli@hotmail.com>\n"
+"Language-Team: Spanish (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/es/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: es\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "La factura tiene una línea con el producto %s sin impuestos"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "No hay impuestos definidos!"

+ 35 - 0
i18n/fr.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-07-01 13:27+0000\n"
+"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n"
+"Language-Team: French (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/fr/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: fr\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "La facture a un produit %s sans taxe"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "Aucunes taxes définies"

+ 35 - 0
i18n/lt.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-07-01 13:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Lithuanian (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/lt/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: lt\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Sąskaita faktūra"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr ""
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr ""

+ 36 - 0
i18n/pt_BR.po

@@ -0,0 +1,36 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+# Alexsandro Haag <alex@hgsoft.com.br>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-08-29 03:30+0000\n"
+"Last-Translator: Alexsandro Haag <alex@hgsoft.com.br>\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/pt_BR/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Fatura"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "A Fatura com o produto %s está sem impostos"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "Sem Impostos Definidos!"

+ 35 - 0
i18n/pt_PT.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-03-07 17:46+0000\n"
+"PO-Revision-Date: 2015-07-01 13:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/pt_PT/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: pt_PT\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Fatura"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr ""
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr ""

+ 36 - 0
i18n/sl.po

@@ -0,0 +1,36 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-07-04 11:50+0000\n"
+"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
+"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/sl/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: sl\n"
+"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "Račun"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr "Račun vsebuje postavko s proizvodom %s brez davkov"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr "Davki niso določeni!"

+ 35 - 0
i18n/zh_TW.po

@@ -0,0 +1,35 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * account_invoice_tax_required
+# 
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: account-financial-tools (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2015-07-01 13:25+0000\n"
+"PO-Revision-Date: 2015-07-01 13:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Chinese (Taiwan) (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/zh_TW/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Language: zh_TW\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: account_invoice_tax_required
+#: model:ir.model,name:account_invoice_tax_required.model_account_invoice
+msgid "Invoice"
+msgstr "發票"
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:29
+#, python-format
+msgid "Invoice has a line with product %s with no taxes"
+msgstr ""
+
+#. module: account_invoice_tax_required
+#: code:addons/account_invoice_tax_required/models/account_invoice.py:37
+#, python-format
+msgid "No Taxes Defined!"
+msgstr ""

+ 20 - 0
models/__init__.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author Vincent Renaville. Copyright 2015 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from . import account_invoice

BIN
models/__init__.pyc


+ 46 - 0
models/account_invoice.py

@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Author Vincent Renaville. Copyright 2015 Camptocamp SA
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program 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 Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+from openerp import models, api, exceptions, _
+
+
+class AccountInvoice(models.Model):
+    _inherit = "account.invoice"
+
+    @api.multi
+    def test_invoice_line_tax(self):
+        errors = []
+        error_template = _("Invoice has a line with product %s with no taxes")
+        for invoice in self:
+            for invoice_line in invoice.invoice_line:
+                if not invoice_line.invoice_line_tax_id:
+                    error_string = error_template % (invoice_line.name)
+                    errors.append(error_string)
+        if errors:
+            errors_full_string = ','.join(x for x in errors)
+            raise exceptions.Warning(_('No Taxes Defined!'),
+                                     errors_full_string)
+        else:
+            return True
+
+    @api.multi
+    def invoice_validate(self):
+        self.test_invoice_line_tax()
+        res = super(AccountInvoice, self).invoice_validate()
+        return res

BIN
models/account_invoice.pyc


BIN
static/description/icon.png