-
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.
- Loading branch information
1 parent
ae58e80
commit b7b3d5b
Showing
6 changed files
with
61 additions
and
0 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
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://engenere.one", | ||
"version": "14.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 account_payment_mode |
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 = "account.payment.mode" | ||
|
||
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,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.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,17 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="eng_cnab_filename_payment_mode_form" model="ir.ui.view"> | ||
<field name="name">eng_cnab_filename.payment_mode.form</field> | ||
<field name="model">account.payment.mode</field> | ||
<field name="priority">99</field> | ||
<field | ||
name="inherit_id" | ||
ref="l10n_br_account_payment_order.l10n_br_account_payment_mode_form" | ||
/> | ||
<field name="arch" type="xml"> | ||
<field name="cnab_sequence_id" position="after"> | ||
<field name="filename_sequence_id" /> | ||
</field> | ||
</field> | ||
</record> | ||
</odoo> |