-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Engenere/16.0-mig-eng_cnab_filename
- Loading branch information
Showing
24 changed files
with
1,185 additions
and
11 deletions.
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
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
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,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. |
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 @@ | ||
from . import models |
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 @@ | ||
{ | ||
"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, | ||
} |
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 account_payment_order | ||
from . import cnab_config |
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,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 |
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,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, | ||
) |
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,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
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,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. |
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 @@ | ||
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. |
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 @@ | ||
Ao criar e confirmar uma **Ordem de Débito**, o arquivo de remessa será gerado automaticamente com o nome definido pela sequência configurada. |
Oops, something went wrong.