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

[14.0][WIP][NEW] l10n_br_cte #2586

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b375656
[ADD] l10n_br_cte
ygcarvalh Jul 10, 2023
25291da
[IMP] l10n_br_cte: add document related model
ygcarvalh Jul 11, 2023
6198414
[FIX] l10n_br_cte: implements the filter processador edoc method
ygcarvalh Jul 12, 2023
7d7124c
[IMP] l10n_br_cte: ct-e fields in res.company
ygcarvalh Jul 14, 2023
7f9ed22
[IMP] l10n_br_fiscal: Add modal info in document model
ygcarvalh Jul 14, 2023
c109f27
[IMP] l10n_br_cte: ct-e fields in res.company
ygcarvalh Jul 14, 2023
e456aa7
[IMP] l10n_br_fiscal: Add modal info in document model
ygcarvalh Jul 14, 2023
1ab498e
[IMP] Model Fields Created
ODBreno Jul 19, 2023
5ae325b
[IMP] Add modal
ODBreno Jul 25, 2023
d3a5afa
[WIP] document_export
Aug 7, 2023
1339d64
[FIX] Duplicated fields removed
ODBreno Aug 8, 2023
f879848
[IMP] Add modal
ODBreno Jul 25, 2023
45d6596
[FIX] Duplicated fields removed
ODBreno Aug 8, 2023
2e8f7e7
[WIP] XML Generation
ODBreno Aug 8, 2023
0dbb563
[WIP]
ODBreno Aug 15, 2023
037de9f
[FIX] l10n_br_cte: Locate ICMS tag to export
lfdivino Sep 19, 2023
23d7df6
[FIX] l10n_br_cte: Replace tag names correctly
ODBreno Sep 19, 2023
b164c08
[FIX] spec_driven_model: Consider only correct base_class to spec_module
lfdivino Sep 20, 2023
4ccf5c7
[FIX] Wrong ICMS CST fixed
ODBreno Sep 22, 2023
5f615dd
[FIX] l10n_br_cte: Dependence module
lfdivino Sep 25, 2023
bed7079
[FIX] l10n_br_cte: Bindings and prefix
lfdivino Sep 25, 2023
f8140cf
[WIP] Refactor modals
ODBreno Sep 25, 2023
5dd230f
[FIX] Refactor modals and modal fields in document
ODBreno Sep 26, 2023
8fa8a9f
[FIX] l10n_br_nfe: Check partner only importing NF-e
lfdivino Sep 20, 2023
752cb2a
[FIX] Requirements versions
lfdivino Sep 28, 2023
dbb9aa8
[WIP] Modals Implementation
ODBreno Oct 3, 2023
31131d9
[FIX] l10n_br_fiscal: adapt code to work with multiple document types.
felipezago Sep 26, 2023
35e0014
[FIX] l10n_br_nfe: adapt code to work with multiple document types.
felipezago Sep 26, 2023
4c14b25
[FIX] remove binding module
felipezago Oct 2, 2023
28c89ea
[ADD] l10n_br_fiscal: qr code generation workflow
felipezago Sep 19, 2023
177b4e5
[FIX] l10n_br_nfe: qr code generation workflow
felipezago Oct 2, 2023
063911d
[FIX] l10n_br_cte: Fields Mappings
lfdivino Oct 4, 2023
47c0a4b
[WIP] Modals refactored and added to the view
ODBreno Oct 5, 2023
cbfd8a1
[WIP] Modals in Infctenorm
ODBreno Oct 23, 2023
8e74610
[WIP]Emission of cte
ODBreno Nov 10, 2023
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
110 changes: 110 additions & 0 deletions l10n_br_cte/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
====
CT-e
====

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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/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/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/124/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

[ This file must be max 2-3 paragraphs, and is required. ]

This module extends the functionality of ... to support ...
and to allow you to ...

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

[ This file is optional, it should explain how to configure
the module before using it; it is aimed at advanced users. ]

To configure this module, you need to:

#. Go to ...

.. figure:: https://raw.githubusercontent.com/OCA/l10n-brazil/14.0/l10n_br_cte/static/description/image.png
:alt: alternative description
:width: 600 px

Usage
=====

[ This file must be present and contains the usage instructions
for end-users. As all other rst files included in the README,
it MUST NOT contain reStructuredText sections
only body text (paragraphs, lists, tables, etc). Should you need
a more elaborate structure to explain the addon, please create a
Sphinx documentation (which may include this file as a "quick start"
section). ]

To use this module, you need to:

#. Go to ...

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

Contributors
~~~~~~~~~~~~

