Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG][l10n_br_account_nfe] #3273

Merged
merged 92 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
93a866f
[ADD] new module l10n_br_account_nfe
felipemotter Sep 15, 2021
533ede5
add cobrança info nfe
antoniospneto Sep 28, 2021
9e585d7
add cobrança test
antoniospneto Sep 29, 2021
947adb2
[FIX] generate financial information only when the issuer of nfe is a…
antoniospneto Mar 11, 2022
b21973b
[IMP] Demo Data.
mbcosta Mar 29, 2022
3ce8c22
[REF] Changed the object used to create NFe Tags pag and dup because …
mbcosta Mar 29, 2022
59139cc
[REF] Rename file after changed the object used to create NFe Tags PA…
mbcosta Mar 29, 2022
0e01403
[REF+IMP] Changed Tests to use SavepointCase and included test with d…
mbcosta Mar 29, 2022
2a6784e
[REF] Name of test file.
mbcosta Mar 30, 2022
1eae513
[UPD] Readme files.
mbcosta Mar 30, 2022
6cb56f5
[REF+FIX] Included License Header, made module auto install and fix m…
mbcosta Mar 30, 2022
a11e3d0
[UPD] Update l10n_br_account_nfe.pot
oca-travis Apr 3, 2022
7e967d5
[UPD] README.rst
OCA-git-bot Apr 3, 2022
81ea41d
[ADD] icon.png
OCA-git-bot Apr 3, 2022
ea67331
Update financial move in fiscal document NFE XML
renatonlima May 25, 2022
a866b61
[UPD] Update l10n_br_account_nfe.pot
oca-travis May 27, 2022
0fa8b84
[FIX] clean fields nfe40_dup and nfe40_detPag before create records
renatonlima May 27, 2022
a1b27f5
Não deve criar nfe40_dup e record.nfe40_detPag quando a finalidade fo…
renatonlima May 27, 2022
043dcd3
l10n_br_account_nfe 12.0.1.1.0
OCA-git-bot May 27, 2022
79c6a83
[UPD] Update l10n_br_account_nfe.pot
oca-travis May 28, 2022
14c960b
l10n_br_account_nfe 12.0.1.1.1
OCA-git-bot May 28, 2022
357d8ee
l10n_br_account_nfe: pre-commit after pre-commit version upgrade
renatonlima Jun 2, 2022
bf5f338
[MIG] l10n_br_account_nfe: Migration to 14.0
antoniospneto Jul 4, 2022
cb4c694
[MIG] rename fields
antoniospneto Jul 10, 2022
d0a2607
[MIG] load the demo in the hook
antoniospneto Jul 10, 2022
00595e1
[MIG] fix tests
antoniospneto Jul 10, 2022
fca8bee
[FIX] back default user company to main_company
antoniospneto Jul 10, 2022
c2f33b6
[FIX] hook for without demo
antoniospneto Jul 15, 2022
0bf37bd
[UPD] Update l10n_br_account_nfe.pot
oca-travis Jul 24, 2022
80d5b18
[UPD] README.rst
OCA-git-bot Jul 24, 2022
dd2abba
[FIX] If you create NF-e without payment_mode_id
renatonlima Jul 26, 2022
de9b4bb
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Jul 28, 2022
a685e00
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jul 28, 2022
3d0b9ed
[FIX] Nas NF-es de devolução ou ajustem devem ir com pagamento 90
renatonlima Jul 26, 2022
9458022
l10n_br_account_nfe 14.0.1.1.0
OCA-git-bot Jul 29, 2022
30d56a2
[ADD] NFC-e constant [MOV] FISCAL_PAYMENT_MODE
mileo Aug 29, 2022
3f88559
l10n_br_account_nfe 14.0.1.1.1
OCA-git-bot Aug 29, 2022
d3d0916
[FIX] l10n_br_account_nfe: create invoice from form on unit test
marcelsavegnago Sep 3, 2022
1739f70
l10n_br_account_nfe 14.0.1.1.2
OCA-git-bot Sep 4, 2022
b5c167f
[FIX+IMP] l10n_br_account_nfe: In the Demo Data need to run onchanges…
mbcosta Sep 5, 2022
7ae9903
l10n_br_account_nfe 14.0.1.2.0
OCA-git-bot Sep 6, 2022
43dc4a7
Translated using Weblate (Portuguese (Brazil))
douglascstd Sep 16, 2022
e6243f0
[REF] str-format-used l10n_br_account_nfe
mileo Oct 21, 2022
ff5117a
l10n_br_account_nfe 14.0.1.2.1
OCA-git-bot Oct 22, 2022
f17eb23
[REF] missing-return l10n_br_account_nfe
mileo Oct 22, 2022
df8bf4a
l10n_br_account_nfe 14.0.1.2.2
OCA-git-bot Oct 22, 2022
8e26a57
[REF] l10n_br_account_nfe: create tags in compute methods
antoniospneto Dec 26, 2022
7df1c86
[FIX] l10n_br_account_nfe: remove dependency to l10n_br_coa_simple
antoniospneto Dec 26, 2022
0db9357
[UPD] Update l10n_br_account_nfe.pot
Dec 27, 2022
265e04b
[UPD] README.rst
OCA-git-bot Dec 27, 2022
594b3b2
l10n_br_account_nfe 14.0.2.0.0
OCA-git-bot Dec 27, 2022
0320f35
Update translation files
weblate Dec 27, 2022
87569c6
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jan 7, 2023
60ea152
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jan 7, 2023
7327f3f
[IMP] l10n_br_account_nfe: Not export dup, fat in NFCe xml
ygcarvalh Feb 23, 2023
0b32bbb
l10n_br_account_nfe 14.0.2.0.1
OCA-git-bot Feb 27, 2023
1ec09e2
[FIX] l10n_br_account_nfe: dont copy nfe40_dup for refund document
antoniospneto Mar 7, 2023
4240357
l10n_br_account_nfe 14.0.2.1.0
OCA-git-bot Apr 17, 2023
460f244
[FIX] testa os computes da NFe atraves do XML
rvalyi May 6, 2023
6454113
[UPD] Update l10n_br_account_nfe.pot
May 11, 2023
36e86d6
Update translation files
weblate May 11, 2023
8375f36
l10n_br_account_nfe 14.0.2.1.1
OCA-git-bot May 12, 2023
47a267f
[REF] l10n_br_account_nfe: check if the detpag has changed
antoniospneto Jun 3, 2023
094153a
l10n_br_account_nfe 14.0.2.1.2
OCA-git-bot Jun 5, 2023
bd0445b
[REF] fix demo data loading
rvalyi Jul 8, 2023
b683b60
l10n_br_account_nfe 14.0.2.1.3
OCA-git-bot Jul 11, 2023
534c65e
[REF] kill dummy records
rvalyi Jun 26, 2023
513f96b
[FIX] contingency test
felipezago Aug 8, 2023
fa642a3
l10n_br_account_nfe 14.0.3.0.0
OCA-git-bot Aug 10, 2023
8ce071c
[UPD] README.rst
OCA-git-bot Sep 3, 2023
943479f
[REF] l10n_br_account_nfe: Remove empty Lines, necessary for the new …
mbcosta Oct 25, 2023
2e4ba54
[BOT] post-merge updates
OCA-git-bot Oct 27, 2023
7ec8381
[FIX] l10n_br_account_nfe: Field uom_id become product_uom_id in acco…
mbcosta Nov 30, 2023
306d202
[BOT] post-merge updates
OCA-git-bot Nov 30, 2023
76dce02
[REF] 10n_br_account_nfe: remove legacy code
antoniospneto May 24, 2024
df31d63
[UPD] Update l10n_br_account_nfe.pot
May 29, 2024
3818716
[BOT] post-merge updates
OCA-git-bot May 29, 2024
895c0a4
Update translation files
weblate May 29, 2024
8184263
[REF] l10n_br_account_nfe: rename nfce contingency function
antoniospneto May 29, 2024
1c8e306
[BOT] post-merge updates
OCA-git-bot Jul 10, 2024
b6d3847
[IMP] l10n_br_account_nfe: add unit test for nfe with IPI
antoniospneto Jul 13, 2024
acfa2f3
[BOT] post-merge updates
OCA-git-bot Jul 18, 2024
5275564
[IMP] l10n_br_account_nfe: print danfe
CristianoMafraJunior Mar 21, 2024
551406d
Translated using Weblate (Portuguese (Brazil))
antoniospneto Jul 19, 2024
457a380
[UPD] Update l10n_br_account_nfe.pot
Jul 21, 2024
3b7e675
[BOT] post-merge updates
OCA-git-bot Jul 21, 2024
d650e47
Update translation files
weblate Jul 21, 2024
acba583
[REF] l10n_br_account_nfe: lint
rvalyi Aug 7, 2024
b9fd4a6
[MIG] l10n_br_account_nfe: Migration to 15.0
rvalyi Aug 7, 2024
d0eeee1
[IMP] l10n_br_account_nfe: pre-commit stuff
rvalyi Aug 7, 2024
1abced5
[MIG] l10n_br_account_nfe: Migration to 16.0
rvalyi Aug 7, 2024
58752e2
[MIG] l10n_br_account_nfe: improve tests
antoniospneto Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 142 additions & 0 deletions l10n_br_account_nfe/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
=============================
Account NFe/NFC-e Integration
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e13f8f0153ea0f7311fe4f10f09547648467a34650d59726ad92e3753ebd8bfe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
: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
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-brazil/tree/16.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-16-0/l10n-brazil-16-0-l10n_br_account_nfe
:alt: Translate me on Weblate
.. |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=16.0
:alt: Try me on Runboat

