-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
[14.0][ADD] l10n_br_cte: add new module #3492
Open
marcelsavegnago
wants to merge
17
commits into
OCA:14.0
Choose a base branch
from
Escodoo:14.0-add-l10n_br_cte-rebased-multi_schema-refactor
base: 14.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
033b628
[ADD] l10n_br_cte: add new module
mileo 1d10116
[RFC] l10n_br_fiscal: add service provider and transport model
mileo 0f9dca5
[RFC] l10n_br_cte: escodoo refactor
marcelsavegnago 7db8d48
[RFC] l10n_br_fiscal: escodoo refactor
marcelsavegnago 4958e16
[FIX] l10n_br_cte: fix pre-commit
marcelsavegnago 218283d
[RFC] l10n_br_cte: multi-schema refactor
marcelsavegnago 394ddb5
[IMP] l10n_br_cte: add tests
marcelsavegnago ccea1e7
[RFC] l10n_br_cte_spec: rename model spec_models to spec_mixin
marcelsavegnago 06c8bcf
[RFC] l10n_br_cte_spec: multi-schema refactor
marcelsavegnago bc25430
[IMP] l10n_br_cte: add res_country not create
marcelsavegnago 1655456
[FIX] l10n_br_cte: fix fone field
marcelsavegnago f1da358
[RFC] l10n_br_cte_spec: refactor
marcelsavegnago b86e0a1
[IMP] l10n_br_fiscal: add cte demo data
marcelsavegnago df937a4
[IMP] l10n_br_fiscal: add cte partners fields
marcelsavegnago 778ea20
[RFC] l10n_br_cte: general refactor
marcelsavegnago 5a26f58
[IMP] l10n_br_cte: change cte40 partner fields to fiscal partner fields
marcelsavegnago 4367f8a
[FIX[ l1n_br_cte: limpando
marcelsavegnago File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
==== | ||
CT-e | ||
==== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c91616235e33e68d0115aa3807f25142a45f5013a23492f240cf507a41d41340 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/14.0/l10n_br_cte | ||
: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-14-0/l10n-brazil-14-0-l10n_br_cte | ||
: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=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Este módulo permite a emissão de CT-e. | ||
|
||
Mais especificamente ele: | ||
* mapea os campos de CT-e do módulo ``l10n_br_cte_spec`` com os campos Odoo. | ||
* usa a logica do módulo ``spec_driven_model`` para realizar esse mapeamento de forma dinâmica, em especial ele usa o sistema de modelos com várias camadas, ou ``StackedModel``, com os modelos ``l10n_br_fiscal.document`` e ``l10n_br_fiscal.document.related`` que tem varios niveis hierarquicos de elementos XML que estão sendo denormalizados dentro desses modelos Odoo | ||
* tem wizards para implementar a comunicação SOAP de CT-e com a SEFAZ (Autorização, Cancelamento, Encerramento...) | ||
|
||
.. 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 <https://odoo-community.org/page/development-status>`_ | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module you need to set a digital certificate on the company, and also set the company edoc processor. | ||
|
||
Usage | ||
===== | ||
|
||
Para utilizar o módulo `l10n_br_cte` em conjunto com o módulo `l10n_br_account`, é necessário configurar uma linha de operação fiscal que não adicione valor ao montante do documento, uma vez que o CT-e (Manifesto Eletrônico de Documentos Fiscais) não possui valor financeiro. | ||
|
||
**Passo a Passo:** | ||
|
||
1. **Criar uma Fatura:** | ||
- Defina o tipo de documento como **57 (CTe)**. | ||
|
||
2. **Configurar o Parceiro da Fatura:** | ||
- Configure o parceiro responsável pelo pagamento do CTe e os parceiros como Rementente, Expedidor, Destinatário e Recebedor. | ||
|
||
3. **Adicionar uma Linha na Aba Produtos:** | ||
- Adicione uma linha de fatura e selecione o produto Frete ou outro que esteja previamente configurado. | ||
|
||
4. **Acesse os detalhes fiscais da fatura e informe os demais dados necessário para emissão do CT-e:** | ||
- Preencha os campos obrigatórios para emissão do CT-e. | ||
|
||
5. **Valide o CT-e, verifique os dados do XML e envie para a SEFAZ:** | ||
- Após preencher todos os dados necessários, valide o CT-e e envie para a SEFAZ. | ||
|
||
Seguindo esses passos, o módulo `l10n_br_cte` funcionará corretamente em conjunto com o `l10n_br_account`, permitindo a emissão de CT-e sem valores financeiros associados. | ||
|
||
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aqui a mesma duvida, cte pode ter valor, é o mdfe que não, ou estou errado? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. exatamente |
||
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_cte%0Aversion:%2014.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 | ||
~~~~~~~ | ||
|
||
* KMEE | ||
* Escodoo | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
|
||
* `KMEE <https://kmee.com.br>`_: | ||
|
||
* Luis Felipe Mileo <[email protected]> | ||
* Ygor Carvalho <[email protected]> | ||
|
||
* `ESCODOO <https://escodoo.com.br>`_: | ||
|
||
* Marcel Savegnago <[email protected]> | ||
|
||
* `AKRETION <https://akretion.com/pt-BR/>`_: | ||
|
||
* Raphaël Valyi <[email protected]> | ||
|
||
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-mileo| image:: https://github.com/mileo.png?size=40px | ||
:target: https://github.com/mileo | ||
:alt: mileo | ||
.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px | ||
:target: https://github.com/marcelsavegnago | ||
:alt: marcelsavegnago | ||
|
||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-mileo| |maintainer-marcelsavegnago| | ||
|
||
This module is part of the `OCA/l10n-brazil <https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_cte>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from .hooks import post_init_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2023 KMEE | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "CT-e", | ||
"summary": """Brazilian Electronic Invoice CT-e""", | ||
"version": "14.0.1.0.0", | ||
"category": "Localisation", | ||
"license": "AGPL-3", | ||
"author": "KMEE,Escodoo,Odoo Community Association (OCA)", | ||
"maintainers": ["mileo", "marcelsavegnago"], | ||
"website": "https://github.com/OCA/l10n-brazil", | ||
"development_status": "Alpha", | ||
"depends": [ | ||
"l10n_br_fiscal_edi", | ||
"l10n_br_cte_spec", | ||
"l10n_br_fiscal_certificate", | ||
"spec_driven_model", | ||
], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"data/ir_config_parameter.xml", | ||
# "views/document_line.xml", | ||
# 'views/document_related.xml', | ||
# 'views/res_partner.xml', | ||
"modal/modal_rodoviario.xml", | ||
"modal/modal_aquaviario.xml", | ||
"modal/modal_ferroviario.xml", | ||
"modal/modal_aereo.xml", | ||
"views/res_company.xml", | ||
"views/cte_document.xml", | ||
"wizards/document_correction_wizard.xml", | ||
], | ||
"demo": [ | ||
"demo/fiscal_document_demo.xml", | ||
"demo/company_demo.xml", | ||
], | ||
"post_init_hook": "post_init_hook", | ||
"installable": True, | ||
"auto_install": False, | ||
"external_dependencies": { | ||
"python": [ | ||
"nfelib<=2.0.7", | ||
"erpbrasil.assinatura>=1.7.0", | ||
"erpbrasil.transmissao>=1.1.0", | ||
"erpbrasil.edoc>=2.5.2", | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (C) 2024 - TODAY, Marcel Savegnago <[email protected]> | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
CTE_VERSIONS = [("4.00", "4.00")] | ||
|
||
CTE_VERSION_DEFAULT = "4.00" | ||
|
||
CTE_ENVIRONMENTS = [("1", "Produção"), ("2", "Homologação")] | ||
|
||
CTE_ENVIRONMENT_DEFAULT = "2" | ||
|
||
CTE_EMIT_TYPES = [ | ||
("1", "1 - Prestador de serviço de transporte"), | ||
("2", "2 - Transportador de Carga Própria"), | ||
("3", "3 - Prestador de serviço de transporte que emitirá CT-e Globalizado"), | ||
] | ||
|
||
CTE_EMIT_TYPE_DEFAULT = "2" | ||
|
||
CTE_TRANSP_TYPE = [ | ||
("1", "Empresa de Transporte de Cargas – ETC"), | ||
("2", "Transportador Autônomo de Cargas – TAC"), | ||
("3", "Cooperativa de Transporte de Cargas – CTC"), | ||
] | ||
|
||
CTE_TRANSP_TYPE_DEFAULT = "1" | ||
|
||
CTE_TRANSMISSIONS = [ | ||
("1", "Emissão Normal"), | ||
("2", "Contingência Off-Line"), | ||
("3", "Regime Especial NFF"), | ||
] | ||
|
||
CTE_TRANSMISSION_DEFAULT = "1" | ||
|
||
CTE_EMISSION_PROCESSES = [("0", "Emissão de CTe com aplicativo do contribuinte")] | ||
|
||
CTE_EMISSION_PROCESS_DEFAULT = "0" | ||
|
||
CTE_TYPE = [ | ||
("0", "CT-e Normal"), | ||
("1", "CT-e de Complemento de Valores"), | ||
("3", "CT-e de Substituição"), | ||
] | ||
|
||
CTE_TYPE_DEFAULT = "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CTE_MODALS = [ | ||
("01", "Rodoviário"), | ||
("02", "Aéreo"), | ||
("03", "Aquaviário"), | ||
("04", "Ferroviário"), | ||
("05", "Dutoviário"), | ||
("06", "Multimodal"), | ||
] | ||
|
||
CTE_MODAL_DEFAULT = "01" | ||
|
||
CTE_MODAL_VERSION_DEFAULT = "4.00" | ||
|
||
TUF = [ | ||
("AC", "AC"), | ||
("AL", "AL"), | ||
("AM", "AM"), | ||
("AP", "AP"), | ||
("BA", "BA"), | ||
("CE", "CE"), | ||
("DF", "DF"), | ||
("ES", "ES"), | ||
("GO", "GO"), | ||
("MA", "MA"), | ||
("MG", "MG"), | ||
("MS", "MS"), | ||
("MT", "MT"), | ||
("PA", "PA"), | ||
("PB", "PB"), | ||
("PE", "PE"), | ||
("PI", "PI"), | ||
("PR", "PR"), | ||
("RJ", "RJ"), | ||
("RN", "RN"), | ||
("RO", "RO"), | ||
("RR", "RR"), | ||
("RS", "RS"), | ||
("SC", "SC"), | ||
("SE", "SE"), | ||
("SP", "SP"), | ||
("TO", "TO"), | ||
("EX", "EX"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
|
||
<record id="cte_version_name" model="ir.config_parameter" forcecreate="True"> | ||
<field name="key">l10n_br_cte.version.name</field> | ||
<field name="value">Odoo Brasil OCA v14</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
|
||
<!-- Empresa Lucro Presumido --> | ||
<record id="l10n_br_base.empresa_lucro_presumido" model="res.company"> | ||
<field name="processador_edoc">oca</field> | ||
</record> | ||
|
||
<!-- Empresa Simples Nacional --> | ||
<record id="l10n_br_base.empresa_simples_nacional" model="res.company"> | ||
<field name="processador_edoc">oca</field> | ||
</record> | ||
|
||
</odoo> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acho que aqui misturou o conceito de ct-e com mdf-e não?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foi o control-c, control-v :D .. vlwwww vou ajustar