Skip to content

Commit

Permalink
[ADD] l10n_br_cte
Browse files Browse the repository at this point in the history
  • Loading branch information
ygcarvalh committed Jul 7, 2023
1 parent ff56a52 commit 8f4d3d3
Show file tree
Hide file tree
Showing 22 changed files with 969 additions and 0 deletions.
118 changes: 118 additions & 0 deletions l10n_br_cte/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
====
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 <ygor.carvalho@kmee.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-ygcarvalh| image:: https://github.com/ygcarvalh.png?size=40px
:target: https://github.com/ygcarvalh
:alt: ygcarvalh

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ygcarvalh|

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.
1 change: 1 addition & 0 deletions l10n_br_cte/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
33 changes: 33 additions & 0 deletions l10n_br_cte/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "CT-e",
"summary": "Brazilian Eletronic Invoice CT-e",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "KMEE, Odoo Community Association (OCA)",
"maintainers": ["ygcarvalh"],
"development_status": "Alpha",
"website": "https://github.com/OCA/l10n-brazil",
"depends": [
"l10n_br_fiscal",
"l10n_br_cte_spec",
"spec_driven_model",
],
"data": [
# "views/res_company.xml",
# "security/l10n_br_fiscal_document.xml",
# "views/document_view.xml",
],
"demo": [],
"installable": True,
"external_dependencies": {
"python": [
"nfelib>=2.0.0",
"erpbrasil.transmissao",
"erpbrasil.edoc",
"erpbrasil.edoc.pdf",
],
},
}
52 changes: 52 additions & 0 deletions l10n_br_cte/constants/cte.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (C) 2023 Ygor Carvalho - KMEE
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

CTE_VERSION = [("3.00", "3.00")]

CTE_DANFE_LAYOUT = [("portrait", "Retrato"), ("landscape", "Paisagem")]

CTE_TRANSMISSIONS = [
("1", "Normal"),
("3", "Regime Especial NFF"),
("4", "EPEC pela SVC"),
("5", "Contingência FSDA"),
("7", "Autorização pela SVC-RS"),
("8", "Autorização pela SVC-SP"),
]

CTE_ENVIRONMENT = [("1", "Produção"), ("2", "Homologação")]

CTE_TYPE = [
("0", "CT-e Normal"),
("1", "CT-e de Complemento de Valores"),
("2", "CT-e de Substituição"),
]

CTE_ISSUER_TYPE = [
("0", "Emissão de CT-e com aplicativo do contribuinte"),
("3", "Emissão de CT-e pelo contribuinte com aplicativo fornecido pelo SEBRAE"),
]

CTE_MODAL = [
("01", "Rodoviário"),
("02", "Aéreo"),
("03", "Aquaviário"),
("04", "Ferroviário"),
("05", "Dutoviário"),
("06", "Multimodal"),
]

CTE_SERVICE_TYPE = [
("0", "Normal"),
("1", "Subcontratação"),
("2", "Redespacho"),
("3", "Redespacho Intermediário"),
("4", "Serviço Vinculado a Multimodal"),
]

CTE_SERVICE_PROVIDER = [
("0", "Remetente"),
("1", "Expedidor"),
("2", "Recebedor"),
("3", "Destinatário"),
]
6 changes: 6 additions & 0 deletions l10n_br_cte/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from . import document
from . import res_partner
from . import res_company
from . import invalidate_number
from . import document_related
from . import document_line
128 changes: 128 additions & 0 deletions l10n_br_cte/models/document.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo.addons.spec_driven_model.models import spec_models


class CTe(spec_models.StackedModel):

_name = "l10n_br_fiscal.document"
_inherit = ["l10n_br_fiscal.document", "cte.30.tcteos_ide", "cte.30.tcteos_cobr"]
_stacked = "cte.30.tcteos_ide"
_field_prefix = "cte30_"
_schema_name = "cte"
_schema_version = "3.0.0"
_odoo_module = "l10n_br_cte"
_spec_module = "odoo.addons.l10n_br_cte_spec.models.v3_0.cte_tipos_basico_v3_00"
_spec_tab_name = "cte"
_cte_search_keys = ["cte30_Id"]

# TODO: INFCTE_TREE

##########################
# CT-e tag: infCte
##########################
# TODO

##########################
# CT-e tag: ide
##########################

# TODO

##########################
# CT-e tag: toma3
##########################

# TODO

##########################
# CT-e tag: toma4
##########################

# TODO

##########################
# CT-e tag: compl
##########################

# TODO

##########################
# CT-e tag: emit
##########################

# TODO

##########################
# CT-e tag: rem
##########################

# TODO

##########################
# CT-e tag: exped
##########################

# TODO

##########################
# CT-e tag: receb
##########################

# TODO

##########################
# CT-e tag: dest
##########################

# TODO

##########################
# CT-e tag: vPrest
##########################

# TODO

##########################
# CT-e tag: imp
##########################

# TODO

##########################
# CT-e tag: infcCTeNorm
##########################

# TODO

##########################
# CT-e tag: cobr
##########################

# TODO

##########################
# CT-e tag: infCteComp
##########################

# TODO

##########################
# CT-e tag: autXML
##########################

# TODO

##########################
# CT-e tag: infRespTec
##########################

# TODO

##########################
# CT-e tag: infSolicNFF
##########################

# TODO
10 changes: 10 additions & 0 deletions l10n_br_cte/models/document_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class CTeLine(models.Model):

_name = "l10n_br_fiscal.document.line"
_inherit = ["l10n_br_fiscal.document.line"]
10 changes: 10 additions & 0 deletions l10n_br_cte/models/document_related.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class CTeRelated(models.Model):

_name = "l10n_br_fiscal.document.related"
_inherit = ["l10n_br_fiscal.document.related"]
9 changes: 9 additions & 0 deletions l10n_br_cte/models/invalidate_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class InvalidateNumber(models.Model):

_inherit = "l10n_br_fiscal.invalidate.number"
10 changes: 10 additions & 0 deletions l10n_br_cte/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.addons.spec_driven_model.models import spec_models


class ResCompany(spec_models.SpecModel):

_name = "res.company"
_inherit = ["res.company", "cte.30.tcte_ide"]
Loading

0 comments on commit 8f4d3d3

Please sign in to comment.