-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Showing
11 changed files
with
136 additions
and
118 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 |
---|---|---|
|
@@ -2,15 +2,15 @@ | |
# Luis Felipe Miléo - [email protected] | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models, fields, api | ||
from odoo import api, fields, models | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = 'account.move.line' | ||
_inherit = "account.move.line" | ||
|
||
date_scheduled = fields.Date(string='Data Prevista') | ||
date_scheduled = fields.Date(string="Data Prevista") | ||
|
||
@api.depends('move_id') | ||
@api.depends("move_id") | ||
def _compute_journal_entry_ref(self): | ||
for record in self: | ||
if record.name: | ||
|
@@ -20,11 +20,11 @@ def _compute_journal_entry_ref(self): | |
elif record.invoice_id and record.invoice_id.number: | ||
record.journal_entry_ref = record.invoice_id.number | ||
else: | ||
record.journal_entry_ref = '*' + str(record.move_id.id) | ||
record.journal_entry_ref = "*" + str(record.move_id.id) | ||
|
||
journal_entry_ref = fields.Char( | ||
compute='_compute_journal_entry_ref', | ||
string='Journal Entry Ref', store=True) | ||
compute="_compute_journal_entry_ref", string="Journal Entry Ref", store=True | ||
) | ||
|
||
@api.multi | ||
def get_balance(self): | ||
|
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 |
---|---|---|
|
@@ -2,44 +2,59 @@ | |
# Luis Felipe Miléo - [email protected] | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models, fields, api | ||
from odoo import api, fields, models | ||
from odoo.addons import decimal_precision as dp | ||
from odoo.tools.float_utils import float_round as round | ||
|
||
|
||
class PaymentLine(models.Model): | ||
_inherit = 'account.payment.line' | ||
_inherit = "account.payment.line" | ||
|
||
@api.model | ||
def _get_info_partner(self, partner_record): | ||
if not partner_record: | ||
return False | ||
st = partner_record.street or '' | ||
n = partner_record.street_number or '' | ||
st1 = partner_record.street2 or '' | ||
zip = partner_record.zip or '' | ||
city = partner_record.city_id.name or '' | ||
uf = partner_record.state_id.code or '' | ||
zip_city = city + '-' + uf + '\n' + zip | ||
cntry = partner_record.country_id and \ | ||
partner_record.country_id.name or '' | ||
cnpj = partner_record.cnpj_cpf or '' | ||
return partner_record.legal_name or '' + "\n" + cnpj + "\n" + st \ | ||
+ ", " + n + " " + st1 + "\n" + zip_city + "\n" + cntry | ||
st = partner_record.street or "" | ||
n = partner_record.street_number or "" | ||
st1 = partner_record.street2 or "" | ||
zip = partner_record.zip or "" | ||
city = partner_record.city_id.name or "" | ||
uf = partner_record.state_id.code or "" | ||
zip_city = city + "-" + uf + "\n" + zip | ||
cntry = partner_record.country_id and partner_record.country_id.name or "" | ||
cnpj = partner_record.cnpj_cpf or "" | ||
return ( | ||
partner_record.legal_name | ||
or "" | ||
+ "\n" | ||
+ cnpj | ||
+ "\n" | ||
+ st | ||
+ ", " | ||
+ n | ||
+ " " | ||
+ st1 | ||
+ "\n" | ||
+ zip_city | ||
+ "\n" | ||
+ cntry | ||
) | ||
|
||
@api.multi | ||
@api.depends('percent_interest', 'amount_currency') | ||
@api.depends("percent_interest", "amount_currency") | ||
def _compute_interest(self): | ||
for record in self: | ||
precision = record.env[ | ||
'decimal.precision'].precision_get('Account') | ||
precision = record.env["decimal.precision"].precision_get("Account") | ||
record.amount_interest = round( | ||
record.amount_currency * ( | ||
record.percent_interest / 100), precision) | ||
record.amount_currency * (record.percent_interest / 100), precision | ||
) | ||
|
||
linha_digitavel = fields.Char(string="Linha Digitável") | ||
percent_interest = fields.Float(string="Percentual de Juros", | ||
digits=dp.get_precision('Account')) | ||
amount_interest = fields.Float(string="Valor Juros", | ||
compute='_compute_interest', | ||
digits=dp.get_precision('Account')) | ||
percent_interest = fields.Float( | ||
string="Percentual de Juros", digits=dp.get_precision("Account") | ||
) | ||
amount_interest = fields.Float( | ||
string="Valor Juros", | ||
compute="_compute_interest", | ||
digits=dp.get_precision("Account"), | ||
) |
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 |
---|---|---|
|
@@ -2,19 +2,20 @@ | |
# @author Luis Felipe Miléo - [email protected] | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models, fields | ||
from odoo import fields, models | ||
|
||
|
||
class AccountPaymentMode(models.Model): | ||
_inherit = 'account.payment.mode' | ||
_inherit = "account.payment.mode" | ||
|
||
internal_sequence_id = fields.Many2one('ir.sequence', 'Sequência') | ||
instrucoes = fields.Text('Instruções de cobrança') | ||
invoice_print = fields.Boolean( | ||
'Gerar relatorio na conclusão da fatura?') | ||
internal_sequence_id = fields.Many2one("ir.sequence", "Sequência") | ||
instrucoes = fields.Text("Instruções de cobrança") | ||
invoice_print = fields.Boolean("Gerar relatorio na conclusão da fatura?") | ||
|
||
_sql_constraints = [ | ||
('internal_sequence_id_unique', | ||
'unique(internal_sequence_id)', | ||
'Sequência já usada! Crie uma sequência unica para cada modo') | ||
( | ||
"internal_sequence_id_unique", | ||
"unique(internal_sequence_id)", | ||
"Sequência já usada! Crie uma sequência unica para cada modo", | ||
) | ||
] |
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 |
---|---|---|
|
@@ -2,20 +2,22 @@ | |
# Magno Costa <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import models, api, _ | ||
from odoo import _, api, models | ||
from odoo.exceptions import Warning as UserError | ||
|
||
|
||
class ResPartnerBank(models.Model): | ||
_inherit = 'res.partner.bank' | ||
_inherit = "res.partner.bank" | ||
|
||
@api.multi | ||
@api.constrains('bra_number') | ||
@api.constrains("bra_number") | ||
def check_bra_number(self): | ||
for record in self: | ||
if record.bank_id.code_bc == '033': | ||
if record.bank_id.code_bc == "033": | ||
if len(record.bra_number) > 4: | ||
raise UserError(_( | ||
u'O cógido da Agencia Bancaria do Santander' | ||
u' deve ter no máximo quatro caracteres.' | ||
)) | ||
raise UserError( | ||
_( | ||
u"O cógido da Agencia Bancaria do Santander" | ||
u" deve ter no máximo quatro caracteres." | ||
) | ||
) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
No configuration required. | ||
No configuration required. |
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 |
---|---|---|
|
@@ -2,4 +2,3 @@ | |
* Fernando Marcato <[email protected]> | ||
* Hendrix Costa <[email protected]> | ||
* Magno Costa <[email protected]> | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
The development of this module has been financially supported by: | ||
|
||
* KMEE INFORMATICA LTDA - www.kmee.com.br | ||
* AKRETION LTDA - www.akretion.com | ||
* AKRETION LTDA - www.akretion.com |
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
Oops, something went wrong.