Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions update_invoice_line_taxes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions update_invoice_line_taxes/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2018 Johny Chen Jy <johnychenjy@gmail.com>, 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 <johnychenjy@gmail.com>',
],
'depends': [
'br_account',
],
'data': [
'views/account_invoice_views.xml'
],
}
26 changes: 26 additions & 0 deletions update_invoice_line_taxes/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions update_invoice_line_taxes/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_invoice
13 changes: 13 additions & 0 deletions update_invoice_line_taxes/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -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})
14 changes: 14 additions & 0 deletions update_invoice_line_taxes/views/account_invoice_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_update_taxes_invoice_form" model="ir.ui.view">
<field name="name">update_invoice_line_taxes.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="fiscal_position_id" position="after">
<label for="update_taxes" string="" />
<button string="Compute Taxes" name="update_taxes" type="object" class="btn btn-link"/>
</field>
</field>
</record>
</odoo>