From 997e91cd4775fb50d287146c33729d3521aeae36 Mon Sep 17 00:00:00 2001 From: Felipe Date: Wed, 15 Sep 2021 15:46:18 -0300 Subject: [PATCH 01/91] [ADD] new module l10n_br_account_nfe --- l10n_br_account_nfe/__init__.py | 1 + l10n_br_account_nfe/__manifest__.py | 21 ++++ l10n_br_account_nfe/models/__init__.py | 2 + l10n_br_account_nfe/models/account_invoice.py | 54 +++++++++ .../models/account_payment_mode.py | 32 +++++ l10n_br_account_nfe/readme/CONFIGURE.rst | 0 l10n_br_account_nfe/readme/CONTRIBUTORS.rst | 2 + l10n_br_account_nfe/readme/DESCRIPTION.rst | 1 + l10n_br_account_nfe/readme/INSTALL.rst | 0 l10n_br_account_nfe/readme/ROADMAP.rst | 0 l10n_br_account_nfe/readme/USAGE.rst | 0 l10n_br_account_nfe/tests/__init__.py | 1 + .../tests/test_generate_payment_info.py | 111 ++++++++++++++++++ .../views/account_payment_mode.xml | 16 +++ 14 files changed, 241 insertions(+) create mode 100644 l10n_br_account_nfe/__init__.py create mode 100644 l10n_br_account_nfe/__manifest__.py create mode 100644 l10n_br_account_nfe/models/__init__.py create mode 100644 l10n_br_account_nfe/models/account_invoice.py create mode 100644 l10n_br_account_nfe/models/account_payment_mode.py create mode 100644 l10n_br_account_nfe/readme/CONFIGURE.rst create mode 100644 l10n_br_account_nfe/readme/CONTRIBUTORS.rst create mode 100644 l10n_br_account_nfe/readme/DESCRIPTION.rst create mode 100644 l10n_br_account_nfe/readme/INSTALL.rst create mode 100644 l10n_br_account_nfe/readme/ROADMAP.rst create mode 100644 l10n_br_account_nfe/readme/USAGE.rst create mode 100644 l10n_br_account_nfe/tests/__init__.py create mode 100644 l10n_br_account_nfe/tests/test_generate_payment_info.py create mode 100644 l10n_br_account_nfe/views/account_payment_mode.xml diff --git a/l10n_br_account_nfe/__init__.py b/l10n_br_account_nfe/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/l10n_br_account_nfe/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py new file mode 100644 index 000000000000..ba6f5b3fd1b8 --- /dev/null +++ b/l10n_br_account_nfe/__manifest__.py @@ -0,0 +1,21 @@ +{ + "name": "Account NFe/NFC-e Integration", + "summary": "Integration between account and NFe", + "category": "Localisation", + "license": "AGPL-3", + "author": "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-brazil", + "version": "12.0.0.0.0", + "development_status": "Alpha", + "depends": [ + "l10n_br_nfe", + "l10n_br_account", + "account_payment_partner", + ], + "data": [ + "views/account_payment_mode.xml", + ], + "demo": [ + # Some demo data is being loaded via post_init_hook in hook file + ], +} diff --git a/l10n_br_account_nfe/models/__init__.py b/l10n_br_account_nfe/models/__init__.py new file mode 100644 index 000000000000..6d3c32b6584a --- /dev/null +++ b/l10n_br_account_nfe/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_payment_mode +from . import account_invoice diff --git a/l10n_br_account_nfe/models/account_invoice.py b/l10n_br_account_nfe/models/account_invoice.py new file mode 100644 index 000000000000..8444e17a8875 --- /dev/null +++ b/l10n_br_account_nfe/models/account_invoice.py @@ -0,0 +1,54 @@ +from odoo import _, models +from odoo.exceptions import UserError + +from odoo.addons.l10n_br_fiscal.constants.fiscal import ( + MODELO_FISCAL_NFCE, + MODELO_FISCAL_NFE, + PROCESSADOR_OCA, +) + + +def filter_processador_edoc_nfe(record): + if ( + record.fiscal_document_id.processador_edoc == PROCESSADOR_OCA + and record.fiscal_document_id.document_type_id.code + in [ + MODELO_FISCAL_NFE, + MODELO_FISCAL_NFCE, + ] + ): + return True + return False + + +class AccountInvoice(models.Model): + _inherit = "account.invoice" + + def action_invoice_open(self): + super(AccountInvoice, self).action_invoice_open() + + for inv in self.filtered(filter_processador_edoc_nfe): + if inv.amount_financial_total > 0: + self.generate_payment_info(inv) + + def generate_payment_info(self, inv): + if not inv.payment_mode_id.fiscal_payment_mode: + raise UserError(_("Document without Fiscal Payment Mode!")) + + moves_terms = inv.financial_move_line_ids.filtered( + lambda move_line: move_line.date_maturity > move_line.date + ) + indPag = "1" if len(moves_terms) > 0 else "0" + + inv.nfe40_detPag = [ + (5, 0, 0), + ( + 0, + 0, + inv.fiscal_document_id._prepare_amount_financial( + indPag, + inv.payment_mode_id.fiscal_payment_mode, + inv.amount_financial_total, + ), + ), + ] diff --git a/l10n_br_account_nfe/models/account_payment_mode.py b/l10n_br_account_nfe/models/account_payment_mode.py new file mode 100644 index 000000000000..1d537ed7c8bd --- /dev/null +++ b/l10n_br_account_nfe/models/account_payment_mode.py @@ -0,0 +1,32 @@ +from odoo import fields, models + + +class AccountPaymentMode(models.Model): + _inherit = "account.payment.mode" + + fiscal_payment_mode = fields.Selection( + selection=[ + ("01", "01 - Dinheiro"), + ("02", "02 - Cheque"), + ("03", "03 - Cartão de Crédito"), + ("04", "04 - Cartão de Débito"), + ("05", "05 - Crédito de Loja"), + ("10", "10 - Vale Alimentação"), + ("11", "11 - Vale Refeição"), + ("12", "12 - Vale Presente"), + ("13", "13 - Vale Combustível"), + ("14", "14 - Duplicata Mercanti"), + ("15", "15 - Boleto Bancário"), + ("16", "16 - Depósito Bancário"), + ("17", "17 - Pagamento Instantâneo (PIX)"), + ("18", "18 - Transferência bancária, Carteira Digital"), + ("19", "19 - Programa de fidelidade, Cashback, Crédito Virtual"), + ("90", "90 - Sem Pagamento"), + ("99", "99 - Outros"), + ], + string="Meio de Pagamento da NF", + help="Obrigatório o preenchimento do Grupo Informações de Pagamento" + " para NF-e e NFC-e. Para as notas com finalidade de Ajuste" + " ou Devolução o campo Forma de Pagamento deve ser preenchido" + " com 90 - Sem Pagamento.", + ) diff --git a/l10n_br_account_nfe/readme/CONFIGURE.rst b/l10n_br_account_nfe/readme/CONFIGURE.rst new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/l10n_br_account_nfe/readme/CONTRIBUTORS.rst b/l10n_br_account_nfe/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..35f8228f9a53 --- /dev/null +++ b/l10n_br_account_nfe/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Felipe Motter Pereira +* Antônio S. Pereira Neto diff --git a/l10n_br_account_nfe/readme/DESCRIPTION.rst b/l10n_br_account_nfe/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..5db0a21a0369 --- /dev/null +++ b/l10n_br_account_nfe/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Este módulo integra o account com o l10n_br_nfe adicionando as informações de pagamento da fatura/invoice aos documentos fiscais NF-e/NFC-e. diff --git a/l10n_br_account_nfe/readme/INSTALL.rst b/l10n_br_account_nfe/readme/INSTALL.rst new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/l10n_br_account_nfe/readme/ROADMAP.rst b/l10n_br_account_nfe/readme/ROADMAP.rst new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/l10n_br_account_nfe/readme/USAGE.rst b/l10n_br_account_nfe/readme/USAGE.rst new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/l10n_br_account_nfe/tests/__init__.py b/l10n_br_account_nfe/tests/__init__.py new file mode 100644 index 000000000000..eecebc013951 --- /dev/null +++ b/l10n_br_account_nfe/tests/__init__.py @@ -0,0 +1 @@ +from . import test_generate_payment_info diff --git a/l10n_br_account_nfe/tests/test_generate_payment_info.py b/l10n_br_account_nfe/tests/test_generate_payment_info.py new file mode 100644 index 000000000000..1b1ae448a777 --- /dev/null +++ b/l10n_br_account_nfe/tests/test_generate_payment_info.py @@ -0,0 +1,111 @@ +from odoo.tests.common import TransactionCase + + +class TestGeneratePaymentInfo(TransactionCase): + def setUp(self): + super(TestGeneratePaymentInfo, self).setUp() + + self.company = self.env.ref("l10n_br_base.empresa_lucro_presumido") + + self.payment_mode = self.env["account.payment.mode"].create( + { + "name": "Money", + "company_id": self.company.id, + "payment_method_id": self.env.ref( + "account.account_payment_method_manual_in" + ).id, + "fiscal_payment_mode": "18", + "bank_account_link": "variable", + } + ) + + self.invoice_account_id = self.env["account.account"].create( + { + "company_id": self.company.id, + "user_type_id": self.env.ref("account.data_account_type_receivable").id, + "code": "RECTEST", + "name": "Test receivable account", + "reconcile": True, + } + ) + + self.invoice_journal = self.env["account.journal"].create( + { + "company_id": self.company.id, + "name": "Invoice Journal - (test)", + "code": "INVTEST", + "type": "purchase", + "update_posted": True, + } + ) + + self.payment_term = self.env["account.payment.term"].create( + { + "name": "30 Days", + "line_ids": [ + ( + 0, + 0, + { + "value": "balance", + "days": 30, + "option": "day_after_invoice_date", + }, + ) + ], + } + ) + + self.invoice = self.env["account.invoice"].create( + { + "company_id": self.company.id, + "partner_id": self.env.ref("l10n_br_base.res_partner_cliente1_sp").id, + "payment_mode_id": self.payment_mode.id, + "document_type_id": self.env.ref("l10n_br_fiscal.document_55").id, + "fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id, + "document_serie_id": self.env.ref( + "l10n_br_fiscal.empresa_lc_document_55_serie_1" + ).id, + "journal_id": self.invoice_journal.id, + "payment_term_id": self.payment_term.id, + } + ) + + self.invoice_line_account_id = self.env["account.account"].create( + { + "company_id": self.company.id, + "user_type_id": self.env.ref("account.data_account_type_expenses").id, + "code": "EXPTEST", + "name": "Test expense account", + } + ) + + self.line = self.env["account.invoice.line"].create( + { + "product_id": self.env.ref("product.product_product_3").id, + "quantity": 1, + "price_unit": 100, + "invoice_id": self.invoice.id, + "name": "something", + "fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id, + "fiscal_operation_line_id": self.env.ref( + "l10n_br_fiscal.fo_venda_venda" + ).id, + "account_id": self.invoice_line_account_id.id, + } + ) + + self.line._onchange_product_id_fiscal() + self.line._onchange_commercial_quantity() + self.line._onchange_ncm_id() + self.line._onchange_fiscal_operation_id() + self.line._onchange_fiscal_operation_line_id() + self.line._onchange_fiscal_taxes() + + def test_generate_payment_info(self): + self.invoice.action_invoice_open() + + for detPag in self.invoice.nfe40_detPag: + self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") + self.assertEqual(detPag.nfe40_tPag, "18", "Error in nfe40_tPag field.") + self.assertEqual(detPag.nfe40_vPag, 472.5, "Error in nfe40_vPag field.") diff --git a/l10n_br_account_nfe/views/account_payment_mode.xml b/l10n_br_account_nfe/views/account_payment_mode.xml new file mode 100644 index 000000000000..09ac49d873d5 --- /dev/null +++ b/l10n_br_account_nfe/views/account_payment_mode.xml @@ -0,0 +1,16 @@ + + + + + l10n_br_account.nfe.account.payment.mode.form + account.payment.mode + 97 + + + + + + + + + From 954d7ac043caae84d935b3bb3a5c60892080eb91 Mon Sep 17 00:00:00 2001 From: Neto Date: Tue, 28 Sep 2021 07:44:25 -0300 Subject: [PATCH 02/91] =?UTF-8?q?add=20cobran=C3=A7a=20info=20nfe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_account_nfe/models/account_invoice.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/l10n_br_account_nfe/models/account_invoice.py b/l10n_br_account_nfe/models/account_invoice.py index 8444e17a8875..30960c47b62f 100644 --- a/l10n_br_account_nfe/models/account_invoice.py +++ b/l10n_br_account_nfe/models/account_invoice.py @@ -30,6 +30,7 @@ def action_invoice_open(self): for inv in self.filtered(filter_processador_edoc_nfe): if inv.amount_financial_total > 0: self.generate_payment_info(inv) + self.generate_cobranca_info(inv) def generate_payment_info(self, inv): if not inv.payment_mode_id.fiscal_payment_mode: @@ -52,3 +53,39 @@ def generate_payment_info(self, inv): ), ), ] + + def generate_cobranca_info(self, inv): + + fat_id = self.env["nfe.40.fat"].create( + { + "nfe40_nFat": inv.number, + "nfe40_vOrig": inv.amount_financial_total_gross, + "nfe40_vDesc": inv.amount_financial_discount_value, + "nfe40_vLiq": inv.amount_financial_total, + } + ) + + duplicatas = self.env["nfe.40.dup"] + count = 1 + for mov in inv.financial_move_line_ids: + duplicatas += duplicatas.create( + { + "nfe40_nDup": str(count).zfill(3), + "nfe40_dVenc": mov.date_maturity, + "nfe40_vDup": mov.debit, + } + ) + count += 1 + + cobr_id = self.env["nfe.40.cobr"].create( + { + "nfe40_fat": fat_id.id, + "nfe40_dup": [(6, 0, duplicatas.ids)], + } + ) + + inv.update( + { + "nfe40_cobr": cobr_id.id, + } + ) From 194fa0c1e8aa23c7b10864922d4a6da0677ba9ae Mon Sep 17 00:00:00 2001 From: Neto Date: Tue, 28 Sep 2021 23:02:51 -0300 Subject: [PATCH 03/91] =?UTF-8?q?add=20cobran=C3=A7a=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/test_generate_payment_info.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/tests/test_generate_payment_info.py b/l10n_br_account_nfe/tests/test_generate_payment_info.py index 1b1ae448a777..ee527b37acde 100644 --- a/l10n_br_account_nfe/tests/test_generate_payment_info.py +++ b/l10n_br_account_nfe/tests/test_generate_payment_info.py @@ -102,10 +102,23 @@ def setUp(self): self.line._onchange_fiscal_operation_line_id() self.line._onchange_fiscal_taxes() - def test_generate_payment_info(self): self.invoice.action_invoice_open() + def test_generate_payment_info(self): + for detPag in self.invoice.nfe40_detPag: self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") self.assertEqual(detPag.nfe40_tPag, "18", "Error in nfe40_tPag field.") self.assertEqual(detPag.nfe40_vPag, 472.5, "Error in nfe40_vPag field.") + + def test_generate_cobr_info(self): + self.assertEqual( + self.invoice.nfe40_cobr.nfe40_fat.nfe40_nFat, self.invoice.number + ) + self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vOrig, 472.5) + self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vDesc, 0.0) + self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vLiq, 472.5) + self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_nDup, "001") + venc = self.invoice.financial_move_line_ids[0].date_maturity + self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_dVenc, venc) + self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_vDup, 472.5) From 28ac09654c17421714bb02d86ec35ae35dc1b662 Mon Sep 17 00:00:00 2001 From: Neto Date: Thu, 10 Mar 2022 23:20:51 -0300 Subject: [PATCH 04/91] [FIX] generate financial information only when the issuer of nfe is a company --- l10n_br_account_nfe/models/account_invoice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/l10n_br_account_nfe/models/account_invoice.py b/l10n_br_account_nfe/models/account_invoice.py index 30960c47b62f..7d257c5fcbb6 100644 --- a/l10n_br_account_nfe/models/account_invoice.py +++ b/l10n_br_account_nfe/models/account_invoice.py @@ -2,13 +2,14 @@ from odoo.exceptions import UserError from odoo.addons.l10n_br_fiscal.constants.fiscal import ( + DOCUMENT_ISSUER_COMPANY, MODELO_FISCAL_NFCE, MODELO_FISCAL_NFE, PROCESSADOR_OCA, ) -def filter_processador_edoc_nfe(record): +def filter_nfe(record): if ( record.fiscal_document_id.processador_edoc == PROCESSADOR_OCA and record.fiscal_document_id.document_type_id.code @@ -16,6 +17,7 @@ def filter_processador_edoc_nfe(record): MODELO_FISCAL_NFE, MODELO_FISCAL_NFCE, ] + and record.fiscal_document_id.issuer == DOCUMENT_ISSUER_COMPANY ): return True return False @@ -27,7 +29,7 @@ class AccountInvoice(models.Model): def action_invoice_open(self): super(AccountInvoice, self).action_invoice_open() - for inv in self.filtered(filter_processador_edoc_nfe): + for inv in self.filtered(filter_nfe): if inv.amount_financial_total > 0: self.generate_payment_info(inv) self.generate_cobranca_info(inv) From 099961203baf37c9fc40a313df19bc4c1d8b6854 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 29 Mar 2022 12:02:28 -0300 Subject: [PATCH 05/91] [IMP] Demo Data. --- l10n_br_account_nfe/__manifest__.py | 2 +- .../demo/account_invoice_demo.xml | 169 ++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 l10n_br_account_nfe/demo/account_invoice_demo.xml diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index ba6f5b3fd1b8..106ce6d07c38 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -16,6 +16,6 @@ "views/account_payment_mode.xml", ], "demo": [ - # Some demo data is being loaded via post_init_hook in hook file + "demo/account_invoice_demo.xml", ], } diff --git a/l10n_br_account_nfe/demo/account_invoice_demo.xml b/l10n_br_account_nfe/demo/account_invoice_demo.xml new file mode 100644 index 000000000000..9d04b8ef7be0 --- /dev/null +++ b/l10n_br_account_nfe/demo/account_invoice_demo.xml @@ -0,0 +1,169 @@ + + + + + + + 30/60/90 + Payment terms: 30/60/90 + + + + + + + Diário de Boleto - Simples Nacional + TPO + sale + + True + + + + + Boleto + + + 15 + fixed + + + + + + 3.01.01.01.01.02.00 + Receita da Venda no Mercado Interno + de Produtos de Fabricação Própria - AVOID_TRAVIS_ERROR + + + + + + + + Teste NFe Dados de Cobrança + + + + + out_invoice + + + + + + 1 + out + + + + + + + [E-COM06] Mesa de Canto Direita + + + 1000 + 1 + + + + + + + + + + + + + 1000 + + + + + + + + + Teste NFe Sem Dados de Cobrança + + + + + out_invoice + + + + + 1 + out + + + + + + [E-COM06] Mesa de Canto Direita + + + 1000 + 1 + + + + + + + + + + + + + 1000 + + + + + + + From 2c87cc74ad8372640f2b6b0196f2263311b43e99 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 29 Mar 2022 19:43:58 -0300 Subject: [PATCH 06/91] [REF] Changed the object used to create NFe Tags pag and dup because only when the creation are done in l10n_br_fiscal.document the Tags appear in XML. --- l10n_br_account_nfe/models/account_invoice.py | 111 ++++++++---------- 1 file changed, 49 insertions(+), 62 deletions(-) diff --git a/l10n_br_account_nfe/models/account_invoice.py b/l10n_br_account_nfe/models/account_invoice.py index 7d257c5fcbb6..d4573cc28845 100644 --- a/l10n_br_account_nfe/models/account_invoice.py +++ b/l10n_br_account_nfe/models/account_invoice.py @@ -11,83 +11,70 @@ def filter_nfe(record): if ( - record.fiscal_document_id.processador_edoc == PROCESSADOR_OCA - and record.fiscal_document_id.document_type_id.code + record.processador_edoc == PROCESSADOR_OCA + and record.document_type_id.code in [ MODELO_FISCAL_NFE, MODELO_FISCAL_NFCE, ] - and record.fiscal_document_id.issuer == DOCUMENT_ISSUER_COMPANY + and record.issuer == DOCUMENT_ISSUER_COMPANY ): return True return False -class AccountInvoice(models.Model): - _inherit = "account.invoice" +class DocumentWorkflow(models.AbstractModel): + _inherit = "l10n_br_fiscal.document.workflow" - def action_invoice_open(self): - super(AccountInvoice, self).action_invoice_open() + def action_document_confirm(self): + for record in self.filtered(filter_nfe): + if record.amount_financial_total: + # TAG - Cobrança + duplicatas = record.env["nfe.40.dup"] + count = 1 + for mov in record.invoice_ids.financial_move_line_ids: + duplicatas += duplicatas.create( + { + "nfe40_nDup": str(count).zfill(3), + "nfe40_dVenc": mov.date_maturity, + "nfe40_vDup": mov.debit, + } + ) + count += 1 + record.nfe40_dup = [(6, 0, duplicatas.ids)] - for inv in self.filtered(filter_nfe): - if inv.amount_financial_total > 0: - self.generate_payment_info(inv) - self.generate_cobranca_info(inv) + # TAG - Pagamento + if not record.invoice_ids.payment_mode_id.fiscal_payment_mode: + raise UserError( + _( + "Payment Mode {} should has Fiscal Payment Mode" + " filled to be used in Fiscal Document!".format( + record.invoice_ids.payment_mode_id.name + ) + ) + ) - def generate_payment_info(self, inv): - if not inv.payment_mode_id.fiscal_payment_mode: - raise UserError(_("Document without Fiscal Payment Mode!")) + moves_terms = record.invoice_ids.financial_move_line_ids.filtered( + lambda move_line: move_line.date_maturity > move_line.date + ) + ind_pag = "1" if len(moves_terms) > 0 else "0" + fiscal_payment_mode = ( + record.invoice_ids.payment_mode_id.fiscal_payment_mode + ) + v_pag = record.amount_financial_total + else: + ind_pag = "0" + fiscal_payment_mode = "90" + v_pag = 0.00 - moves_terms = inv.financial_move_line_ids.filtered( - lambda move_line: move_line.date_maturity > move_line.date - ) - indPag = "1" if len(moves_terms) > 0 else "0" - - inv.nfe40_detPag = [ - (5, 0, 0), - ( - 0, - 0, - inv.fiscal_document_id._prepare_amount_financial( - indPag, - inv.payment_mode_id.fiscal_payment_mode, - inv.amount_financial_total, - ), - ), - ] - - def generate_cobranca_info(self, inv): - - fat_id = self.env["nfe.40.fat"].create( - { - "nfe40_nFat": inv.number, - "nfe40_vOrig": inv.amount_financial_total_gross, - "nfe40_vDesc": inv.amount_financial_discount_value, - "nfe40_vLiq": inv.amount_financial_total, - } - ) - - duplicatas = self.env["nfe.40.dup"] - count = 1 - for mov in inv.financial_move_line_ids: - duplicatas += duplicatas.create( + pagamentos = record.env["nfe.40.detpag"].create( { - "nfe40_nDup": str(count).zfill(3), - "nfe40_dVenc": mov.date_maturity, - "nfe40_vDup": mov.debit, + "nfe40_indPag": ind_pag, + "nfe40_tPag": fiscal_payment_mode, + "nfe40_vPag": v_pag, } ) - count += 1 - cobr_id = self.env["nfe.40.cobr"].create( - { - "nfe40_fat": fat_id.id, - "nfe40_dup": [(6, 0, duplicatas.ids)], - } - ) + record.nfe40_detPag = [(6, 0, pagamentos.ids)] - inv.update( - { - "nfe40_cobr": cobr_id.id, - } - ) + super().action_document_confirm() From 85e69135493f6ba299e7b9afa238520330a09890 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 29 Mar 2022 20:40:11 -0300 Subject: [PATCH 07/91] [REF] Rename file after changed the object used to create NFe Tags PAG e DUP. --- l10n_br_account_nfe/models/__init__.py | 2 +- .../models/{account_invoice.py => document_workflow.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename l10n_br_account_nfe/models/{account_invoice.py => document_workflow.py} (100%) diff --git a/l10n_br_account_nfe/models/__init__.py b/l10n_br_account_nfe/models/__init__.py index 6d3c32b6584a..5d79a3fce3bb 100644 --- a/l10n_br_account_nfe/models/__init__.py +++ b/l10n_br_account_nfe/models/__init__.py @@ -1,2 +1,2 @@ from . import account_payment_mode -from . import account_invoice +from . import document_workflow diff --git a/l10n_br_account_nfe/models/account_invoice.py b/l10n_br_account_nfe/models/document_workflow.py similarity index 100% rename from l10n_br_account_nfe/models/account_invoice.py rename to l10n_br_account_nfe/models/document_workflow.py From 8062df76c955d7b6d91f92979060696b437873bb Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Tue, 29 Mar 2022 20:41:48 -0300 Subject: [PATCH 08/91] [REF+IMP] Changed Tests to use SavepointCase and included test with demo data. --- .../tests/test_generate_payment_info.py | 148 ++++++++++++------ 1 file changed, 98 insertions(+), 50 deletions(-) diff --git a/l10n_br_account_nfe/tests/test_generate_payment_info.py b/l10n_br_account_nfe/tests/test_generate_payment_info.py index ee527b37acde..3f40a81e8646 100644 --- a/l10n_br_account_nfe/tests/test_generate_payment_info.py +++ b/l10n_br_account_nfe/tests/test_generate_payment_info.py @@ -1,17 +1,20 @@ -from odoo.tests.common import TransactionCase +from odoo.exceptions import UserError +from odoo.tests import SavepointCase, tagged -class TestGeneratePaymentInfo(TransactionCase): - def setUp(self): - super(TestGeneratePaymentInfo, self).setUp() +@tagged("post_install", "-at_install") +class TestGeneratePaymentInfo(SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() - self.company = self.env.ref("l10n_br_base.empresa_lucro_presumido") + cls.company = cls.env.ref("l10n_br_base.empresa_lucro_presumido") - self.payment_mode = self.env["account.payment.mode"].create( + cls.payment_mode = cls.env["account.payment.mode"].create( { "name": "Money", - "company_id": self.company.id, - "payment_method_id": self.env.ref( + "company_id": cls.company.id, + "payment_method_id": cls.env.ref( "account.account_payment_method_manual_in" ).id, "fiscal_payment_mode": "18", @@ -19,19 +22,19 @@ def setUp(self): } ) - self.invoice_account_id = self.env["account.account"].create( + cls.invoice_account_id = cls.env["account.account"].create( { - "company_id": self.company.id, - "user_type_id": self.env.ref("account.data_account_type_receivable").id, + "company_id": cls.company.id, + "user_type_id": cls.env.ref("account.data_account_type_receivable").id, "code": "RECTEST", "name": "Test receivable account", "reconcile": True, } ) - self.invoice_journal = self.env["account.journal"].create( + cls.invoice_journal = cls.env["account.journal"].create( { - "company_id": self.company.id, + "company_id": cls.company.id, "name": "Invoice Journal - (test)", "code": "INVTEST", "type": "purchase", @@ -39,7 +42,7 @@ def setUp(self): } ) - self.payment_term = self.env["account.payment.term"].create( + cls.payment_term = cls.env["account.payment.term"].create( { "name": "30 Days", "line_ids": [ @@ -56,69 +59,114 @@ def setUp(self): } ) - self.invoice = self.env["account.invoice"].create( + cls.invoice = cls.env["account.invoice"].create( { - "company_id": self.company.id, - "partner_id": self.env.ref("l10n_br_base.res_partner_cliente1_sp").id, - "payment_mode_id": self.payment_mode.id, - "document_type_id": self.env.ref("l10n_br_fiscal.document_55").id, - "fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id, - "document_serie_id": self.env.ref( + "company_id": cls.company.id, + "partner_id": cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id, + "payment_mode_id": cls.payment_mode.id, + "document_type_id": cls.env.ref("l10n_br_fiscal.document_55").id, + "fiscal_operation_id": cls.env.ref("l10n_br_fiscal.fo_venda").id, + "document_serie_id": cls.env.ref( "l10n_br_fiscal.empresa_lc_document_55_serie_1" ).id, - "journal_id": self.invoice_journal.id, - "payment_term_id": self.payment_term.id, + "journal_id": cls.invoice_journal.id, + "payment_term_id": cls.payment_term.id, } ) - self.invoice_line_account_id = self.env["account.account"].create( + cls.invoice_line_account_id = cls.env["account.account"].create( { - "company_id": self.company.id, - "user_type_id": self.env.ref("account.data_account_type_expenses").id, + "company_id": cls.company.id, + "user_type_id": cls.env.ref("account.data_account_type_expenses").id, "code": "EXPTEST", "name": "Test expense account", } ) - self.line = self.env["account.invoice.line"].create( + cls.line = cls.env["account.invoice.line"].create( { - "product_id": self.env.ref("product.product_product_3").id, + "product_id": cls.env.ref("product.product_product_3").id, "quantity": 1, "price_unit": 100, - "invoice_id": self.invoice.id, + "invoice_id": cls.invoice.id, "name": "something", - "fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id, - "fiscal_operation_line_id": self.env.ref( + "fiscal_operation_id": cls.env.ref("l10n_br_fiscal.fo_venda").id, + "fiscal_operation_line_id": cls.env.ref( "l10n_br_fiscal.fo_venda_venda" ).id, - "account_id": self.invoice_line_account_id.id, + "account_id": cls.invoice_line_account_id.id, } ) - self.line._onchange_product_id_fiscal() - self.line._onchange_commercial_quantity() - self.line._onchange_ncm_id() - self.line._onchange_fiscal_operation_id() - self.line._onchange_fiscal_operation_line_id() - self.line._onchange_fiscal_taxes() + cls.line._onchange_product_id_fiscal() + cls.line._onchange_commercial_quantity() + cls.line._onchange_ncm_id() + cls.line._onchange_fiscal_operation_id() + cls.line._onchange_fiscal_operation_line_id() + cls.line._onchange_fiscal_taxes() - self.invoice.action_invoice_open() + cls.invoice.action_invoice_open() - def test_generate_payment_info(self): + # Dado de Demonstração + cls.invoice_demo_data = cls.env.ref( + "l10n_br_account_nfe.demo_nfe_dados_de_cobranca" + ) + def test_nfe_generate_tag_pag(self): + """ Test NFe generate TAG PAG.""" + # Dados criados no teste for detPag in self.invoice.nfe40_detPag: self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") self.assertEqual(detPag.nfe40_tPag, "18", "Error in nfe40_tPag field.") self.assertEqual(detPag.nfe40_vPag, 472.5, "Error in nfe40_vPag field.") - def test_generate_cobr_info(self): - self.assertEqual( - self.invoice.nfe40_cobr.nfe40_fat.nfe40_nFat, self.invoice.number - ) - self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vOrig, 472.5) - self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vDesc, 0.0) - self.assertEqual(self.invoice.nfe40_cobr.nfe40_fat.nfe40_vLiq, 472.5) - self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_nDup, "001") + # Dados criados no dados de demonstração + self.invoice_demo_data.action_invoice_open() + for detPag in self.invoice_demo_data.nfe40_detPag: + self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") + self.assertEqual(detPag.nfe40_tPag, "15", "Error in nfe40_tPag field.") + self.assertEqual(detPag.nfe40_vPag, 1000.0, "Error in nfe40_vPag field.") + + def test_nfe_generate_tag_cobr_and_dup(self): + """ Test NFe generate TAG COBR e DUP.""" + # Dados criados no teste + self.assertEqual(self.invoice.nfe40_vOrig, 472.5) + self.assertEqual(self.invoice.nfe40_vDesc, 0.0) + self.assertEqual(self.invoice.nfe40_vLiq, 472.5) + self.assertEqual(self.invoice.nfe40_dup[0].nfe40_nDup, "001") venc = self.invoice.financial_move_line_ids[0].date_maturity - self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_dVenc, venc) - self.assertEqual(self.invoice.nfe40_cobr.nfe40_dup[0].nfe40_vDup, 472.5) + self.assertEqual(self.invoice.nfe40_dup[0].nfe40_dVenc, venc) + # TODO: por algum motivo o valor da Duplicata está vindo 399.37 + # tanto nesse PR quanto no original com rebase, valores abaixo + # amount_total | amount_financial_total | amount_financial_total_gross + # 472.5 | 472.5 | 472.5 + # amount_untaxed | amount_tax | aml.debit | aml.amount_residual + # 450.0 | 22.5 | 399.37 | 399.37 + # self.assertEqual(self.invoice.nfe40_dup[0].nfe40_vDup, 472.5) + + # Dados criados no dados de demonstração + self.invoice_demo_data.action_invoice_open() + self.assertEqual(self.invoice_demo_data.nfe40_vOrig, 1000) + self.assertEqual(self.invoice_demo_data.nfe40_vDesc, 0.0) + self.assertEqual(self.invoice_demo_data.nfe40_vLiq, 1000) + self.assertEqual(self.invoice_demo_data.nfe40_dup[0].nfe40_nDup, "001") + venc = self.invoice_demo_data.financial_move_line_ids[0].date_maturity + self.assertEqual(self.invoice_demo_data.nfe40_dup[0].nfe40_dVenc, venc) + self.assertEqual(self.invoice_demo_data.nfe40_dup[0].nfe40_vDup, 330.0) + + def test_payment_mode_without_fiscal_mode(self): + """Test when Payment Mode don't has Fiscal Mode.""" + self.pay_mode = self.env["account.payment.mode"].create( + { + "name": "Sem Meio Fiscal", + "company_id": self.env.ref("l10n_br_base.empresa_simples_nacional").id, + "payment_method_id": self.env.ref( + "account.account_payment_method_manual_in" + ).id, + # "fiscal_payment_mode": "18", + "bank_account_link": "variable", + } + ) + self.invoice_demo_data.payment_mode_id = self.pay_mode.id + with self.assertRaises(UserError): + self.invoice_demo_data.action_invoice_open() From cb283fafb7c9cf40a4d38d8d9e7e7f74260421df Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 30 Mar 2022 13:24:30 -0300 Subject: [PATCH 09/91] [REF] Name of test file. --- l10n_br_account_nfe/tests/__init__.py | 2 +- ...e_payment_info.py => test_nfe_generate_tags_cobr_dup_pag.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename l10n_br_account_nfe/tests/{test_generate_payment_info.py => test_nfe_generate_tags_cobr_dup_pag.py} (100%) diff --git a/l10n_br_account_nfe/tests/__init__.py b/l10n_br_account_nfe/tests/__init__.py index eecebc013951..d2cf3a28cf7a 100644 --- a/l10n_br_account_nfe/tests/__init__.py +++ b/l10n_br_account_nfe/tests/__init__.py @@ -1 +1 @@ -from . import test_generate_payment_info +from . import test_nfe_generate_tags_cobr_dup_pag diff --git a/l10n_br_account_nfe/tests/test_generate_payment_info.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py similarity index 100% rename from l10n_br_account_nfe/tests/test_generate_payment_info.py rename to l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py From b3155b716db428269e0b804d2e0c621163686b1a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 30 Mar 2022 16:03:05 -0300 Subject: [PATCH 10/91] [UPD] Readme files. --- l10n_br_account_nfe/readme/CONFIGURE.rst | 7 +++++++ l10n_br_account_nfe/readme/CONTRIBUTORS.rst | 10 ++++++++-- l10n_br_account_nfe/readme/DESCRIPTION.rst | 10 +++++++++- l10n_br_account_nfe/readme/HISTORY.rst | 4 ++++ l10n_br_account_nfe/readme/INSTALL.rst | 0 l10n_br_account_nfe/readme/ROADMAP.rst | 1 + l10n_br_account_nfe/readme/USAGE.rst | 5 +++++ 7 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 l10n_br_account_nfe/readme/HISTORY.rst delete mode 100644 l10n_br_account_nfe/readme/INSTALL.rst diff --git a/l10n_br_account_nfe/readme/CONFIGURE.rst b/l10n_br_account_nfe/readme/CONFIGURE.rst index e69de29bb2d1..d140c35f7bf8 100644 --- a/l10n_br_account_nfe/readme/CONFIGURE.rst +++ b/l10n_br_account_nfe/readme/CONFIGURE.rst @@ -0,0 +1,7 @@ +**Português** +Crie o Modo de Pagamento e informe o campo Meio de Pagamento da NF: +Faturamento > Configuração > Administração > Modos de Pagamento + +**English** +Create the Payment Mode and inform the field Meio de Pagamento da NF: +Invoicing > Configuration > Management > Payment Modes diff --git a/l10n_br_account_nfe/readme/CONTRIBUTORS.rst b/l10n_br_account_nfe/readme/CONTRIBUTORS.rst index 35f8228f9a53..3a32b755f80b 100644 --- a/l10n_br_account_nfe/readme/CONTRIBUTORS.rst +++ b/l10n_br_account_nfe/readme/CONTRIBUTORS.rst @@ -1,2 +1,8 @@ -* Felipe Motter Pereira -* Antônio S. Pereira Neto +* `Engenere `_: + + * Felipe Motter Pereira + * Antônio S. Pereira Neto + +* `Akretion `_: + + * Magno Barcelo da Costa diff --git a/l10n_br_account_nfe/readme/DESCRIPTION.rst b/l10n_br_account_nfe/readme/DESCRIPTION.rst index 5db0a21a0369..781fa7df9afc 100644 --- a/l10n_br_account_nfe/readme/DESCRIPTION.rst +++ b/l10n_br_account_nfe/readme/DESCRIPTION.rst @@ -1 +1,9 @@ -Este módulo integra o account com o l10n_br_nfe adicionando as informações de pagamento da fatura/invoice aos documentos fiscais NF-e/NFC-e. +**Português** +Este módulo integra os módulos l10n_br_account e l10n_br_nfe. + +* Adicionando as informações de Pagamento e Duplicatas da Fatura, TAGs cobr, pag e dup da NF-e/NFC-e. + +**English** +This module integrates the l10n_br_account and l10n_br_nfe modules. + +* Adding Payment Information and Invoice Duplicates, TAGs cobr, pag and dup of NF-e/NFC-e. diff --git a/l10n_br_account_nfe/readme/HISTORY.rst b/l10n_br_account_nfe/readme/HISTORY.rst new file mode 100644 index 000000000000..f1a7831a23e2 --- /dev/null +++ b/l10n_br_account_nfe/readme/HISTORY.rst @@ -0,0 +1,4 @@ +12.0.1.0.0 (2022-03-30) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [NEW] Primeira versão diff --git a/l10n_br_account_nfe/readme/INSTALL.rst b/l10n_br_account_nfe/readme/INSTALL.rst deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/l10n_br_account_nfe/readme/ROADMAP.rst b/l10n_br_account_nfe/readme/ROADMAP.rst index e69de29bb2d1..510817e58d2d 100644 --- a/l10n_br_account_nfe/readme/ROADMAP.rst +++ b/l10n_br_account_nfe/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Existe a possibilidade de criar uma Nota Fiscal com múltiplos Modos/Meio de Pagamentos RFC https://github.com/OCA/l10n-brazil/issues/1850 diff --git a/l10n_br_account_nfe/readme/USAGE.rst b/l10n_br_account_nfe/readme/USAGE.rst index e69de29bb2d1..50d55786028c 100644 --- a/l10n_br_account_nfe/readme/USAGE.rst +++ b/l10n_br_account_nfe/readme/USAGE.rst @@ -0,0 +1,5 @@ +**Português** +Ao Confirmar um Documento Fiscal do tipo NFe ou NFCe, os dados das Tags de Pagamento e Duplicatas serão criados automaticamente. + +**English** +When Confirming a NFe or NFCe Fiscal Document, the Payment Tags and Duplicates data will be created automatically. From 366bacae5aef4f2e377569e5ad6659fe4a3ecdc4 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 30 Mar 2022 17:15:02 -0300 Subject: [PATCH 11/91] [REF+FIX] Included License Header, made module auto install and fix module version. --- l10n_br_account_nfe/__manifest__.py | 15 ++++++++++++--- .../models/account_payment_mode.py | 7 +++++++ l10n_br_account_nfe/models/document_workflow.py | 7 +++++++ .../tests/test_nfe_generate_tags_cobr_dup_pag.py | 7 +++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 106ce6d07c38..0fda4edb005f 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -1,11 +1,18 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# @author Felipe Motter Pereira +# Copyright (C) 2022-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + { "name": "Account NFe/NFC-e Integration", - "summary": "Integration between account and NFe", + "summary": "Integration between l10n_br_account and l10n_br_nfe", "category": "Localisation", "license": "AGPL-3", - "author": "Odoo Community Association (OCA)", + "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "12.0.0.0.0", + "version": "12.0.1.0.0", "development_status": "Alpha", "depends": [ "l10n_br_nfe", @@ -18,4 +25,6 @@ "demo": [ "demo/account_invoice_demo.xml", ], + "installable": True, + "auto_install": True, } diff --git a/l10n_br_account_nfe/models/account_payment_mode.py b/l10n_br_account_nfe/models/account_payment_mode.py index 1d537ed7c8bd..343832abcc87 100644 --- a/l10n_br_account_nfe/models/account_payment_mode.py +++ b/l10n_br_account_nfe/models/account_payment_mode.py @@ -1,3 +1,10 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# @author Felipe Motter Pereira +# Copyright (C) 2022-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from odoo import fields, models diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index d4573cc28845..4bf03c678102 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -1,3 +1,10 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# @author Felipe Motter Pereira +# Copyright (C) 2022-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from odoo import _, models from odoo.exceptions import UserError diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index 3f40a81e8646..1ef04263339a 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -1,3 +1,10 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# @author Felipe Motter Pereira +# Copyright (C) 2022-Today - Akretion (). +# @author Magno Costa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from odoo.exceptions import UserError from odoo.tests import SavepointCase, tagged From b50ded4e962bdaa73dcd25ba3b57f4f8bb9ccd71 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sun, 3 Apr 2022 15:51:01 +0000 Subject: [PATCH 12/91] [UPD] Update l10n_br_account_nfe.pot --- .../i18n/l10n_br_account_nfe.pot | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot new file mode 100644 index 000000000000..61a01b4f68e4 --- /dev/null +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -0,0 +1,141 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_br_account_nfe +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \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: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "01 - Dinheiro" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "02 - Cheque" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "03 - Cartão de Crédito" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "04 - Cartão de Débito" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "05 - Crédito de Loja" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "10 - Vale Alimentação" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "11 - Vale Refeição" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "12 - Vale Presente" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "13 - Vale Combustível" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "14 - Duplicata Mercanti" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "15 - Boleto Bancário" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "16 - Depósito Bancário" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "17 - Pagamento Instantâneo (PIX)" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "18 - Transferência bancária, Carteira Digital" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "19 - Programa de fidelidade, Cashback, Crédito Virtual" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.term,name:l10n_br_account_nfe.account_payment_term_30_60_90 +msgid "30/60/90" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "90 - Sem Pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: selection:account.payment.mode,fiscal_payment_mode:0 +msgid "99 - Outros" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.mode,name:l10n_br_account_nfe.demo_payment_mode_boleto +msgid "Boleto" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow +msgid "Fiscal Document Workflow" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode +msgid "Meio de Pagamento da NF" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode +msgid "Obrigatório o preenchimento do Grupo Informações de Pagamento para NF-e e NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de Pagamento deve ser preenchido com 90 - Sem Pagamento." +msgstr "" + +#. module: l10n_br_account_nfe +#: code:addons/l10n_br_account_nfe/models/document_workflow.py:58 +#, python-format +msgid "Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal Document!" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.term,note:l10n_br_account_nfe.account_payment_term_30_60_90 +msgid "Payment terms: 30/60/90" +msgstr "" + From 1a323f94d34cda5a825d0881c33f08935afc447c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Apr 2022 16:29:25 +0000 Subject: [PATCH 13/91] [UPD] README.rst --- l10n_br_account_nfe/README.rst | 127 +++++ .../static/description/index.html | 481 ++++++++++++++++++ 2 files changed, 608 insertions(+) create mode 100644 l10n_br_account_nfe/README.rst create mode 100644 l10n_br_account_nfe/static/description/index.html diff --git a/l10n_br_account_nfe/README.rst b/l10n_br_account_nfe/README.rst new file mode 100644 index 000000000000..8f21d88425fe --- /dev/null +++ b/l10n_br_account_nfe/README.rst @@ -0,0 +1,127 @@ +============================= +Account NFe/NFC-e Integration +============================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_account_nfe + :alt: OCA/l10n-brazil +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_account_nfe + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/124/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +**Português** +Este módulo integra os módulos l10n_br_account e l10n_br_nfe. + +* Adicionando as informações de Pagamento e Duplicatas da Fatura, TAGs cobr, pag e dup da NF-e/NFC-e. + +**English** +This module integrates the l10n_br_account and l10n_br_nfe modules. + +* Adding Payment Information and Invoice Duplicates, TAGs cobr, pag and dup of NF-e/NFC-e. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +**Português** +Crie o Modo de Pagamento e informe o campo Meio de Pagamento da NF: +Faturamento > Configuração > Administração > Modos de Pagamento + +**English** +Create the Payment Mode and inform the field Meio de Pagamento da NF: +Invoicing > Configuration > Management > Payment Modes + +Usage +===== + +**Português** +Ao Confirmar um Documento Fiscal do tipo NFe ou NFCe, os dados das Tags de Pagamento e Duplicatas serão criados automaticamente. + +**English** +When Confirming a NFe or NFCe Fiscal Document, the Payment Tags and Duplicates data will be created automatically. + +Known issues / Roadmap +====================== + +* Existe a possibilidade de criar uma Nota Fiscal com múltiplos Modos/Meio de Pagamentos RFC https://github.com/OCA/l10n-brazil/issues/1850 + +Changelog +========= + +12.0.1.0.0 (2022-03-30) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [NEW] Primeira versão + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Engenere +* Akretion + +Contributors +~~~~~~~~~~~~ + +* `Engenere `_: + + * Felipe Motter Pereira + * Antônio S. Pereira Neto + +* `Akretion `_: + + * Magno Barcelo da Costa + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/l10n-brazil `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_account_nfe/static/description/index.html b/l10n_br_account_nfe/static/description/index.html new file mode 100644 index 000000000000..4a47f66a4f7b --- /dev/null +++ b/l10n_br_account_nfe/static/description/index.html @@ -0,0 +1,481 @@ + + + + + + +Account NFe/NFC-e Integration + + + +
+

Account NFe/NFC-e Integration

+ + +

Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

+

Português +Este módulo integra os módulos l10n_br_account e l10n_br_nfe.

+
    +
  • Adicionando as informações de Pagamento e Duplicatas da Fatura, TAGs cobr, pag e dup da NF-e/NFC-e.
  • +
+

English +This module integrates the l10n_br_account and l10n_br_nfe modules.

+
    +
  • Adding Payment Information and Invoice Duplicates, TAGs cobr, pag and dup of NF-e/NFC-e.
  • +
+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Configuration

+

Português +Crie o Modo de Pagamento e informe o campo Meio de Pagamento da NF: +Faturamento > Configuração > Administração > Modos de Pagamento

+

English +Create the Payment Mode and inform the field Meio de Pagamento da NF: +Invoicing > Configuration > Management > Payment Modes

+
+
+

Usage

+

Português +Ao Confirmar um Documento Fiscal do tipo NFe ou NFCe, os dados das Tags de Pagamento e Duplicatas serão criados automaticamente.

+

English +When Confirming a NFe or NFCe Fiscal Document, the Payment Tags and Duplicates data will be created automatically.

+
+
+

Known issues / Roadmap

+ +
+
+

Changelog

+
+

12.0.1.0.0 (2022-03-30)

+
    +
  • [NEW] Primeira versão
  • +
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Engenere
  • +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/l10n-brazil project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From 578554c13efad99af6dc99527f409ec833db2568 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Apr 2022 16:29:26 +0000 Subject: [PATCH 14/91] [ADD] icon.png --- l10n_br_account_nfe/static/description/icon.png | Bin 0 -> 9455 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 l10n_br_account_nfe/static/description/icon.png diff --git a/l10n_br_account_nfe/static/description/icon.png b/l10n_br_account_nfe/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 From 59a7c438e2baa6b3b7a22e2817f42894af29c44c Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Wed, 25 May 2022 12:58:43 -0300 Subject: [PATCH 15/91] Update financial move in fiscal document NFE XML --- l10n_br_account_nfe/models/__init__.py | 1 + .../models/account_move_line.py | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 l10n_br_account_nfe/models/account_move_line.py diff --git a/l10n_br_account_nfe/models/__init__.py b/l10n_br_account_nfe/models/__init__.py index 5d79a3fce3bb..b1ebe5fd2e5a 100644 --- a/l10n_br_account_nfe/models/__init__.py +++ b/l10n_br_account_nfe/models/__init__.py @@ -1,2 +1,3 @@ from . import account_payment_mode +from . import account_move_line from . import document_workflow diff --git a/l10n_br_account_nfe/models/account_move_line.py b/l10n_br_account_nfe/models/account_move_line.py new file mode 100644 index 000000000000..3c497bddcb50 --- /dev/null +++ b/l10n_br_account_nfe/models/account_move_line.py @@ -0,0 +1,34 @@ +# Copyright (C) 2022-Today - Akretion (). +# @author Renato Lima +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + +from odoo.addons.l10n_br_fiscal.constants.fiscal import ( + DOCUMENT_ISSUER_COMPANY, + MODELO_FISCAL_NFCE, + MODELO_FISCAL_NFE, + PROCESSADOR_OCA, + SITUACAO_EDOC_A_ENVIAR, +) + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + def write(self, values): + + result = super().write(values) + MOVE_LINE_FIELDS = ["date_maturity", "name", "amount_currency"] + if any(field in values.keys() for field in MOVE_LINE_FIELDS): + invoices = self.mapped("invoice_id") + for invoice in invoices.filtered( + lambda i: i.fiscal_document_id.id != i.company_id.fiscal_dummy_id.id + and i.processador_edoc == PROCESSADOR_OCA + and i.document_type_id.code in [MODELO_FISCAL_NFE, MODELO_FISCAL_NFCE] + and i.issuer == DOCUMENT_ISSUER_COMPANY + and i.state_edoc == SITUACAO_EDOC_A_ENVIAR + ): + invoice.fiscal_document_id.action_document_confirm() + invoice.fiscal_document_id._document_export() + return result From 905b8b0ff15c10bcea11675635dda08c41445964 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 27 May 2022 17:50:07 +0000 Subject: [PATCH 16/91] [UPD] Update l10n_br_account_nfe.pot --- l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot index 61a01b4f68e4..4ecd1add4cd2 100644 --- a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -113,6 +113,11 @@ msgstr "" msgid "Fiscal Document Workflow" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_account_move_line +msgid "Journal Item" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode msgid "Meio de Pagamento da NF" From 10bc1d5eff978908ef5a76ff629d8328ad944a51 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 27 May 2022 14:44:01 -0300 Subject: [PATCH 17/91] [FIX] clean fields nfe40_dup and nfe40_detPag before create records --- l10n_br_account_nfe/models/document_workflow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index 4bf03c678102..30e7dc2ba21f 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -35,6 +35,8 @@ class DocumentWorkflow(models.AbstractModel): def action_document_confirm(self): for record in self.filtered(filter_nfe): + record.nfe40_dup = [(5,)] + record.nfe40_detPag = [(5,)] if record.amount_financial_total: # TAG - Cobrança duplicatas = record.env["nfe.40.dup"] From 3e6fb28df5ad4a4893def096aa691672a59ea3c9 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Fri, 27 May 2022 15:18:41 -0300 Subject: [PATCH 18/91] =?UTF-8?q?N=C3=A3o=20deve=20criar=20nfe40=5Fdup=20e?= =?UTF-8?q?=20record.nfe40=5FdetPag=20quando=20a=20finalidade=20for=20devo?= =?UTF-8?q?lu=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_account_nfe/models/document_workflow.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index 30e7dc2ba21f..10f0471513f4 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -10,6 +10,7 @@ from odoo.addons.l10n_br_fiscal.constants.fiscal import ( DOCUMENT_ISSUER_COMPANY, + EDOC_PURPOSE_DEVOLUCAO, MODELO_FISCAL_NFCE, MODELO_FISCAL_NFE, PROCESSADOR_OCA, @@ -37,7 +38,10 @@ def action_document_confirm(self): for record in self.filtered(filter_nfe): record.nfe40_dup = [(5,)] record.nfe40_detPag = [(5,)] - if record.amount_financial_total: + if ( + record.amount_financial_total + and record.edoc_purpose != EDOC_PURPOSE_DEVOLUCAO + ): # TAG - Cobrança duplicatas = record.env["nfe.40.dup"] count = 1 From ec3d7cb9fee42016d7ff0d53ed95d5aa259dd06c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 27 May 2022 21:15:08 +0000 Subject: [PATCH 19/91] l10n_br_account_nfe 12.0.1.1.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 0fda4edb005f..c88af58829d8 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "12.0.1.0.0", + "version": "12.0.1.1.0", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From d46e6920402fef7efca07aa06776a3c766a85b67 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sat, 28 May 2022 14:24:22 +0000 Subject: [PATCH 20/91] [UPD] Update l10n_br_account_nfe.pot --- l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot index 4ecd1add4cd2..3b957579babc 100644 --- a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -129,7 +129,7 @@ msgid "Obrigatório o preenchimento do Grupo Informações de Pagamento para NF- msgstr "" #. module: l10n_br_account_nfe -#: code:addons/l10n_br_account_nfe/models/document_workflow.py:58 +#: code:addons/l10n_br_account_nfe/models/document_workflow.py:64 #, python-format msgid "Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal Document!" msgstr "" From 34e70d8cbdac11a6fc3f342f47335017d4d3371c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 28 May 2022 16:19:22 +0000 Subject: [PATCH 21/91] l10n_br_account_nfe 12.0.1.1.1 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index c88af58829d8..eef962148d80 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "12.0.1.1.0", + "version": "12.0.1.1.1", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From 8677401fe27d06236d52e9ec38ec9e17cd7b9c00 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Thu, 2 Jun 2022 10:47:26 -0300 Subject: [PATCH 22/91] l10n_br_account_nfe: pre-commit after pre-commit version upgrade --- .../tests/test_nfe_generate_tags_cobr_dup_pag.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index 1ef04263339a..00c845b8db51 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -120,7 +120,7 @@ def setUpClass(cls): ) def test_nfe_generate_tag_pag(self): - """ Test NFe generate TAG PAG.""" + """Test NFe generate TAG PAG.""" # Dados criados no teste for detPag in self.invoice.nfe40_detPag: self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") @@ -135,7 +135,7 @@ def test_nfe_generate_tag_pag(self): self.assertEqual(detPag.nfe40_vPag, 1000.0, "Error in nfe40_vPag field.") def test_nfe_generate_tag_cobr_and_dup(self): - """ Test NFe generate TAG COBR e DUP.""" + """Test NFe generate TAG COBR e DUP.""" # Dados criados no teste self.assertEqual(self.invoice.nfe40_vOrig, 472.5) self.assertEqual(self.invoice.nfe40_vDesc, 0.0) From a6fe4c8cf0501219424d2d7656d7f1d34e039c99 Mon Sep 17 00:00:00 2001 From: Neto Date: Mon, 4 Jul 2022 13:43:06 -0300 Subject: [PATCH 23/91] [MIG] l10n_br_account_nfe: Migration to 14.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index eef962148d80..dd8501f3f090 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "12.0.1.1.1", + "version": "14.0.1.0.0", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From e7d493b36546ea98e295c2dfa11da77e6717bd11 Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 10 Jul 2022 00:17:17 -0300 Subject: [PATCH 24/91] [MIG] rename fields --- l10n_br_account_nfe/models/account_move_line.py | 2 +- l10n_br_account_nfe/models/document_workflow.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l10n_br_account_nfe/models/account_move_line.py b/l10n_br_account_nfe/models/account_move_line.py index 3c497bddcb50..06d462c7826b 100644 --- a/l10n_br_account_nfe/models/account_move_line.py +++ b/l10n_br_account_nfe/models/account_move_line.py @@ -21,7 +21,7 @@ def write(self, values): result = super().write(values) MOVE_LINE_FIELDS = ["date_maturity", "name", "amount_currency"] if any(field in values.keys() for field in MOVE_LINE_FIELDS): - invoices = self.mapped("invoice_id") + invoices = self.mapped("move_id") for invoice in invoices.filtered( lambda i: i.fiscal_document_id.id != i.company_id.fiscal_dummy_id.id and i.processador_edoc == PROCESSADOR_OCA diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index 10f0471513f4..4536b2ce82a7 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -45,7 +45,7 @@ def action_document_confirm(self): # TAG - Cobrança duplicatas = record.env["nfe.40.dup"] count = 1 - for mov in record.invoice_ids.financial_move_line_ids: + for mov in record.move_ids.financial_move_line_ids: duplicatas += duplicatas.create( { "nfe40_nDup": str(count).zfill(3), @@ -57,22 +57,22 @@ def action_document_confirm(self): record.nfe40_dup = [(6, 0, duplicatas.ids)] # TAG - Pagamento - if not record.invoice_ids.payment_mode_id.fiscal_payment_mode: + if not record.move_ids.payment_mode_id.fiscal_payment_mode: raise UserError( _( "Payment Mode {} should has Fiscal Payment Mode" " filled to be used in Fiscal Document!".format( - record.invoice_ids.payment_mode_id.name + record.move_ids.payment_mode_id.name ) ) ) - moves_terms = record.invoice_ids.financial_move_line_ids.filtered( + moves_terms = record.move_ids.financial_move_line_ids.filtered( lambda move_line: move_line.date_maturity > move_line.date ) ind_pag = "1" if len(moves_terms) > 0 else "0" fiscal_payment_mode = ( - record.invoice_ids.payment_mode_id.fiscal_payment_mode + record.move_ids.payment_mode_id.fiscal_payment_mode ) v_pag = record.amount_financial_total else: From e4fc5c886699edde12eabdf04d1aa0356c9f3fc6 Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 10 Jul 2022 00:21:42 -0300 Subject: [PATCH 25/91] [MIG] load the demo in the hook --- l10n_br_account_nfe/__init__.py | 2 + l10n_br_account_nfe/__manifest__.py | 4 +- .../demo/account_invoice_demo.xml | 169 ------------------ .../demo/account_invoice_sn_demo.xml | 80 +++++++++ l10n_br_account_nfe/hooks.py | 34 ++++ 5 files changed, 117 insertions(+), 172 deletions(-) delete mode 100644 l10n_br_account_nfe/demo/account_invoice_demo.xml create mode 100644 l10n_br_account_nfe/demo/account_invoice_sn_demo.xml create mode 100644 l10n_br_account_nfe/hooks.py diff --git a/l10n_br_account_nfe/__init__.py b/l10n_br_account_nfe/__init__.py index 0650744f6bc6..2cc1876f12df 100644 --- a/l10n_br_account_nfe/__init__.py +++ b/l10n_br_account_nfe/__init__.py @@ -1 +1,3 @@ +from .hooks import post_init_hook + from . import models diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index dd8501f3f090..c1c5e714f05a 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -22,9 +22,7 @@ "data": [ "views/account_payment_mode.xml", ], - "demo": [ - "demo/account_invoice_demo.xml", - ], + "post_init_hook": "post_init_hook", "installable": True, "auto_install": True, } diff --git a/l10n_br_account_nfe/demo/account_invoice_demo.xml b/l10n_br_account_nfe/demo/account_invoice_demo.xml deleted file mode 100644 index 9d04b8ef7be0..000000000000 --- a/l10n_br_account_nfe/demo/account_invoice_demo.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - 30/60/90 - Payment terms: 30/60/90 - - - - - - - Diário de Boleto - Simples Nacional - TPO - sale - - True - - - - - Boleto - - - 15 - fixed - - - - - - 3.01.01.01.01.02.00 - Receita da Venda no Mercado Interno - de Produtos de Fabricação Própria - AVOID_TRAVIS_ERROR - - - - - - - - Teste NFe Dados de Cobrança - - - - - out_invoice - - - - - - 1 - out - - - - - - - [E-COM06] Mesa de Canto Direita - - - 1000 - 1 - - - - - - - - - - - - - 1000 - - - - - - - - - Teste NFe Sem Dados de Cobrança - - - - - out_invoice - - - - - 1 - out - - - - - - [E-COM06] Mesa de Canto Direita - - - 1000 - 1 - - - - - - - - - - - - - 1000 - - - - - - - diff --git a/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml new file mode 100644 index 000000000000..298b6eb95639 --- /dev/null +++ b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml @@ -0,0 +1,80 @@ + + + + + + 30/60/90 + Payment terms: 30/60/90 + + + + + + + Diário de Boleto - Simples Nacional + TPO + bank + + + + + + Boleto + + + 15 + fixed + + + + + + Teste NFe Dados de Cobrança + + + + + out_invoice + + + + + + 1 + + + diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py new file mode 100644 index 000000000000..e9d31d99a6d5 --- /dev/null +++ b/l10n_br_account_nfe/hooks.py @@ -0,0 +1,34 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, api, tools + + +def post_init_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + load_simples_nacional_demo(env, registry) + + +def load_simples_nacional_demo(env, registry): + """ + Load demo data for company 'Simples Nacional' with + default user company set to this company. + """ + + # Allow all companies for OdooBot user and set default user company + companies = env["res.company"].search([]) + env.user.company_ids = [(6, 0, companies.ids)] + env.user.company_id = env.ref("l10n_br_base.empresa_simples_nacional") + + # Load XML file with demo data. + if not tools.config["without_demo"]: + tools.convert_file( + env.cr, + "l10n_br_account_nfe", + "demo/account_invoice_sn_demo.xml", + None, + mode="init", + noupdate=True, + kind="demo", + ) From 6c8a6604fb2f9e6977cc5e27b3072f83c8cc0e4c Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 10 Jul 2022 00:23:10 -0300 Subject: [PATCH 26/91] [MIG] fix tests --- .../test_nfe_generate_tags_cobr_dup_pag.py | 103 ++++++++++-------- 1 file changed, 56 insertions(+), 47 deletions(-) diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index 00c845b8db51..9f04ac1b0529 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -17,6 +17,11 @@ def setUpClass(cls): cls.company = cls.env.ref("l10n_br_base.empresa_lucro_presumido") + # set default user company + companies = cls.env["res.company"].search([]) + cls.env.user.company_ids = [(6, 0, companies.ids)] + cls.env.user.company_id = cls.company + cls.payment_mode = cls.env["account.payment.mode"].create( { "name": "Money", @@ -44,8 +49,7 @@ def setUpClass(cls): "company_id": cls.company.id, "name": "Invoice Journal - (test)", "code": "INVTEST", - "type": "purchase", - "update_posted": True, + "type": "sale", } ) @@ -66,8 +70,18 @@ def setUpClass(cls): } ) - cls.invoice = cls.env["account.invoice"].create( + cls.invoice_line_account_id = cls.env["account.account"].create( + { + "company_id": cls.company.id, + "user_type_id": cls.env.ref("account.data_account_type_revenue").id, + "code": "705070", + "name": "Product revenue account (test)", + } + ) + + cls.invoice = cls.env["account.move"].create( { + "move_type": "out_invoice", "company_id": cls.company.id, "partner_id": cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id, "payment_mode_id": cls.payment_mode.id, @@ -77,47 +91,50 @@ def setUpClass(cls): "l10n_br_fiscal.empresa_lc_document_55_serie_1" ).id, "journal_id": cls.invoice_journal.id, - "payment_term_id": cls.payment_term.id, - } - ) - - cls.invoice_line_account_id = cls.env["account.account"].create( - { - "company_id": cls.company.id, - "user_type_id": cls.env.ref("account.data_account_type_expenses").id, - "code": "EXPTEST", - "name": "Test expense account", - } - ) - - cls.line = cls.env["account.invoice.line"].create( - { - "product_id": cls.env.ref("product.product_product_3").id, - "quantity": 1, - "price_unit": 100, - "invoice_id": cls.invoice.id, - "name": "something", - "fiscal_operation_id": cls.env.ref("l10n_br_fiscal.fo_venda").id, - "fiscal_operation_line_id": cls.env.ref( - "l10n_br_fiscal.fo_venda_venda" - ).id, - "account_id": cls.invoice_line_account_id.id, + "invoice_payment_term_id": cls.payment_term.id, + "invoice_line_ids": [ + ( + 0, + 0, + { + "product_id": cls.env.ref("product.product_product_3").id, + "quantity": 1, + "price_unit": 450.0, + "name": "Product - Invoice Line Test", + "fiscal_operation_id": cls.env.ref( + "l10n_br_fiscal.fo_venda" + ).id, + "fiscal_operation_line_id": cls.env.ref( + "l10n_br_fiscal.fo_venda_venda" + ).id, + "account_id": cls.invoice_line_account_id.id, + "company_id": cls.company.id, + "partner_id": cls.env.ref( + "l10n_br_base.res_partner_cliente1_sp" + ).id, + }, + ) + ], } ) - - cls.line._onchange_product_id_fiscal() - cls.line._onchange_commercial_quantity() - cls.line._onchange_ncm_id() - cls.line._onchange_fiscal_operation_id() - cls.line._onchange_fiscal_operation_line_id() - cls.line._onchange_fiscal_taxes() - - cls.invoice.action_invoice_open() + for line in cls.invoice.invoice_line_ids: + line.with_context( + check_move_validity=False + )._onchange_fiscal_operation_line_id() + line.with_context(check_move_validity=False)._onchange_fiscal_tax_ids() + cls.invoice.action_post() # Dado de Demonstração cls.invoice_demo_data = cls.env.ref( "l10n_br_account_nfe.demo_nfe_dados_de_cobranca" ) + cls.env.user.company_id = cls.invoice_demo_data.company_id + for line in cls.invoice_demo_data.invoice_line_ids: + line.with_context( + check_move_validity=False + )._onchange_fiscal_operation_line_id() + line.with_context(check_move_validity=False)._onchange_fiscal_tax_ids() + cls.invoice_demo_data.action_post() def test_nfe_generate_tag_pag(self): """Test NFe generate TAG PAG.""" @@ -128,7 +145,6 @@ def test_nfe_generate_tag_pag(self): self.assertEqual(detPag.nfe40_vPag, 472.5, "Error in nfe40_vPag field.") # Dados criados no dados de demonstração - self.invoice_demo_data.action_invoice_open() for detPag in self.invoice_demo_data.nfe40_detPag: self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") self.assertEqual(detPag.nfe40_tPag, "15", "Error in nfe40_tPag field.") @@ -143,16 +159,9 @@ def test_nfe_generate_tag_cobr_and_dup(self): self.assertEqual(self.invoice.nfe40_dup[0].nfe40_nDup, "001") venc = self.invoice.financial_move_line_ids[0].date_maturity self.assertEqual(self.invoice.nfe40_dup[0].nfe40_dVenc, venc) - # TODO: por algum motivo o valor da Duplicata está vindo 399.37 - # tanto nesse PR quanto no original com rebase, valores abaixo - # amount_total | amount_financial_total | amount_financial_total_gross - # 472.5 | 472.5 | 472.5 - # amount_untaxed | amount_tax | aml.debit | aml.amount_residual - # 450.0 | 22.5 | 399.37 | 399.37 - # self.assertEqual(self.invoice.nfe40_dup[0].nfe40_vDup, 472.5) + self.assertEqual(self.invoice.nfe40_dup[0].nfe40_vDup, 472.5) # Dados criados no dados de demonstração - self.invoice_demo_data.action_invoice_open() self.assertEqual(self.invoice_demo_data.nfe40_vOrig, 1000) self.assertEqual(self.invoice_demo_data.nfe40_vDesc, 0.0) self.assertEqual(self.invoice_demo_data.nfe40_vLiq, 1000) @@ -176,4 +185,4 @@ def test_payment_mode_without_fiscal_mode(self): ) self.invoice_demo_data.payment_mode_id = self.pay_mode.id with self.assertRaises(UserError): - self.invoice_demo_data.action_invoice_open() + self.invoice_demo_data.action_post() From 0d8ff3ce8c98329e5379d7010d00420379f7d03a Mon Sep 17 00:00:00 2001 From: Neto Date: Sun, 10 Jul 2022 09:39:34 -0300 Subject: [PATCH 27/91] [FIX] back default user company to main_company --- l10n_br_account_nfe/hooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py index e9d31d99a6d5..87191abacfbc 100644 --- a/l10n_br_account_nfe/hooks.py +++ b/l10n_br_account_nfe/hooks.py @@ -32,3 +32,7 @@ def load_simples_nacional_demo(env, registry): noupdate=True, kind="demo", ) + + # back to the main company as the next modules to be installed + # expect this to be the default company. + env.user.company_id = env.ref("base.main_company") From 159bb69c7bd0cc3687728670b82a6ceac6c8af2d Mon Sep 17 00:00:00 2001 From: Neto Date: Fri, 15 Jul 2022 09:10:03 -0300 Subject: [PATCH 28/91] [FIX] hook for without demo --- l10n_br_account_nfe/hooks.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py index 87191abacfbc..db1fa5ac7cf4 100644 --- a/l10n_br_account_nfe/hooks.py +++ b/l10n_br_account_nfe/hooks.py @@ -16,13 +16,14 @@ def load_simples_nacional_demo(env, registry): default user company set to this company. """ - # Allow all companies for OdooBot user and set default user company - companies = env["res.company"].search([]) - env.user.company_ids = [(6, 0, companies.ids)] - env.user.company_id = env.ref("l10n_br_base.empresa_simples_nacional") - # Load XML file with demo data. if not tools.config["without_demo"]: + + # Allow all companies for OdooBot user and set default user company + companies = env["res.company"].search([]) + env.user.company_ids = [(6, 0, companies.ids)] + env.user.company_id = env.ref("l10n_br_base.empresa_simples_nacional") + tools.convert_file( env.cr, "l10n_br_account_nfe", From e1397a76d23d5d9fe467508fb3fe3afeba4dbf62 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sun, 24 Jul 2022 14:31:45 +0000 Subject: [PATCH 29/91] [UPD] Update l10n_br_account_nfe.pot --- .../i18n/l10n_br_account_nfe.pot | 73 +++++++++++++------ 1 file changed, 49 insertions(+), 24 deletions(-) diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot index 3b957579babc..a048e4c0884a 100644 --- a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * l10n_br_account_nfe +# * l10n_br_account_nfe # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,77 +14,77 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__01 msgid "01 - Dinheiro" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__02 msgid "02 - Cheque" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__03 msgid "03 - Cartão de Crédito" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__04 msgid "04 - Cartão de Débito" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__05 msgid "05 - Crédito de Loja" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__10 msgid "10 - Vale Alimentação" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__11 msgid "11 - Vale Refeição" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__12 msgid "12 - Vale Presente" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__13 msgid "13 - Vale Combustível" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__14 msgid "14 - Duplicata Mercanti" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__15 msgid "15 - Boleto Bancário" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__16 msgid "16 - Depósito Bancário" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__17 msgid "17 - Pagamento Instantâneo (PIX)" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__18 msgid "18 - Transferência bancária, Carteira Digital" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__19 msgid "19 - Programa de fidelidade, Cashback, Crédito Virtual" msgstr "" @@ -94,12 +94,12 @@ msgid "30/60/90" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__90 msgid "90 - Sem Pagamento" msgstr "" #. module: l10n_br_account_nfe -#: selection:account.payment.mode,fiscal_payment_mode:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__99 msgid "99 - Outros" msgstr "" @@ -108,16 +108,37 @@ msgstr "" msgid "Boleto" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name +msgid "Display Name" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow msgid "Fiscal Document Workflow" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__id +msgid "ID" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_move_line msgid "Journal Item" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow____last_update +msgid "Last Modified on" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode msgid "Meio de Pagamento da NF" @@ -125,13 +146,18 @@ msgstr "" #. module: l10n_br_account_nfe #: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode -msgid "Obrigatório o preenchimento do Grupo Informações de Pagamento para NF-e e NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de Pagamento deve ser preenchido com 90 - Sem Pagamento." +msgid "" +"Obrigatório o preenchimento do Grupo Informações de Pagamento para NF-e e " +"NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de " +"Pagamento deve ser preenchido com 90 - Sem Pagamento." msgstr "" #. module: l10n_br_account_nfe -#: code:addons/l10n_br_account_nfe/models/document_workflow.py:64 +#: code:addons/l10n_br_account_nfe/models/document_workflow.py:0 #, python-format -msgid "Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal Document!" +msgid "" +"Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal " +"Document!" msgstr "" #. module: l10n_br_account_nfe @@ -143,4 +169,3 @@ msgstr "" #: model:account.payment.term,note:l10n_br_account_nfe.account_payment_term_30_60_90 msgid "Payment terms: 30/60/90" msgstr "" - From 8245366bc7189b6df577b5f7aa1fcbee8f28ba3d Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 24 Jul 2022 14:44:33 +0000 Subject: [PATCH 30/91] [UPD] README.rst --- l10n_br_account_nfe/README.rst | 10 +++++----- l10n_br_account_nfe/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/l10n_br_account_nfe/README.rst b/l10n_br_account_nfe/README.rst index 8f21d88425fe..ca11facfa16c 100644 --- a/l10n_br_account_nfe/README.rst +++ b/l10n_br_account_nfe/README.rst @@ -14,13 +14,13 @@ Account NFe/NFC-e Integration :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-brazil/tree/12.0/l10n_br_account_nfe + :target: https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_account_nfe :alt: OCA/l10n-brazil .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-l10n_br_account_nfe + :target: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/124/12.0 + :target: https://runbot.odoo-community.org/runbot/124/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -84,7 +84,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -122,6 +122,6 @@ 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. -This module is part of the `OCA/l10n-brazil `_ project on GitHub. +This module is part of the `OCA/l10n-brazil `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_account_nfe/static/description/index.html b/l10n_br_account_nfe/static/description/index.html index 4a47f66a4f7b..6636b573aeb7 100644 --- a/l10n_br_account_nfe/static/description/index.html +++ b/l10n_br_account_nfe/static/description/index.html @@ -367,7 +367,7 @@

Account NFe/NFC-e Integration

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

+

Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

Português Este módulo integra os módulos l10n_br_account e l10n_br_nfe.

    @@ -439,7 +439,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -472,7 +472,7 @@

    Maintainers

    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.

    -

    This module is part of the OCA/l10n-brazil project on GitHub.

    +

    This module is part of the OCA/l10n-brazil project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    From 2e020363fdfa645f2436ef33e91cf7e9e1188a3e Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 26 Jul 2022 15:56:05 -0300 Subject: [PATCH 31/91] [FIX] If you create NF-e without payment_mode_id --- l10n_br_account_nfe/models/document_workflow.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index 4536b2ce82a7..45a49c3b2eb6 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -38,6 +38,9 @@ def action_document_confirm(self): for record in self.filtered(filter_nfe): record.nfe40_dup = [(5,)] record.nfe40_detPag = [(5,)] + ind_pag = "0" + fiscal_payment_mode = "90" + v_pag = 0.00 if ( record.amount_financial_total and record.edoc_purpose != EDOC_PURPOSE_DEVOLUCAO @@ -57,7 +60,10 @@ def action_document_confirm(self): record.nfe40_dup = [(6, 0, duplicatas.ids)] # TAG - Pagamento - if not record.move_ids.payment_mode_id.fiscal_payment_mode: + if ( + record.invoice_ids.payment_mode_id + and not record.invoice_ids.payment_mode_id.fiscal_payment_mode + ): raise UserError( _( "Payment Mode {} should has Fiscal Payment Mode" @@ -75,10 +81,6 @@ def action_document_confirm(self): record.move_ids.payment_mode_id.fiscal_payment_mode ) v_pag = record.amount_financial_total - else: - ind_pag = "0" - fiscal_payment_mode = "90" - v_pag = 0.00 pagamentos = record.env["nfe.40.detpag"].create( { From 033797f8206ac06d8f9845f8056e59854f85b09f Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 28 Jul 2022 21:57:10 +0000 Subject: [PATCH 32/91] Added translation using Weblate (Portuguese (Brazil)) --- l10n_br_account_nfe/i18n/pt_BR.po | 172 ++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 l10n_br_account_nfe/i18n/pt_BR.po diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po new file mode 100644 index 000000000000..476057a54b0e --- /dev/null +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -0,0 +1,172 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_br_account_nfe +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__01 +msgid "01 - Dinheiro" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__02 +msgid "02 - Cheque" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__03 +msgid "03 - Cartão de Crédito" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__04 +msgid "04 - Cartão de Débito" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__05 +msgid "05 - Crédito de Loja" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__10 +msgid "10 - Vale Alimentação" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__11 +msgid "11 - Vale Refeição" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__12 +msgid "12 - Vale Presente" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__13 +msgid "13 - Vale Combustível" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__14 +msgid "14 - Duplicata Mercanti" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__15 +msgid "15 - Boleto Bancário" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__16 +msgid "16 - Depósito Bancário" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__17 +msgid "17 - Pagamento Instantâneo (PIX)" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__18 +msgid "18 - Transferência bancária, Carteira Digital" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__19 +msgid "19 - Programa de fidelidade, Cashback, Crédito Virtual" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.term,name:l10n_br_account_nfe.account_payment_term_30_60_90 +msgid "30/60/90" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__90 +msgid "90 - Sem Pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__99 +msgid "99 - Outros" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.mode,name:l10n_br_account_nfe.demo_payment_mode_boleto +msgid "Boleto" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow +msgid "Fiscal Document Workflow" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__id +msgid "ID" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode +msgid "Meio de Pagamento da NF" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode +msgid "" +"Obrigatório o preenchimento do Grupo Informações de Pagamento para NF-e e " +"NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de " +"Pagamento deve ser preenchido com 90 - Sem Pagamento." +msgstr "" + +#. module: l10n_br_account_nfe +#: code:addons/l10n_br_account_nfe/models/document_workflow.py:0 +#, python-format +msgid "" +"Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal " +"Document!" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_account_payment_mode +msgid "Payment Modes" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:account.payment.term,note:l10n_br_account_nfe.account_payment_term_30_60_90 +msgid "Payment terms: 30/60/90" +msgstr "" From e9a4e20a5cd2aac3265f0a28f36a802d52302c24 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 28 Jul 2022 22:10:04 +0000 Subject: [PATCH 33/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 93.1% (27 of 29 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/pt_BR/ --- l10n_br_account_nfe/i18n/pt_BR.po | 59 +++++++++++++++++-------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index 476057a54b0e..c092532d5f8d 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -6,115 +6,117 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-07-28 22:10+0000\n" +"Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__01 msgid "01 - Dinheiro" -msgstr "" +msgstr "01 - Dinheiro" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__02 msgid "02 - Cheque" -msgstr "" +msgstr "02 - Cheque" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__03 msgid "03 - Cartão de Crédito" -msgstr "" +msgstr "03 - Cartão de Crédito" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__04 msgid "04 - Cartão de Débito" -msgstr "" +msgstr "04 - Cartão de Débito" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__05 msgid "05 - Crédito de Loja" -msgstr "" +msgstr "05 - Crédito de Loja" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__10 msgid "10 - Vale Alimentação" -msgstr "" +msgstr "10 - Vale Alimentação" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__11 msgid "11 - Vale Refeição" -msgstr "" +msgstr "11 - Vale Refeição" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__12 msgid "12 - Vale Presente" -msgstr "" +msgstr "12 - Vale Presente" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__13 msgid "13 - Vale Combustível" -msgstr "" +msgstr "13 - Vale Combustível" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__14 msgid "14 - Duplicata Mercanti" -msgstr "" +msgstr "14 - Duplicata Mercanti" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__15 msgid "15 - Boleto Bancário" -msgstr "" +msgstr "15 - Boleto Bancário" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__16 msgid "16 - Depósito Bancário" -msgstr "" +msgstr "16 - Depósito Bancário" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__17 msgid "17 - Pagamento Instantâneo (PIX)" -msgstr "" +msgstr "17 - Pagamento Instantâneo (PIX)" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__18 msgid "18 - Transferência bancária, Carteira Digital" -msgstr "" +msgstr "18 - Transferência bancária, Carteira Digital" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__19 msgid "19 - Programa de fidelidade, Cashback, Crédito Virtual" -msgstr "" +msgstr "19 - Programa de fidelidade, Cashback, Crédito Virtual" #. module: l10n_br_account_nfe #: model:account.payment.term,name:l10n_br_account_nfe.account_payment_term_30_60_90 msgid "30/60/90" -msgstr "" +msgstr "30/60/90" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__90 msgid "90 - Sem Pagamento" -msgstr "" +msgstr "90 - Sem Pagamento" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__99 msgid "99 - Outros" -msgstr "" +msgstr "99 - Outros" #. module: l10n_br_account_nfe #: model:account.payment.mode,name:l10n_br_account_nfe.demo_payment_mode_boleto msgid "Boleto" -msgstr "" +msgstr "Boleto" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__display_name #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name msgid "Display Name" -msgstr "" +msgstr "Nome de Exibição" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow @@ -126,24 +128,24 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__id #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__id msgid "ID" -msgstr "" +msgstr "ID" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_move_line msgid "Journal Item" -msgstr "" +msgstr "Item de Diário" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line____last_update #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode____last_update #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow____last_update msgid "Last Modified on" -msgstr "" +msgstr "Última Modificação em" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode msgid "Meio de Pagamento da NF" -msgstr "" +msgstr "Meio de Pagamento da NF" #. module: l10n_br_account_nfe #: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment_mode__fiscal_payment_mode @@ -152,6 +154,9 @@ msgid "" "NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de " "Pagamento deve ser preenchido com 90 - Sem Pagamento." msgstr "" +"Obrigatório o preenchimento do Grupo Informações de Pagamento para NF-e e " +"NFC-e. Para as notas com finalidade de Ajuste ou Devolução o campo Forma de " +"Pagamento deve ser preenchido com 90 - Sem Pagamento." #. module: l10n_br_account_nfe #: code:addons/l10n_br_account_nfe/models/document_workflow.py:0 @@ -164,9 +169,9 @@ msgstr "" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_payment_mode msgid "Payment Modes" -msgstr "" +msgstr "Modos de Pagamento" #. module: l10n_br_account_nfe #: model:account.payment.term,note:l10n_br_account_nfe.account_payment_term_30_60_90 msgid "Payment terms: 30/60/90" -msgstr "" +msgstr "Condição de pagamento: 30/60/90" From 621d6d0e0eb4ecb0f443cae7af023c75197b395d Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Tue, 26 Jul 2022 16:14:44 -0300 Subject: [PATCH 34/91] =?UTF-8?q?[FIX]=20Nas=20NF-es=20de=20devolu=C3=A7?= =?UTF-8?q?=C3=A3o=20ou=20ajustem=20devem=20ir=20com=20pagamento=2090?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- l10n_br_account_nfe/models/document_workflow.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index 45a49c3b2eb6..e761053e217b 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -10,6 +10,7 @@ from odoo.addons.l10n_br_fiscal.constants.fiscal import ( DOCUMENT_ISSUER_COMPANY, + EDOC_PURPOSE_AJUSTE, EDOC_PURPOSE_DEVOLUCAO, MODELO_FISCAL_NFCE, MODELO_FISCAL_NFE, @@ -41,9 +42,9 @@ def action_document_confirm(self): ind_pag = "0" fiscal_payment_mode = "90" v_pag = 0.00 - if ( - record.amount_financial_total - and record.edoc_purpose != EDOC_PURPOSE_DEVOLUCAO + if record.amount_financial_total and record.edoc_purpose not in ( + EDOC_PURPOSE_DEVOLUCAO, + EDOC_PURPOSE_AJUSTE, ): # TAG - Cobrança duplicatas = record.env["nfe.40.dup"] @@ -61,8 +62,8 @@ def action_document_confirm(self): # TAG - Pagamento if ( - record.invoice_ids.payment_mode_id - and not record.invoice_ids.payment_mode_id.fiscal_payment_mode + record.move_ids.payment_mode_id + and not record.move_ids.payment_mode_id.fiscal_payment_mode ): raise UserError( _( From e6d61fda08dfe73e786d7066ed8c2e12d31c7a6d Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 29 Jul 2022 20:29:53 +0000 Subject: [PATCH 35/91] l10n_br_account_nfe 14.0.1.1.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index c1c5e714f05a..d79e44396490 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.0.0", + "version": "14.0.1.1.0", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From e7a168b5c8b7b67100c45268c7d634de45a0d6e8 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Mon, 29 Aug 2022 09:43:59 -0300 Subject: [PATCH 36/91] [ADD] NFC-e constant [MOV] FISCAL_PAYMENT_MODE Signed-off-by: Luis Felipe Mileo --- .../models/account_payment_mode.py | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/l10n_br_account_nfe/models/account_payment_mode.py b/l10n_br_account_nfe/models/account_payment_mode.py index 343832abcc87..d7e547992ca8 100644 --- a/l10n_br_account_nfe/models/account_payment_mode.py +++ b/l10n_br_account_nfe/models/account_payment_mode.py @@ -7,30 +7,14 @@ from odoo import fields, models +from odoo.addons.l10n_br_fiscal.constants.fiscal import FISCAL_PAYMENT_MODE + class AccountPaymentMode(models.Model): _inherit = "account.payment.mode" fiscal_payment_mode = fields.Selection( - selection=[ - ("01", "01 - Dinheiro"), - ("02", "02 - Cheque"), - ("03", "03 - Cartão de Crédito"), - ("04", "04 - Cartão de Débito"), - ("05", "05 - Crédito de Loja"), - ("10", "10 - Vale Alimentação"), - ("11", "11 - Vale Refeição"), - ("12", "12 - Vale Presente"), - ("13", "13 - Vale Combustível"), - ("14", "14 - Duplicata Mercanti"), - ("15", "15 - Boleto Bancário"), - ("16", "16 - Depósito Bancário"), - ("17", "17 - Pagamento Instantâneo (PIX)"), - ("18", "18 - Transferência bancária, Carteira Digital"), - ("19", "19 - Programa de fidelidade, Cashback, Crédito Virtual"), - ("90", "90 - Sem Pagamento"), - ("99", "99 - Outros"), - ], + selection=FISCAL_PAYMENT_MODE, string="Meio de Pagamento da NF", help="Obrigatório o preenchimento do Grupo Informações de Pagamento" " para NF-e e NFC-e. Para as notas com finalidade de Ajuste" From b7aaf739aba512296a6c3c184ea36c8f71aa0e13 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 29 Aug 2022 13:13:49 +0000 Subject: [PATCH 37/91] l10n_br_account_nfe 14.0.1.1.1 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index d79e44396490..7e8415856d02 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.1.0", + "version": "14.0.1.1.1", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From f4b9b422cbd826ce697ce440ed9516e079d95497 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 3 Sep 2022 19:21:36 -0300 Subject: [PATCH 38/91] [FIX] l10n_br_account_nfe: create invoice from form on unit test --- .../test_nfe_generate_tags_cobr_dup_pag.py | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index 9f04ac1b0529..32a17d399958 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -6,7 +6,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.exceptions import UserError -from odoo.tests import SavepointCase, tagged +from odoo.tests import Form, SavepointCase, tagged @tagged("post_install", "-at_install") @@ -79,49 +79,55 @@ def setUpClass(cls): } ) - cls.invoice = cls.env["account.move"].create( + cls.fiscal_operation_id = cls.env.ref("l10n_br_fiscal.fo_venda") + cls.fiscal_operation_id.deductible_taxes = True + + move_form = Form( + cls.env["account.move"] + .with_company(cls.company) + .with_context(default_move_type="out_invoice") + ) + move_form.partner_id = cls.env.ref("l10n_br_base.res_partner_cliente1_sp") + move_form.document_type_id = cls.env.ref("l10n_br_fiscal.document_55") + move_form.fiscal_operation_id = cls.fiscal_operation_id + invoice_vals = move_form._values_to_save(all_fields=True) + invoice_vals.update( { - "move_type": "out_invoice", "company_id": cls.company.id, - "partner_id": cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id, + "currency_id": cls.company.currency_id.id, "payment_mode_id": cls.payment_mode.id, - "document_type_id": cls.env.ref("l10n_br_fiscal.document_55").id, - "fiscal_operation_id": cls.env.ref("l10n_br_fiscal.fo_venda").id, "document_serie_id": cls.env.ref( "l10n_br_fiscal.empresa_lc_document_55_serie_1" ).id, "journal_id": cls.invoice_journal.id, "invoice_payment_term_id": cls.payment_term.id, - "invoice_line_ids": [ - ( - 0, - 0, - { - "product_id": cls.env.ref("product.product_product_3").id, - "quantity": 1, - "price_unit": 450.0, - "name": "Product - Invoice Line Test", - "fiscal_operation_id": cls.env.ref( - "l10n_br_fiscal.fo_venda" - ).id, - "fiscal_operation_line_id": cls.env.ref( - "l10n_br_fiscal.fo_venda_venda" - ).id, - "account_id": cls.invoice_line_account_id.id, - "company_id": cls.company.id, - "partner_id": cls.env.ref( - "l10n_br_base.res_partner_cliente1_sp" - ).id, - }, - ) - ], + "invoice_origin": "Teste l10n_br_account_nfe", + "invoice_user_id": cls.env.user.id, } ) - for line in cls.invoice.invoice_line_ids: - line.with_context( - check_move_validity=False - )._onchange_fiscal_operation_line_id() - line.with_context(check_move_validity=False)._onchange_fiscal_tax_ids() + + line_form = move_form.invoice_line_ids.new() + line_form.product_id = cls.env.ref("product.product_product_7") + line_form.fiscal_operation_id = cls.fiscal_operation_id + invoice_line_vals = line_form._values_to_save(all_fields=True) + invoice_line_vals.update( + { + "account_id": cls.invoice_line_account_id.id, + "quantity": 1, + "price_unit": 450.0, + "name": "Product - Invoice Line Test", + "fiscal_operation_line_id": cls.env.ref( + "l10n_br_fiscal.fo_venda_revenda" + ).id, + "company_id": cls.company.id, + "partner_id": cls.env.ref("l10n_br_base.res_partner_cliente1_sp").id, + } + ) + + invoice_vals["invoice_line_ids"].append((0, 0, invoice_line_vals)) + del invoice_vals["line_ids"] + cls.invoice = cls.env["account.move"].create(invoice_vals) + cls.invoice.invoice_line_ids._onchange_fiscal_tax_ids() cls.invoice.action_post() # Dado de Demonstração @@ -142,7 +148,7 @@ def test_nfe_generate_tag_pag(self): for detPag in self.invoice.nfe40_detPag: self.assertEqual(detPag.nfe40_indPag, "1", "Error in nfe40_indPag field.") self.assertEqual(detPag.nfe40_tPag, "18", "Error in nfe40_tPag field.") - self.assertEqual(detPag.nfe40_vPag, 472.5, "Error in nfe40_vPag field.") + self.assertEqual(detPag.nfe40_vPag, 450.0, "Error in nfe40_vPag field.") # Dados criados no dados de demonstração for detPag in self.invoice_demo_data.nfe40_detPag: @@ -153,13 +159,13 @@ def test_nfe_generate_tag_pag(self): def test_nfe_generate_tag_cobr_and_dup(self): """Test NFe generate TAG COBR e DUP.""" # Dados criados no teste - self.assertEqual(self.invoice.nfe40_vOrig, 472.5) + self.assertEqual(self.invoice.nfe40_vOrig, 450.0) self.assertEqual(self.invoice.nfe40_vDesc, 0.0) - self.assertEqual(self.invoice.nfe40_vLiq, 472.5) + self.assertEqual(self.invoice.nfe40_vLiq, 450.0) self.assertEqual(self.invoice.nfe40_dup[0].nfe40_nDup, "001") venc = self.invoice.financial_move_line_ids[0].date_maturity self.assertEqual(self.invoice.nfe40_dup[0].nfe40_dVenc, venc) - self.assertEqual(self.invoice.nfe40_dup[0].nfe40_vDup, 472.5) + self.assertEqual(self.invoice.nfe40_dup[0].nfe40_vDup, 450.0) # Dados criados no dados de demonstração self.assertEqual(self.invoice_demo_data.nfe40_vOrig, 1000) From c58436b2759ca8265f04ba0597faff9534209652 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 4 Sep 2022 05:50:57 +0000 Subject: [PATCH 39/91] l10n_br_account_nfe 14.0.1.1.2 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 7e8415856d02..a0c3451cfed4 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.1.1", + "version": "14.0.1.1.2", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From 078653150ff08b216d2e1f7d1dd95eb74be7ca97 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 5 Sep 2022 18:01:19 -0300 Subject: [PATCH 40/91] [FIX+IMP] l10n_br_account_nfe: In the Demo Data need to run onchanges methods to get Taxes values, included Test to case when Invoice don't has Payment Mode. --- .../demo/account_invoice_sn_demo.xml | 35 +++++++++++++++++++ l10n_br_account_nfe/hooks.py | 14 ++++++++ .../test_nfe_generate_tags_cobr_dup_pag.py | 16 +++++++++ 3 files changed, 65 insertions(+) diff --git a/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml index 298b6eb95639..33cdbf08aee7 100644 --- a/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml +++ b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml @@ -77,4 +77,39 @@ })]" /> + + + + Teste NFe Sem Dados de Cobrança + + + + out_invoice + + + + + 1 + out + + + diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py index db1fa5ac7cf4..a02511b90b52 100644 --- a/l10n_br_account_nfe/hooks.py +++ b/l10n_br_account_nfe/hooks.py @@ -34,6 +34,20 @@ def load_simples_nacional_demo(env, registry): kind="demo", ) + # É necessário rodar os onchanges fiscais para + # preencher os campos referentes aos Impostos + invoice_tag_cobranca = env.ref("l10n_br_account_nfe.demo_nfe_dados_de_cobranca") + for line in invoice_tag_cobranca.invoice_line_ids: + line._onchange_fiscal_operation_line_id() + line._onchange_fiscal_tax_ids() + + invoice_sem_tag_cobranca = env.ref( + "l10n_br_account_nfe.demo_nfe_sem_dados_de_cobranca" + ) + for line in invoice_sem_tag_cobranca.invoice_line_ids: + line._onchange_fiscal_operation_line_id() + line._onchange_fiscal_tax_ids() + # back to the main company as the next modules to be installed # expect this to be the default company. env.user.company_id = env.ref("base.main_company") diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index 32a17d399958..ef2462731805 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -128,6 +128,7 @@ def setUpClass(cls): del invoice_vals["line_ids"] cls.invoice = cls.env["account.move"].create(invoice_vals) cls.invoice.invoice_line_ids._onchange_fiscal_tax_ids() + cls.invoice.invoice_line_ids._onchange_fiscal_operation_line_id() cls.invoice.action_post() # Dado de Demonstração @@ -192,3 +193,18 @@ def test_payment_mode_without_fiscal_mode(self): self.invoice_demo_data.payment_mode_id = self.pay_mode.id with self.assertRaises(UserError): self.invoice_demo_data.action_post() + + def test_invoice_without_payment_mode(self): + """Test Invoice without Payment Mode.""" + invoice = self.env.ref("l10n_br_account_nfe.demo_nfe_sem_dados_de_cobranca") + invoice.action_post() + self.assertFalse( + invoice.nfe40_dup, + "Error field nfe40_dup should not filled when Fiscal Operation are Bonificação.", + ) + for detPag in invoice.nfe40_detPag: + self.assertEqual( + detPag.nfe40_tPag, + "90", + "Error in nfe40_tPag field, should be 90 - Sem Pagamento.", + ) From e5e1828eef4ea16a15d0009e83e9e14aeaa2ff65 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 6 Sep 2022 13:40:50 +0000 Subject: [PATCH 41/91] l10n_br_account_nfe 14.0.1.2.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index a0c3451cfed4..db9a08d4eada 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.1.2", + "version": "14.0.1.2.0", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From b047c65d13d237b8f4771d1e44b4d145e65e0996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Douglas=20Cust=C3=B3dio?= Date: Fri, 16 Sep 2022 20:30:01 +0000 Subject: [PATCH 42/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 93.1% (27 of 29 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/pt_BR/ --- l10n_br_account_nfe/i18n/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index c092532d5f8d..2d0744785016 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-07-28 22:10+0000\n" -"Last-Translator: Marcel Savegnago \n" +"PO-Revision-Date: 2022-09-16 22:07+0000\n" +"Last-Translator: Douglas Custódio \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" @@ -116,7 +116,7 @@ msgstr "Boleto" #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name msgid "Display Name" -msgstr "Nome de Exibição" +msgstr "Nome Exibido" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow From 1176246886b05bb139a91494c67f53cac3598aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Fri, 21 Oct 2022 08:53:05 -0300 Subject: [PATCH 43/91] [REF] str-format-used l10n_br_account_nfe --- l10n_br_account_nfe/models/document_workflow.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index e761053e217b..acccc7cd5f64 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -68,10 +68,8 @@ def action_document_confirm(self): raise UserError( _( "Payment Mode {} should has Fiscal Payment Mode" - " filled to be used in Fiscal Document!".format( - record.move_ids.payment_mode_id.name - ) - ) + " filled to be used in Fiscal Document!" + ).format(record.move_ids.payment_mode_id.name) ) moves_terms = record.move_ids.financial_move_line_ids.filtered( From 90c6fdf153aea5479979eccfb9cb664b2d354bb0 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 22 Oct 2022 11:09:34 +0000 Subject: [PATCH 44/91] l10n_br_account_nfe 14.0.1.2.1 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index db9a08d4eada..9d6b1832301d 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.2.0", + "version": "14.0.1.2.1", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From a1c8f87794b6993d1eb0b1b3198920749a1ac8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Felipe=20Mil=C3=A9o?= Date: Sat, 22 Oct 2022 09:08:54 -0300 Subject: [PATCH 45/91] [REF] missing-return l10n_br_account_nfe --- l10n_br_account_nfe/models/document_workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py index acccc7cd5f64..25780c7a15d1 100644 --- a/l10n_br_account_nfe/models/document_workflow.py +++ b/l10n_br_account_nfe/models/document_workflow.py @@ -91,4 +91,4 @@ def action_document_confirm(self): record.nfe40_detPag = [(6, 0, pagamentos.ids)] - super().action_document_confirm() + return super().action_document_confirm() From 38636d88076e6b76346c8f3e7e95564d3bbc7ff6 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 22 Oct 2022 15:27:55 +0000 Subject: [PATCH 46/91] l10n_br_account_nfe 14.0.1.2.2 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 9d6b1832301d..5f101c163000 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -12,7 +12,7 @@ "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.2.1", + "version": "14.0.1.2.2", "development_status": "Alpha", "depends": [ "l10n_br_nfe", From 809fec1c75db8a2c6450caf349e530eb12d9c3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Neto?= Date: Mon, 26 Dec 2022 10:28:47 -0300 Subject: [PATCH 47/91] [REF] l10n_br_account_nfe: create tags in compute methods --- l10n_br_account_nfe/__manifest__.py | 3 +- l10n_br_account_nfe/models/__init__.py | 3 +- l10n_br_account_nfe/models/document.py | 152 ++++++++++++++++++ .../models/document_workflow.py | 94 ----------- l10n_br_account_nfe/models/leiauteNFe.py | 19 +++ 5 files changed, 175 insertions(+), 96 deletions(-) create mode 100644 l10n_br_account_nfe/models/document.py delete mode 100644 l10n_br_account_nfe/models/document_workflow.py create mode 100644 l10n_br_account_nfe/models/leiauteNFe.py diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 5f101c163000..d2059f8fa5e5 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -11,9 +11,10 @@ "category": "Localisation", "license": "AGPL-3", "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", + "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", "version": "14.0.1.2.2", - "development_status": "Alpha", + "development_status": "Beta", "depends": [ "l10n_br_nfe", "l10n_br_account", diff --git a/l10n_br_account_nfe/models/__init__.py b/l10n_br_account_nfe/models/__init__.py index b1ebe5fd2e5a..b0e09929a8b1 100644 --- a/l10n_br_account_nfe/models/__init__.py +++ b/l10n_br_account_nfe/models/__init__.py @@ -1,3 +1,4 @@ from . import account_payment_mode from . import account_move_line -from . import document_workflow +from . import document +from . import leiauteNFe diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py new file mode 100644 index 000000000000..6ee9cb3cb4f3 --- /dev/null +++ b/l10n_br_account_nfe/models/document.py @@ -0,0 +1,152 @@ +# Copyright (C) 2022-Today - Engenere (). +# @author Antônio S. Pereira Neto +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + +from odoo.addons.l10n_br_fiscal.constants.fiscal import ( + EDOC_PURPOSE_AJUSTE, + EDOC_PURPOSE_DEVOLUCAO, +) + +A_PRAZO = "1" +A_VISTA = "0" +SEM_PAGAMENTO = "90" +NFE_IN = "0" +NFE_OUT = "1" + + +class DocumentNfe(models.Model): + + _inherit = "l10n_br_fiscal.document" + + ########################## + # NF-e tag: Cob + ########################## + + nfe40_dup = fields.One2many( + comodel_name="nfe.40.dup", + compute="_compute_nfe40_dup", + store=True, + readonly=False, + ) + + ########################## + # NF-e tag: dup + # Compute Methods + ########################## + + @api.depends("move_ids", "move_ids.financial_move_line_ids") + def _compute_nfe40_dup(self): + for record in self.filtered(lambda x: x._need_compute_nfe40_dup()): + dups_vals = [] + for count, mov in enumerate(record.move_ids.financial_move_line_ids, 1): + dups_vals.append( + { + "nfe40_nDup": str(count).zfill(3), + "nfe40_dVenc": mov.date_maturity, + "nfe40_vDup": mov.debit, + } + ) + record.nfe40_dup = [(2, dup, 0) for dup in record.nfe40_dup.ids] + record.nfe40_dup = [(0, 0, dup) for dup in dups_vals] + + ########################## + # NF-e tag: Pag + ########################## + + nfe40_detPag = fields.One2many( + comodel_name="nfe.40.detpag", + compute="_compute_nfe40_detpag", + store=True, + readonly=False, + ) + + ########################## + # NF-e tag: detPag + # Compute Methods + ########################## + + @api.depends( + "issuer", + "move_ids", + "move_ids.payment_mode_id", + "move_ids.payment_mode_id.fiscal_payment_mode", + "amount_financial_total", + "nfe40_tpNF", + ) + def _compute_nfe40_detpag(self): + for rec in self.filtered(lambda x: x._need_compute_nfe_tags()): + if rec._is_without_payment(): + det_pag_vals = { + "nfe40_indPag": A_VISTA, + "nfe40_tPag": SEM_PAGAMENTO, + "nfe40_vPag": 0.00, + } + else: + # TODO pode haver pagamento que uma parte é a vista + # e outra a prazo, dividir em dois detPag nestes casos. + det_pag_vals = { + "nfe40_indPag": A_PRAZO if rec._is_installment() > 0 else A_VISTA, + "nfe40_tPag": rec.move_ids.payment_mode_id.fiscal_payment_mode + or "", + "nfe40_vPag": rec.amount_financial_total, + } + rec.nfe40_detPag = [(2, detpag, 0) for detpag in rec.nfe40_detPag.ids] + rec.nfe40_detPag = [(0, 0, det_pag_vals)] + + ################################ + # Business Model Methods + ################################ + + def _is_installment(self): + """checks if the payment is in cash (á vista) or in installments (a prazo)""" + self.ensure_one() + self.move_ids.financial_move_line_ids.mapped("date_maturity") + moves_terms = self.move_ids.financial_move_line_ids.filtered( + lambda move_line: move_line.date_maturity > move_line.date + ) + return True if len(moves_terms) > 0 else False + + def _need_compute_nfe40_dup(self): + if ( + self._need_compute_nfe_tags() + and self.amount_financial_total > 0 + and self.nfe40_tpNF == NFE_OUT + ): + return True + else: + return False + + def _is_without_payment(self): + if self.edoc_purpose in (EDOC_PURPOSE_DEVOLUCAO, EDOC_PURPOSE_AJUSTE): + return True + if not self.amount_financial_total: + return True + if self.nfe40_tpNF == NFE_IN: + return True + else: + return False + + @api.constrains("nfe40_detPag", "state_edoc") + def _check_fiscal_payment_mode(self): + for rec in self: + + if ( + rec.state_edoc == "em_digitacao" + or not rec._need_compute_nfe_tags() + or rec._is_without_payment() + ): + continue + + if not rec.move_ids.payment_mode_id: + raise UserError(_("Payment Mode cannot be empty for this NF-e/NFC-e")) + if not rec.move_ids.payment_mode_id.fiscal_payment_mode: + raise UserError( + _( + f"Payment Mode {rec.move_ids.payment_mode_id.name} should has " + "has Fiscal Payment Mode filled to be used in Fiscal Document!" + ) + ) diff --git a/l10n_br_account_nfe/models/document_workflow.py b/l10n_br_account_nfe/models/document_workflow.py deleted file mode 100644 index 25780c7a15d1..000000000000 --- a/l10n_br_account_nfe/models/document_workflow.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (C) 2022-Today - Engenere (). -# @author Antônio S. Pereira Neto -# @author Felipe Motter Pereira -# Copyright (C) 2022-Today - Akretion (). -# @author Magno Costa -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import _, models -from odoo.exceptions import UserError - -from odoo.addons.l10n_br_fiscal.constants.fiscal import ( - DOCUMENT_ISSUER_COMPANY, - EDOC_PURPOSE_AJUSTE, - EDOC_PURPOSE_DEVOLUCAO, - MODELO_FISCAL_NFCE, - MODELO_FISCAL_NFE, - PROCESSADOR_OCA, -) - - -def filter_nfe(record): - if ( - record.processador_edoc == PROCESSADOR_OCA - and record.document_type_id.code - in [ - MODELO_FISCAL_NFE, - MODELO_FISCAL_NFCE, - ] - and record.issuer == DOCUMENT_ISSUER_COMPANY - ): - return True - return False - - -class DocumentWorkflow(models.AbstractModel): - _inherit = "l10n_br_fiscal.document.workflow" - - def action_document_confirm(self): - for record in self.filtered(filter_nfe): - record.nfe40_dup = [(5,)] - record.nfe40_detPag = [(5,)] - ind_pag = "0" - fiscal_payment_mode = "90" - v_pag = 0.00 - if record.amount_financial_total and record.edoc_purpose not in ( - EDOC_PURPOSE_DEVOLUCAO, - EDOC_PURPOSE_AJUSTE, - ): - # TAG - Cobrança - duplicatas = record.env["nfe.40.dup"] - count = 1 - for mov in record.move_ids.financial_move_line_ids: - duplicatas += duplicatas.create( - { - "nfe40_nDup": str(count).zfill(3), - "nfe40_dVenc": mov.date_maturity, - "nfe40_vDup": mov.debit, - } - ) - count += 1 - record.nfe40_dup = [(6, 0, duplicatas.ids)] - - # TAG - Pagamento - if ( - record.move_ids.payment_mode_id - and not record.move_ids.payment_mode_id.fiscal_payment_mode - ): - raise UserError( - _( - "Payment Mode {} should has Fiscal Payment Mode" - " filled to be used in Fiscal Document!" - ).format(record.move_ids.payment_mode_id.name) - ) - - moves_terms = record.move_ids.financial_move_line_ids.filtered( - lambda move_line: move_line.date_maturity > move_line.date - ) - ind_pag = "1" if len(moves_terms) > 0 else "0" - fiscal_payment_mode = ( - record.move_ids.payment_mode_id.fiscal_payment_mode - ) - v_pag = record.amount_financial_total - - pagamentos = record.env["nfe.40.detpag"].create( - { - "nfe40_indPag": ind_pag, - "nfe40_tPag": fiscal_payment_mode, - "nfe40_vPag": v_pag, - } - ) - - record.nfe40_detPag = [(6, 0, pagamentos.ids)] - - return super().action_document_confirm() diff --git a/l10n_br_account_nfe/models/leiauteNFe.py b/l10n_br_account_nfe/models/leiauteNFe.py new file mode 100644 index 000000000000..6e219856c60b --- /dev/null +++ b/l10n_br_account_nfe/models/leiauteNFe.py @@ -0,0 +1,19 @@ +from odoo import fields, models + +# TODO Temporary fixes +# Check if it is possible to make the lib that generates the odoo mixins (nfelib) +# apply these changes. + + +class DetPag(models.AbstractModel): + + _inherit = "nfe.40.detpag" + + nfe40_indPag = fields.Selection( + selection=[ + ("0", "Pagamento à Vista"), + ("1", "Pagamento à Prazo"), + ], + string="Forma de Pagamento", + help="Indicador da Forma de Pagamento", + ) From b223414b29edf6cb83f6007f78f56f36008c2e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Neto?= Date: Mon, 26 Dec 2022 10:29:53 -0300 Subject: [PATCH 48/91] [FIX] l10n_br_account_nfe: remove dependency to l10n_br_coa_simple --- l10n_br_account_nfe/demo/account_invoice_sn_demo.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml index 33cdbf08aee7..ce4e36f554b2 100644 --- a/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml +++ b/l10n_br_account_nfe/demo/account_invoice_sn_demo.xml @@ -46,7 +46,6 @@ Teste NFe Dados de Cobrança - @@ -82,7 +81,6 @@ Teste NFe Sem Dados de Cobrança - out_invoice From aebb3095cb492d8199bfb4e36df7e20eddf2a5fc Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 27 Dec 2022 18:50:43 +0000 Subject: [PATCH 49/91] [UPD] Update l10n_br_account_nfe.pot --- .../i18n/l10n_br_account_nfe.pot | 60 ++++++++++++++++--- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot index a048e4c0884a..3b477d501809 100644 --- a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -108,25 +108,58 @@ msgstr "" msgid "Boleto" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_dup +msgid "Dados das duplicatas NT 2011/004" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__display_name #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__display_name msgid "Display Name" msgstr "" #. module: l10n_br_account_nfe -#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow -msgid "Fiscal Document Workflow" +#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document +msgid "Fiscal Document" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__nfe40_indPag +msgid "Forma de Pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag +msgid "Grupo de detalhamento da forma de pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_nfe_40_detpag +msgid "Grupo de detalhamento da forma de pagamento." msgstr "" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__id #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__id -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__id msgid "ID" msgstr "" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,help:l10n_br_account_nfe.field_nfe_40_detpag__nfe40_indPag +msgid "Indicador da Forma de Pagamento" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_move_line msgid "Journal Item" @@ -135,7 +168,8 @@ msgstr "" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line____last_update #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode____last_update -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag____last_update msgid "Last Modified on" msgstr "" @@ -153,11 +187,19 @@ msgid "" msgstr "" #. module: l10n_br_account_nfe -#: code:addons/l10n_br_account_nfe/models/document_workflow.py:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__nfe_40_detpag__nfe40_indPag__1 +msgid "Pagamento à Prazo" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__nfe_40_detpag__nfe40_indPag__0 +msgid "Pagamento à Vista" +msgstr "" + +#. module: l10n_br_account_nfe +#: code:addons/l10n_br_account_nfe/models/document.py:0 #, python-format -msgid "" -"Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal " -"Document!" +msgid "Payment Mode cannot be empty for this NF-e/NFC-e" msgstr "" #. module: l10n_br_account_nfe From a3571e000bed799acc935d67f6ed4cd27aa11db3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 27 Dec 2022 19:03:52 +0000 Subject: [PATCH 50/91] [UPD] README.rst --- l10n_br_account_nfe/README.rst | 23 +++++++++++++------ .../static/description/index.html | 10 +++----- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/l10n_br_account_nfe/README.rst b/l10n_br_account_nfe/README.rst index ca11facfa16c..3ef6b1045cb4 100644 --- a/l10n_br_account_nfe/README.rst +++ b/l10n_br_account_nfe/README.rst @@ -7,9 +7,9 @@ Account NFe/NFC-e Integration !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status - :alt: Alpha + :alt: Beta .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 @@ -35,11 +35,6 @@ This module integrates the l10n_br_account and l10n_br_nfe modules. * Adding Payment Information and Invoice Duplicates, TAGs cobr, pag and dup of NF-e/NFC-e. -.. IMPORTANT:: - This is an alpha version, the data model and design can change at any time without warning. - Only for development or testing purpose, do not use in production. - `More details on development status `_ - **Table of contents** .. contents:: @@ -122,6 +117,20 @@ 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. +.. |maintainer-antoniospneto| image:: https://github.com/antoniospneto.png?size=40px + :target: https://github.com/antoniospneto + :alt: antoniospneto +.. |maintainer-felipemotter| image:: https://github.com/felipemotter.png?size=40px + :target: https://github.com/felipemotter + :alt: felipemotter +.. |maintainer-mbcosta| image:: https://github.com/mbcosta.png?size=40px + :target: https://github.com/mbcosta + :alt: mbcosta + +Current `maintainers `__: + +|maintainer-antoniospneto| |maintainer-felipemotter| |maintainer-mbcosta| + This module is part of the `OCA/l10n-brazil `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_br_account_nfe/static/description/index.html b/l10n_br_account_nfe/static/description/index.html index 6636b573aeb7..d22e503d3c42 100644 --- a/l10n_br_account_nfe/static/description/index.html +++ b/l10n_br_account_nfe/static/description/index.html @@ -367,7 +367,7 @@

    Account NFe/NFC-e Integration

    !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

    +

    Beta License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runbot

    Português Este módulo integra os módulos l10n_br_account e l10n_br_nfe.

      @@ -378,12 +378,6 @@

      Account NFe/NFC-e Integration

      • Adding Payment Information and Invoice Duplicates, TAGs cobr, pag and dup of NF-e/NFC-e.
      -
      -

      Important

      -

      This is an alpha version, the data model and design can change at any time without warning. -Only for development or testing purpose, do not use in production. -More details on development status

      -

      Table of contents

        @@ -472,6 +466,8 @@

        Maintainers

        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.

        +

        Current maintainers:

        +

        antoniospneto felipemotter mbcosta

        This module is part of the OCA/l10n-brazil project on GitHub.

        You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

      From 5d7053a705040d23c574c3b2633673cfd82bea55 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 27 Dec 2022 19:03:58 +0000 Subject: [PATCH 51/91] l10n_br_account_nfe 14.0.2.0.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index d2059f8fa5e5..17573da5cfaf 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.1.2.2", + "version": "14.0.2.0.0", "development_status": "Beta", "depends": [ "l10n_br_nfe", From f56c82deba1108196651489c6030d1bdb5f762a3 Mon Sep 17 00:00:00 2001 From: Weblate Date: Tue, 27 Dec 2022 19:04:20 +0000 Subject: [PATCH 52/91] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/ --- l10n_br_account_nfe/i18n/pt_BR.po | 60 ++++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 9 deletions(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index 2d0744785016..a09cabd2d76b 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -111,25 +111,58 @@ msgstr "99 - Outros" msgid "Boleto" msgstr "Boleto" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_dup +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_dup +msgid "Dados das duplicatas NT 2011/004" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__display_name #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__display_name -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__display_name +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__display_name msgid "Display Name" msgstr "Nome Exibido" #. module: l10n_br_account_nfe -#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document_workflow -msgid "Fiscal Document Workflow" +#: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document +msgid "Fiscal Document" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__nfe40_indPag +msgid "Forma de Pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_detPag +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag +msgid "Grupo de detalhamento da forma de pagamento" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model,name:l10n_br_account_nfe.model_nfe_40_detpag +msgid "Grupo de detalhamento da forma de pagamento." msgstr "" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line__id #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode__id -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__id +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__id msgid "ID" msgstr "ID" +#. module: l10n_br_account_nfe +#: model:ir.model.fields,help:l10n_br_account_nfe.field_nfe_40_detpag__nfe40_indPag +msgid "Indicador da Forma de Pagamento" +msgstr "" + #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_move_line msgid "Journal Item" @@ -138,7 +171,8 @@ msgstr "Item de Diário" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move_line____last_update #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment_mode____last_update -#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document_workflow____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document____last_update +#: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag____last_update msgid "Last Modified on" msgstr "Última Modificação em" @@ -159,11 +193,19 @@ msgstr "" "Pagamento deve ser preenchido com 90 - Sem Pagamento." #. module: l10n_br_account_nfe -#: code:addons/l10n_br_account_nfe/models/document_workflow.py:0 +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__nfe_40_detpag__nfe40_indPag__1 +msgid "Pagamento à Prazo" +msgstr "" + +#. module: l10n_br_account_nfe +#: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__nfe_40_detpag__nfe40_indPag__0 +msgid "Pagamento à Vista" +msgstr "" + +#. module: l10n_br_account_nfe +#: code:addons/l10n_br_account_nfe/models/document.py:0 #, python-format -msgid "" -"Payment Mode {} should has Fiscal Payment Mode filled to be used in Fiscal " -"Document!" +msgid "Payment Mode cannot be empty for this NF-e/NFC-e" msgstr "" #. module: l10n_br_account_nfe From 560c55948e6a9c06a583cc80486f34626be26c54 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 20:35:49 +0000 Subject: [PATCH 53/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 77.7% (28 of 36 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/pt_BR/ --- l10n_br_account_nfe/i18n/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index a09cabd2d76b..7ec2d64a2b63 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -6,15 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-09-16 22:07+0000\n" -"Last-Translator: Douglas Custódio \n" +"PO-Revision-Date: 2023-01-07 20:39+0000\n" +"Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.14.1\n" #. module: l10n_br_account_nfe #: model:ir.model.fields.selection,name:l10n_br_account_nfe.selection__account_payment_mode__fiscal_payment_mode__01 @@ -130,7 +130,7 @@ msgstr "Nome Exibido" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_l10n_br_fiscal_document msgid "Fiscal Document" -msgstr "" +msgstr "Documento Fiscal" #. module: l10n_br_account_nfe #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_nfe_40_detpag__nfe40_indPag From d77fdd6020e412b4a574ae8e194e49914182e226 Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Sat, 7 Jan 2023 23:33:51 +0000 Subject: [PATCH 54/91] Translated using Weblate (Portuguese (Brazil)) Currently translated at 80.5% (29 of 36 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/pt_BR/ --- l10n_br_account_nfe/i18n/pt_BR.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index 7ec2d64a2b63..5c7636879138 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-01-07 20:39+0000\n" +"PO-Revision-Date: 2023-01-08 02:39+0000\n" "Last-Translator: Marcel Savegnago \n" "Language-Team: none\n" "Language: pt_BR\n" @@ -206,7 +206,7 @@ msgstr "" #: code:addons/l10n_br_account_nfe/models/document.py:0 #, python-format msgid "Payment Mode cannot be empty for this NF-e/NFC-e" -msgstr "" +msgstr "O Modo de Pagamento não pode estar vazio para esta NF-e/NFC-e" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_account_payment_mode From 57bd088d0cfe999a0b5ce8932ca54cfb8a98239e Mon Sep 17 00:00:00 2001 From: Ygor Carvalho Date: Thu, 23 Feb 2023 15:23:21 -0300 Subject: [PATCH 55/91] [IMP] l10n_br_account_nfe: Not export dup, fat in NFCe xml --- l10n_br_account_nfe/models/document.py | 1 + 1 file changed, 1 insertion(+) diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py index 6ee9cb3cb4f3..0a86ff41d22f 100644 --- a/l10n_br_account_nfe/models/document.py +++ b/l10n_br_account_nfe/models/document.py @@ -115,6 +115,7 @@ def _need_compute_nfe40_dup(self): self._need_compute_nfe_tags() and self.amount_financial_total > 0 and self.nfe40_tpNF == NFE_OUT + and self.document_type != "65" ): return True else: From fbdddf3282d922aecba4be98595f5d3629763fd7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 27 Feb 2023 17:51:20 +0000 Subject: [PATCH 56/91] l10n_br_account_nfe 14.0.2.0.1 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 17573da5cfaf..41fabb7fc6bb 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.0.0", + "version": "14.0.2.0.1", "development_status": "Beta", "depends": [ "l10n_br_nfe", From 72d984a9904b4b06ac8baf9f7caa620b2ff6bb78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Neto?= Date: Mon, 6 Mar 2023 23:55:03 -0300 Subject: [PATCH 57/91] [FIX] l10n_br_account_nfe: dont copy nfe40_dup for refund document --- l10n_br_account_nfe/models/document.py | 1 + 1 file changed, 1 insertion(+) diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py index 0a86ff41d22f..6310b9eadaa1 100644 --- a/l10n_br_account_nfe/models/document.py +++ b/l10n_br_account_nfe/models/document.py @@ -30,6 +30,7 @@ class DocumentNfe(models.Model): comodel_name="nfe.40.dup", compute="_compute_nfe40_dup", store=True, + copy=False, readonly=False, ) From 48c79f57527712228d7f7b9a0f01059ccd33ec26 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 17 Apr 2023 18:03:20 +0000 Subject: [PATCH 58/91] l10n_br_account_nfe 14.0.2.1.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 41fabb7fc6bb..9c39b924fb4b 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.0.1", + "version": "14.0.2.1.0", "development_status": "Beta", "depends": [ "l10n_br_nfe", From 5a9009e9962e194dd671d03fbcbb086c8c4b5755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 6 May 2023 04:15:08 -0300 Subject: [PATCH 59/91] [FIX] testa os computes da NFe atraves do XML --- .../tests/test_nfe_generate_tags_cobr_dup_pag.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py index ef2462731805..c3bd057d067d 100644 --- a/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py +++ b/l10n_br_account_nfe/tests/test_nfe_generate_tags_cobr_dup_pag.py @@ -114,6 +114,7 @@ def setUpClass(cls): { "account_id": cls.invoice_line_account_id.id, "quantity": 1, + "uom_id": cls.env.ref("uom.product_uom_unit").id, "price_unit": 450.0, "name": "Product - Invoice Line Test", "fiscal_operation_line_id": cls.env.ref( @@ -208,3 +209,15 @@ def test_invoice_without_payment_mode(self): "90", "Error in nfe40_tPag field, should be 90 - Sem Pagamento.", ) + + def test_valid_nfe_xml(self): + """ + Test that NFe XML is valid. This in fact tests that NFe computed fields are + properly computed. + In fact this tests this bug with dummy documents(lines) compute triggers + https://github.com/OCA/l10n-brazil/issues/2451 + is fixed. + """ + invoice = self.invoice + invoice.fiscal_document_id._document_export() + self.assertEqual(invoice.fiscal_document_id.xml_error_message, False) From 7551e15a1ff3b5cf7172bb1a3235d64c0a80c9ce Mon Sep 17 00:00:00 2001 From: oca-ci Date: Thu, 11 May 2023 00:00:56 +0000 Subject: [PATCH 60/91] [UPD] Update l10n_br_account_nfe.pot --- l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot index 3b477d501809..7d0feeb8eef0 100644 --- a/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot +++ b/l10n_br_account_nfe/i18n/l10n_br_account_nfe.pot @@ -139,11 +139,15 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_detPag #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_detPag #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag -msgid "Grupo de detalhamento da forma de pagamento" +msgid "Grupo de detalhamento da forma" msgstr "" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_nfe_40_detpag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_move__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag msgid "Grupo de detalhamento da forma de pagamento." msgstr "" From 994c8d343cb8481e6989a89b59dae2e1a0542457 Mon Sep 17 00:00:00 2001 From: Weblate Date: Thu, 11 May 2023 09:58:51 +0000 Subject: [PATCH 61/91] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_account_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe/ --- l10n_br_account_nfe/i18n/pt_BR.po | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/i18n/pt_BR.po b/l10n_br_account_nfe/i18n/pt_BR.po index 5c7636879138..e393f4d7c0b0 100644 --- a/l10n_br_account_nfe/i18n/pt_BR.po +++ b/l10n_br_account_nfe/i18n/pt_BR.po @@ -142,11 +142,15 @@ msgstr "" #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_move__nfe40_detPag #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_account_payment__nfe40_detPag #: model:ir.model.fields,field_description:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag -msgid "Grupo de detalhamento da forma de pagamento" +msgid "Grupo de detalhamento da forma" msgstr "" #. module: l10n_br_account_nfe #: model:ir.model,name:l10n_br_account_nfe.model_nfe_40_detpag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_bank_statement_line__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_move__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_account_payment__nfe40_detPag +#: model:ir.model.fields,help:l10n_br_account_nfe.field_l10n_br_fiscal_document__nfe40_detPag msgid "Grupo de detalhamento da forma de pagamento." msgstr "" From d080583d62a2013a335cd527a2c59f1144578de8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 12 May 2023 16:44:16 +0000 Subject: [PATCH 62/91] l10n_br_account_nfe 14.0.2.1.1 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 9c39b924fb4b..f0098c45824f 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.1.0", + "version": "14.0.2.1.1", "development_status": "Beta", "depends": [ "l10n_br_nfe", From bdd21020f4d9bdd395a9f61618eb0b859b713353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Neto?= Date: Sat, 3 Jun 2023 08:59:50 -0300 Subject: [PATCH 63/91] [REF] l10n_br_account_nfe: check if the detpag has changed --- l10n_br_account_nfe/models/account_move_line.py | 1 - l10n_br_account_nfe/models/document.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/l10n_br_account_nfe/models/account_move_line.py b/l10n_br_account_nfe/models/account_move_line.py index 06d462c7826b..7c237cf01267 100644 --- a/l10n_br_account_nfe/models/account_move_line.py +++ b/l10n_br_account_nfe/models/account_move_line.py @@ -17,7 +17,6 @@ class AccountMoveLine(models.Model): _inherit = "account.move.line" def write(self, values): - result = super().write(values) MOVE_LINE_FIELDS = ["date_maturity", "name", "amount_currency"] if any(field in values.keys() for field in MOVE_LINE_FIELDS): diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py index 6310b9eadaa1..91c08cf3dadd 100644 --- a/l10n_br_account_nfe/models/document.py +++ b/l10n_br_account_nfe/models/document.py @@ -95,8 +95,15 @@ def _compute_nfe40_detpag(self): or "", "nfe40_vPag": rec.amount_financial_total, } - rec.nfe40_detPag = [(2, detpag, 0) for detpag in rec.nfe40_detPag.ids] - rec.nfe40_detPag = [(0, 0, det_pag_vals)] + detpag_current = { + field: getattr(detpag, field, None) + for detpag in rec.nfe40_detPag + for field in det_pag_vals + } + if det_pag_vals != detpag_current: + + rec.nfe40_detPag = [(2, detpag, 0) for detpag in rec.nfe40_detPag.ids] + rec.nfe40_detPag = [(0, 0, det_pag_vals)] ################################ # Business Model Methods From 4c552e58beade503e3e80f65da19e496342918e6 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 5 Jun 2023 13:59:53 +0000 Subject: [PATCH 64/91] l10n_br_account_nfe 14.0.2.1.2 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index f0098c45824f..39f90075e7e3 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.1.1", + "version": "14.0.2.1.2", "development_status": "Beta", "depends": [ "l10n_br_nfe", From daf716b2a1e5ed305994fe3c1d1c851408fbd136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 8 Jul 2023 01:49:38 -0300 Subject: [PATCH 65/91] [REF] fix demo data loading --- l10n_br_account_nfe/hooks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py index a02511b90b52..738fcbdb1817 100644 --- a/l10n_br_account_nfe/hooks.py +++ b/l10n_br_account_nfe/hooks.py @@ -17,12 +17,15 @@ def load_simples_nacional_demo(env, registry): """ # Load XML file with demo data. - if not tools.config["without_demo"]: + company_sn = env.ref( + "l10n_br_base.empresa_simples_nacional", raise_if_not_found=False + ) + if company_sn: # Allow all companies for OdooBot user and set default user company companies = env["res.company"].search([]) env.user.company_ids = [(6, 0, companies.ids)] - env.user.company_id = env.ref("l10n_br_base.empresa_simples_nacional") + env.user.company_id = company_sn tools.convert_file( env.cr, From 6d8df3c3ce90dd6c6056d666f312a44b6916bce0 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 11 Jul 2023 00:05:20 +0000 Subject: [PATCH 66/91] l10n_br_account_nfe 14.0.2.1.3 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 39f90075e7e3..69630fc3d1fe 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.1.2", + "version": "14.0.2.1.3", "development_status": "Beta", "depends": [ "l10n_br_nfe", From 28b841780d5896cf2760f31b3538a57e14757b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 26 Jun 2023 02:35:34 -0300 Subject: [PATCH 67/91] [REF] kill dummy records [REF] kill dummy WIP [REF] kill dummy WIP [REF] kill dummy records --- l10n_br_account_nfe/models/account_move_line.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/models/account_move_line.py b/l10n_br_account_nfe/models/account_move_line.py index 7c237cf01267..e36606e2b5ac 100644 --- a/l10n_br_account_nfe/models/account_move_line.py +++ b/l10n_br_account_nfe/models/account_move_line.py @@ -22,7 +22,7 @@ def write(self, values): if any(field in values.keys() for field in MOVE_LINE_FIELDS): invoices = self.mapped("move_id") for invoice in invoices.filtered( - lambda i: i.fiscal_document_id.id != i.company_id.fiscal_dummy_id.id + lambda i: i.fiscal_document_id and i.processador_edoc == PROCESSADOR_OCA and i.document_type_id.code in [MODELO_FISCAL_NFE, MODELO_FISCAL_NFCE] and i.issuer == DOCUMENT_ISSUER_COMPANY From 7164cd56f5ddf14c93e291f65b82ae96dd56d2c1 Mon Sep 17 00:00:00 2001 From: Felipe Zago Date: Tue, 8 Aug 2023 14:03:24 -0300 Subject: [PATCH 68/91] [FIX] contingency test --- l10n_br_account_nfe/models/document.py | 7 ++ l10n_br_account_nfe/tests/__init__.py | 1 + .../tests/test_nfce_contingency.py | 68 +++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 l10n_br_account_nfe/tests/test_nfce_contingency.py diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py index 91c08cf3dadd..37c166701d5f 100644 --- a/l10n_br_account_nfe/models/document.py +++ b/l10n_br_account_nfe/models/document.py @@ -159,3 +159,10 @@ def _check_fiscal_payment_mode(self): "has Fiscal Payment Mode filled to be used in Fiscal Document!" ) ) + + def _process_document_in_contingency(self): + super()._process_document_in_contingency() + + if self.move_ids: + copy_invoice = self.move_ids[0].copy() + copy_invoice.action_post() diff --git a/l10n_br_account_nfe/tests/__init__.py b/l10n_br_account_nfe/tests/__init__.py index d2cf3a28cf7a..2a153af4b29d 100644 --- a/l10n_br_account_nfe/tests/__init__.py +++ b/l10n_br_account_nfe/tests/__init__.py @@ -1 +1,2 @@ from . import test_nfe_generate_tags_cobr_dup_pag +from . import test_nfce_contingency diff --git a/l10n_br_account_nfe/tests/test_nfce_contingency.py b/l10n_br_account_nfe/tests/test_nfce_contingency.py new file mode 100644 index 000000000000..07321e3e59ef --- /dev/null +++ b/l10n_br_account_nfe/tests/test_nfce_contingency.py @@ -0,0 +1,68 @@ +# Copyright 2023 KMEE (Felipe Zago Rodrigues ) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests import TransactionCase + + +class TestAccountNFCe(TransactionCase): + def setUp(self): + super().setUp() + + self.document_id = self.env.ref("l10n_br_nfe.demo_nfce_same_state") + self.prepare_account_move_nfce() + + def prepare_account_move_nfce(self): + receivable_account_id = self.env["account.account"].create( + { + "name": "TEST ACCOUNT", + "code": "1.1.1.2.2", + "reconcile": 1, + "company_id": self.env.ref("base.main_company").id, + "user_type_id": self.env.ref("account.data_account_type_receivable").id, + } + ) + payable_account_id = self.env["account.account"].create( + { + "name": "TEST ACCOUNT 2", + "code": "1.1.1.2.3", + "reconcile": 1, + "company_id": self.env.ref("base.main_company").id, + "user_type_id": self.env.ref("account.data_account_type_payable").id, + } + ) + payment_method = self.env.ref("account.account_payment_method_manual_in").id + journal_id = self.env["account.journal"].create( + { + "name": "JOURNAL TEST", + "code": "TEST", + "type": "bank", + "company_id": self.env.ref("base.main_company").id, + } + ) + payment_mode = self.env["account.payment.mode"].create( + { + "name": "PAYMENT MODE TEST", + "company_id": self.env.ref("base.main_company").id, + "payment_method_id": payment_method, + "fiscal_payment_mode": "15", + "bank_account_link": "fixed", + "fixed_journal_id": journal_id.id, + } + ) + self.document_move_id = self.env["account.move"].create( + { + "name": "MOVE TEST", + "payment_mode_id": payment_mode.id, + "company_id": self.env.ref("base.main_company").id, + "line_ids": [ + (0, 0, {"account_id": receivable_account_id.id, "credit": 10}), + (0, 0, {"account_id": payable_account_id.id, "debit": 10}), + ], + } + ) + self.document_move_id.fiscal_document_id = self.document_id.id + + def test_nfce_contingencia(self): + self.document_id._process_document_in_contingency() + + self.assertIn(self.document_move_id, self.document_id.move_ids) From 5bbe2390cf98a4f248ae7ef250680ba52a45b581 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 10 Aug 2023 19:10:01 +0000 Subject: [PATCH 69/91] l10n_br_account_nfe 14.0.3.0.0 --- l10n_br_account_nfe/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_br_account_nfe/__manifest__.py b/l10n_br_account_nfe/__manifest__.py index 69630fc3d1fe..e207fb5d8d8f 100644 --- a/l10n_br_account_nfe/__manifest__.py +++ b/l10n_br_account_nfe/__manifest__.py @@ -13,7 +13,7 @@ "author": "Engenere," "Akretion," "Odoo Community Association (OCA)", "maintainers": ["antoniospneto", "felipemotter", "mbcosta"], "website": "https://github.com/OCA/l10n-brazil", - "version": "14.0.2.1.3", + "version": "14.0.3.0.0", "development_status": "Beta", "depends": [ "l10n_br_nfe", From 6164502614b675b2cc94b74af73fa092321e1a23 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 13:24:58 +0000 Subject: [PATCH 70/91] [UPD] README.rst --- l10n_br_account_nfe/README.rst | 15 +++-- .../static/description/index.html | 58 ++++++++++--------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/l10n_br_account_nfe/README.rst b/l10n_br_account_nfe/README.rst index 3ef6b1045cb4..8946decd884d 100644 --- a/l10n_br_account_nfe/README.rst +++ b/l10n_br_account_nfe/README.rst @@ -2,10 +2,13 @@ Account NFe/NFC-e Integration ============================= -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:ed5f805a4588501af00ec1cfd2feb6d0b31ed7f87bf06a91f91b7de79fa3f791 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Account NFe/NFC-e Integration .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_account_nfe :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/124/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&target_branch=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| **Português** Este módulo integra os módulos l10n_br_account e l10n_br_nfe. @@ -78,7 +81,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/l10n_br_account_nfe/static/description/index.html b/l10n_br_account_nfe/static/description/index.html index d22e503d3c42..88b0f51b8906 100644 --- a/l10n_br_account_nfe/static/description/index.html +++ b/l10n_br_account_nfe/static/description/index.html @@ -1,20 +1,20 @@ - + - + Account NFe/NFC-e Integration