Skip to content

Commit

Permalink
Merge pull request #40 from Engenere/16.0-mig-eng_cnab_filename
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniospneto authored Feb 4, 2025
2 parents b865b4d + a86b3e3 commit 3b78864
Show file tree
Hide file tree
Showing 24 changed files with 1,185 additions and 11 deletions.
8 changes: 4 additions & 4 deletions eng_account_reconcile_usability/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ Authors
Maintainers
-----------

.. |maintainer-antoniospn| image:: https://github.com/antoniospn.png?size=40px
:target: https://github.com/antoniospn
:alt: antoniospn
.. |maintainer-antoniospneto| image:: https://github.com/antoniospneto.png?size=40px
:target: https://github.com/antoniospneto
:alt: antoniospneto
.. |maintainer-cristianomafrajunior| image:: https://github.com/cristianomafrajunior.png?size=40px
:target: https://github.com/cristianomafrajunior
:alt: cristianomafrajunior

Current maintainers:

|maintainer-antoniospn| |maintainer-cristianomafrajunior|
|maintainer-antoniospneto| |maintainer-cristianomafrajunior|

This module is part of the `Engenere/engenere-addons <https://github.com/Engenere/engenere-addons/tree/16.0/eng_account_reconcile_usability>`_ project on GitHub.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h1>Authors</h1>
<div class="section" id="maintainers">
<h1>Maintainers</h1>
<p>Current maintainers:</p>
<p><a class="reference external image-reference" href="https://github.com/antoniospn"><img alt="antoniospn" src="https://github.com/antoniospn.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/cristianomafrajunior"><img alt="cristianomafrajunior" src="https://github.com/cristianomafrajunior.png?size=40px" /></a></p>
<p><a class="reference external image-reference" href="https://github.com/antoniospneto"><img alt="antoniospneto" src="https://github.com/antoniospneto.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/cristianomafrajunior"><img alt="cristianomafrajunior" src="https://github.com/cristianomafrajunior.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/Engenere/engenere-addons/tree/16.0/eng_account_reconcile_usability">Engenere/engenere-addons</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
Expand Down
89 changes: 89 additions & 0 deletions eng_cnab_filename/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
======================
CNAB Filename Sequence
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:48ac0d0ef240e56be9618f88d403c7343e360884884e967bb81166023b01405b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-Engenere%2Fengenere--addons-lightgray.png?logo=github
:target: https://github.com/Engenere/engenere-addons/tree/16.0/eng_cnab_filename
:alt: Engenere/engenere-addons

|badge1| |badge2| |badge3|

Este módulo permite a utilização dos códigos sequenciais do Odoo para
gerar nomes únicos para os arquivos de remessa (CNAB). Essa
funcionalidade é essencial para bancos que não aceitam o envio de
arquivos com nomes duplicados, garantindo a integridade e a unicidade
dos registros.

**Table of contents**

.. contents::
:local:

Configuration
=============

Para configurar este módulo, siga os passos abaixo:

1. Acesse **Faturamento > Configuração > CNAB Config**.
2. Selecione a configuração CNAB desejada.
3. Em **Sequência do Arquivo CNAB**, escolha uma sequência existente ou
crie uma nova.

..
**Observação:** Caso queira manter o comportamento padrão para a
geração do nome, deixe o campo **Sequência do Arquivo CNAB** em
branco.

Usage
=====

Ao criar e confirmar uma **Ordem de Débito**, o arquivo de remessa será
gerado automaticamente com o nome definido pela sequência configurada.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/Engenere/engenere-addons/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/Engenere/engenere-addons/issues/new?body=module:%20eng_cnab_filename%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

Maintainers
-----------

.. |maintainer-antoniospneto| image:: https://github.com/antoniospneto.png?size=40px
:target: https://github.com/antoniospneto
:alt: antoniospneto

Current maintainer:

|maintainer-antoniospneto|

This module is part of the `Engenere/engenere-addons <https://github.com/Engenere/engenere-addons/tree/16.0/eng_cnab_filename>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions eng_cnab_filename/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions eng_cnab_filename/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "CNAB Filename Sequence",
"summary": "Geração dos nomes de arquivo de remessa utilizando sequências do Odoo",
"license": "AGPL-3",
"author": "Engenere",
"maintainers": ["antoniospneto"],
"website": "https://github.com/Engenere/engenere-addons",
"version": "16.0.1.0.0",
"depends": ["l10n_br_account_payment_order"],
"data": [
"views/account_payment_mode.xml",
],
"installable": True,
}
2 changes: 2 additions & 0 deletions eng_cnab_filename/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import account_payment_order
from . import cnab_config
16 changes: 16 additions & 0 deletions eng_cnab_filename/models/account_payment_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from odoo import models


class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order"

def get_file_name(self, cnab_type):
"""
Sobrescreve a lógica para a criação do nome a partir do sequenciador.
"""
sequence = self.payment_mode_id.cnab_config_id.filename_sequence_id
if sequence:
filename = f"{sequence.next_by_id()}.REM"
else:
filename = super().get_file_name(cnab_type)
return filename
11 changes: 11 additions & 0 deletions eng_cnab_filename/models/cnab_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class AccountPaymentMode(models.Model):
_inherit = "l10n_br_cnab.config"

filename_sequence_id = fields.Many2one(
comodel_name="ir.sequence",
string="Sequência do nome do arquivo",
tracking=True,
)
3 changes: 3 additions & 0 deletions eng_cnab_filename/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
7 changes: 7 additions & 0 deletions eng_cnab_filename/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Para configurar este módulo, siga os passos abaixo:

1. Acesse **Faturamento > Configuração > CNAB Config**.
2. Selecione a configuração CNAB desejada.
3. Em **Sequência do Arquivo CNAB**, escolha uma sequência existente ou crie uma nova.

> **Observação:** Caso queira manter o comportamento padrão para a geração do nome, deixe o campo **Sequência do Arquivo CNAB** em branco.
1 change: 1 addition & 0 deletions eng_cnab_filename/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Este módulo permite a utilização dos códigos sequenciais do Odoo para gerar nomes únicos para os arquivos de remessa (CNAB). Essa funcionalidade é essencial para bancos que não aceitam o envio de arquivos com nomes duplicados, garantindo a integridade e a unicidade dos registros.
1 change: 1 addition & 0 deletions eng_cnab_filename/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ao criar e confirmar uma **Ordem de Débito**, o arquivo de remessa será gerado automaticamente com o nome definido pela sequência configurada.
Loading

0 comments on commit 3b78864

Please sign in to comment.