* Ygor Carvalho <[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.

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.
2 changes: 2 additions & 0 deletions l10n_br_cte/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
42 changes: 42 additions & 0 deletions l10n_br_cte/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-brazil",
"development_status": "Alpha",
"depends": [
"l10n_br_fiscal",
"l10n_br_cte_spec",
"l10n_br_fiscal_certificate",
"spec_driven_model",
],
"data": [
"security/ir.model.access.csv",
# "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",
],
"post_init_hook": "post_init_hook",
"installable": True,
"auto_install": False,
"external_dependencies": {
"python": [
"nfelib",
"erpbrasil.transmissao",
"erpbrasil.edoc",
"erpbrasil.assinatura",
]
},
}
32 changes: 32 additions & 0 deletions l10n_br_cte/constants/modal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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"),
]
21 changes: 21 additions & 0 deletions l10n_br_cte/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2019-2020 - Raphael Valyi Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from odoo import SUPERUSER_ID, api

from odoo.addons.spec_driven_model import hooks


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
hooks.register_hook(
env,
"l10n_br_cte",
"odoo.addons.l10n_br_cte_spec.models.v4_0.cte_tipos_basico_v4_00",
)

hooks.post_init_hook(
cr,
registry,
"l10n_br_cte",
"odoo.addons.l10n_br_cte_spec.models.v4_0.cte_tipos_basico_v4_00",
)
21 changes: 21 additions & 0 deletions l10n_br_cte/modal/modal_aereo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 KMEE
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="modal_aereo_peri_form_view" model="ir.ui.view">
<field name="name">modal.aereo.peri.form.view (in l10n_br_cte)</field>
<field name="model">l10n_br_cte.modal.aereo.peri</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="cte40_nONU" />
<field name="cte40_qTotEmb" />
<field name="cte40_qTotProd" />
<field name="cte40_uniAP" />
</group>
</sheet>
</form>
</field>
</record>
</odoo>
18 changes: 18 additions & 0 deletions l10n_br_cte/modal/modal_aquaviario.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 KMEE
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="modal_aquaviario_balsa_form_view" model="ir.ui.view">
<field name="name">modal.aquaviario.balsa.form.view (in l10n_br_cte)</field>
<field name="model">l10n_br_cte.modal.aquav.balsa</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="cte40_xBalsa" />
</group>
</sheet>
</form>
</field>
</record>
</odoo>
51 changes: 51 additions & 0 deletions l10n_br_cte/modal/modal_ferroviario.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 KMEE
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="modal_ferroviario_ferroenv_form_view" model="ir.ui.view">
<field name="name">res.partner.ferroenv.form.view (in l10n_br_cte)</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="cte40_CNPJ" />
<field name="cte40_xNome" />
<field name="cte40_cInt" />
<field name="cte40_IE" />
<field
name="cte40_enderFerro"
context="{
'form_view_ref': 'l10n_br_cte.res_partner_tenderfer_form_view'
}"
domain="[
('cnpj_cpf', '!=', False),
]"
/>
</group>
</sheet>
</form>
</field>
</record>

<record id="res_partner_tenderfer_form_view" model="ir.ui.view">
<field name="name">res.partner.tenderfer.form.view</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="cte40_xLgr" />
<field name="cte40_nro" />
<field name="cte40_xCpl" />
<field name="cte40_xBairro" />
<field name="cte40_cMun" />
<field name="cte40_xMun" />
<field name="cte40_CEP" />
<field name="cte40_UF" />
</group>
</sheet>
</form>
</field>
</record>
</odoo>
25 changes: 25 additions & 0 deletions l10n_br_cte/modal/modal_rodoviario.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 KMEE
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="modal_rodoviario_occ_form_view" model="ir.ui.view">
<field name="name">modal.rodoviario.occ.form.view (in l10n_br_cte)</field>
<field name="model">l10n_br_cte.modal.rodo.occ</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="cte40_serie" />
<field name="cte40_nOcc" />
<field name="cte40_dEmi" />
<field name="cte40_CNPJ" />
<field name="cte40_cInt" />
<field name="cte40_IE" />
<field name="cte40_UF" />
<field name="cte40_fone" />
</group>
</sheet>
</form>
</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions l10n_br_cte/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from . import document
from . import res_company
from . import res_partner
from . import document_related
from . import document_line
from . import res_config_settings
from . import ferroviario
from . import rodoviario
from . import aereo
from . import dutoviario
from . import aquaviario
from . import document_cargo_quantity_infos
from . import document_supplement
from . import document_transported_vehicles
from . import normal_cte_infos
Loading