|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.

**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 <https://github.com/OCA/l10n-brazil/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-brazil/issues/new?body=module:%20l10n_br_account_nfe%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Engenere
* Akretion

Contributors
------------

- `Engenere <https://engenere.one>`__:

- Felipe Motter Pereira <felipe@engenere.one>
- Antônio S. Pereira Neto <neto@engenere.one>

- `Akretion <https://akretion.com/pt-BR>`__:

- Magno Barcelo da Costa <magno.costa@akretion.com.br>

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.

.. |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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-antoniospneto| |maintainer-felipemotter| |maintainer-mbcosta|

This module is part of the `OCA/l10n-brazil <https://github.com/OCA/l10n-brazil/tree/16.0/l10n_br_account_nfe>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions l10n_br_account_nfe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .hooks import post_init_hook

from . import models
from . import report
30 changes: 30 additions & 0 deletions l10n_br_account_nfe/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (C) 2022-Today - Engenere (<https://engenere.one>).
# @author Antônio S. Pereira Neto <neto@engenere.one>
# @author Felipe Motter Pereira <felipe@engenere.one>
# Copyright (C) 2022-Today - Akretion (<https://akretion.com/pt-BR>).
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account NFe/NFC-e Integration",
"summary": "Integration between l10n_br_account and l10n_br_nfe",
"category": "Localisation",
"license": "AGPL-3",
"author": "Engenere," "Akretion," "Odoo Community Association (OCA)",
"maintainers": ["antoniospneto", "felipemotter", "mbcosta"],
"website": "https://github.com/OCA/l10n-brazil",
"version": "16.0.1.0.0",
"development_status": "Beta",
"depends": [
"l10n_br_nfe",
"l10n_br_account",
"account_payment_partner",
],
"data": [
"views/account_payment_mode.xml",
"report/danfe_report.xml",
],
"post_init_hook": "post_init_hook",
"installable": True,
"auto_install": True,
}
113 changes: 113 additions & 0 deletions l10n_br_account_nfe/demo/account_invoice_sn_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<!--
** Attention **
This file is loaded by hooks with defualt user company "Simples Nacional"
This is important to maintain multi-company data consistency.
Do not include data from another company here,
if necessary, do it in a separate file.
-->
<!-- Payment Terms -->
<record id="account_payment_term_30_60_90" model="account.payment.term">
<field name="name">30/60/90</field>
<field name="note">Payment terms: 30/60/90</field>
<field name="company_id" ref="l10n_br_base.empresa_simples_nacional" />
<field
name="line_ids"
eval="[(5, 0),
(0, 0, {'value': 'percent', 'value_amount': 33, 'days': 30}),
(0, 0, {'value': 'percent', 'value_amount': 33, 'days': 60}),
(0, 0, {'value': 'balance', 'value_amount': 0.0, 'days': 90})
]"
/>
</record>

<!-- Account Journal for Simples Nacional -->
<record id="demo_simples_nacional_bank_journal" model="account.journal">
<field name="name">Diário de Boleto - Simples Nacional</field>
<field name="code">TPO</field>
<field name="type">bank</field>
<field name="company_id" ref="l10n_br_base.empresa_simples_nacional" />
</record>

<!-- Payment Mode -->
<record id="demo_payment_mode_boleto" model="account.payment.mode">
<field name="name">Boleto</field>
<field name="company_id" ref="l10n_br_base.empresa_simples_nacional" />
<field
name="payment_method_id"
ref="account.account_payment_method_manual_in"
/>
<field name="fiscal_payment_mode">15</field>
<field name="bank_account_link">fixed</field>
<field name="fixed_journal_id" ref="demo_simples_nacional_bank_journal" />
</record>

<!-- Faturas/Invoices de Teste deve gerar TAG Cobrança -->
<record id="demo_nfe_dados_de_cobranca" model="account.move">
<field name="name">Teste NFe Dados de Cobrança</field>
<field name="company_id" ref="l10n_br_base.empresa_simples_nacional" />
<field name="invoice_payment_term_id" ref="account_payment_term_30_60_90" />
<field name="partner_id" ref="l10n_br_base.res_partner_akretion" />
<field name="move_type">out_invoice</field>
<field name="invoice_user_id" ref="base.user_admin" />
<field name="payment_mode_id" ref="demo_payment_mode_boleto" />
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_venda" />
<field name="document_type_id" ref="l10n_br_fiscal.document_55" />
<field
name="document_serie_id"
ref="l10n_br_fiscal.empresa_sn_document_55_serie_1"
/>
<field name="document_serie">1</field>
<field
name="invoice_line_ids"
eval="[
(0, 0, {
'product_id': ref('product.product_product_5'),
'quantity': 1,
'price_unit': 1000,
'company_id': ref('l10n_br_base.empresa_simples_nacional'),
'partner_id': ref('l10n_br_base.res_partner_akretion'),
'uom_id': ref('uom.product_uom_unit'),
'fiscal_operation_id': ref('l10n_br_fiscal.fo_venda'),
'fiscal_operation_line_id': ref('l10n_br_fiscal.fo_venda_revenda_nao_contribuinte'),
'cfop_id': ref('l10n_br_fiscal.cfop_5102'),
'ncm_id': ref('l10n_br_fiscal.ncm_84714900'),
})]"
/>
</record>

<!-- Faturas/Invoices de Teste não deve gerar TAG Cobrança -->
<record id="demo_nfe_sem_dados_de_cobranca" model="account.move">
<field name="name">Teste NFe Sem Dados de Cobrança</field>
<field name="company_id" ref="l10n_br_base.empresa_simples_nacional" />
<field name="partner_id" ref="l10n_br_base.res_partner_akretion" />
<field name="move_type">out_invoice</field>
<field name="user_id" ref="base.user_admin" />
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_bonificacao" />
<field name="document_type_id" ref="l10n_br_fiscal.document_55" />
<field
name="document_serie_id"
ref="l10n_br_fiscal.empresa_sn_document_55_serie_1"
/>
<field name="document_serie">1</field>
<field name="fiscal_operation_type">out</field>
<field
name="invoice_line_ids"
eval="[
(0, 0, {
'product_id': ref('product.product_product_5'),
'quantity': 1,
'price_unit': 1000,
'company_id': ref('l10n_br_base.empresa_simples_nacional'),
'partner_id': ref('l10n_br_base.res_partner_akretion'),
'uom_id': ref('uom.product_uom_unit'),
'fiscal_operation_id': ref('l10n_br_fiscal.fo_bonificacao'),
'fiscal_operation_line_id': ref('l10n_br_fiscal.fo_bonificacao_bonificacao'),
'cfop_id': ref('l10n_br_fiscal.cfop_5910'),
'ncm_id': ref('l10n_br_fiscal.ncm_84714900'),
})]"
/>
</record>

</odoo>
55 changes: 55 additions & 0 deletions l10n_br_account_nfe/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (C) 2022-Today - Engenere (<https://engenere.one>).
# @author Antônio S. Pereira Neto <neto@engenere.one>
# 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.
"""

# Load XML file with demo data.
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 = company_sn

tools.convert_file(
env.cr,
"l10n_br_account_nfe",
"demo/account_invoice_sn_demo.xml",
None,
mode="init",
noupdate=True,
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")
Loading
Loading