diff --git a/update_invoice_line_taxes/__init__.py b/update_invoice_line_taxes/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/update_invoice_line_taxes/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/update_invoice_line_taxes/__manifest__.py b/update_invoice_line_taxes/__manifest__.py new file mode 100644 index 00000000..1e33ce6b --- /dev/null +++ b/update_invoice_line_taxes/__manifest__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2018 Johny Chen Jy , Trustcode +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ # pylint: disable=C8101,C8103 + 'name': 'Update Invoice Line Taxes', + 'summary': """Updates Invoice Line Taxes""", + 'version': '11.0.1.0.0', + 'category': 'NFE', + 'author': 'Trustcode', + 'license': 'AGPL-3', + 'website': 'http://www.trustcode.com.br', + 'contributors': [ + 'Johny Chen Jy ', + ], + 'depends': [ + 'br_account', + ], + 'data': [ + 'views/account_invoice_views.xml' + ], +} diff --git a/update_invoice_line_taxes/i18n/pt_BR.po b/update_invoice_line_taxes/i18n/pt_BR.po new file mode 100644 index 00000000..472d3797 --- /dev/null +++ b/update_invoice_line_taxes/i18n/pt_BR.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * update_invoice_line_taxes +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-06-01 22:06+0000\n" +"PO-Revision-Date: 2018-06-01 22:06+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: update_invoice_line_taxes +#: model:ir.ui.view,arch_db:update_invoice_line_taxes.view_update_taxes_invoice_form +msgid "Compute Taxes" +msgstr "Atualizar Impostos" + +#. module: update_invoice_line_taxes +#: model:ir.model,name:update_invoice_line_taxes.model_account_invoice +msgid "Invoice" +msgstr "Fatura" diff --git a/update_invoice_line_taxes/models/__init__.py b/update_invoice_line_taxes/models/__init__.py new file mode 100644 index 00000000..8e072db8 --- /dev/null +++ b/update_invoice_line_taxes/models/__init__.py @@ -0,0 +1 @@ +from . import account_invoice diff --git a/update_invoice_line_taxes/models/account_invoice.py b/update_invoice_line_taxes/models/account_invoice.py new file mode 100644 index 00000000..e78907b2 --- /dev/null +++ b/update_invoice_line_taxes/models/account_invoice.py @@ -0,0 +1,13 @@ +from odoo import models + + +class AccountInvoice(models.Model): + _inherit = "account.invoice" + + def update_taxes(self): + if self.fiscal_position_id: + for line in self.invoice_line_ids: + price_unit = line.price_unit + line._onchange_product_id() + line._br_account_onchange_product_id() + line.write({'price_unit': price_unit}) diff --git a/update_invoice_line_taxes/views/account_invoice_views.xml b/update_invoice_line_taxes/views/account_invoice_views.xml new file mode 100644 index 00000000..3c34d8c4 --- /dev/null +++ b/update_invoice_line_taxes/views/account_invoice_views.xml @@ -0,0 +1,14 @@ + + + + update_invoice_line_taxes.invoice.form + account.invoice + + + +