Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][REF] Atualização da bibliotecas do Pre-commit: Remoção de Linhas Vazias #2749

Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
edcf085
[REF] l10n_br_account: Remove empty Lines, necessary for the new vers…
mbcosta Oct 25, 2023
b6836aa
[REF] l10n_br_account_nfe: Remove empty Lines, necessary for the new …
mbcosta Oct 25, 2023
82c3824
[REF] l10n_br_account_payment_brcobranca: Remove empty Lines, necessa…
mbcosta Oct 25, 2023
705f12c
[REF] l10n_br_account_payment_order: Remove empty Lines, necessary fo…
mbcosta Oct 25, 2023
0521306
[REF] l10n_br_base: Remove empty Lines, necessary for the new version…
mbcosta Oct 25, 2023
00e8607
[REF] l10n_br_cnab_structure: Remove empty Lines, necessary for the n…
mbcosta Oct 25, 2023
61225a4
[REF] l10n_br_coa: Remove empty Lines, necessary for the new version …
mbcosta Oct 25, 2023
ef9d4de
[REF] l10n_br_contract: Remove empty Lines, necessary for the new ver…
mbcosta Oct 25, 2023
65d9869
[REF] l10n_br_delivery: Remove empty Lines, necessary for the new ver…
mbcosta Oct 25, 2023
47f2411
[REF] l10n_br_fiscal: Remove empty Lines, necessary for the new versi…
mbcosta Oct 25, 2023
b50b15b
[REF] l10n_br_hr: Remove empty Lines, necessary for the new version o…
mbcosta Oct 25, 2023
2837536
[REF] l10n_br_ie_search: Remove empty Lines, necessary for the new ve…
mbcosta Oct 25, 2023
a3a94db
[REF] l10n_br_nfe: Remove empty Lines, necessary for the new version …
mbcosta Oct 25, 2023
c33a95a
[REF] l10n_br_nfse: Remove empty Lines, necessary for the new version…
mbcosta Oct 25, 2023
aac8448
[REF] l10n_br_nfse_ginfes: Remove empty Lines, necessary for the new …
mbcosta Oct 25, 2023
bbaf5f6
[REF] l10n_br_nfse_paulistana: Remove empty Lines, necessary for the …
mbcosta Oct 25, 2023
5c04987
[REF] l10n_br_portal: Remove empty Lines, necessary for the new versi…
mbcosta Oct 25, 2023
cb51aaa
[REF] l10n_br_pos: Remove empty Lines, necessary for the new version …
mbcosta Oct 25, 2023
519ab37
[REF] l10n_br_pos_nfce: Remove empty Lines, necessary for the new ver…
mbcosta Oct 25, 2023
477e28e
[REF] l10n_br_product_contract: Remove empty Lines, necessary for the…
mbcosta Oct 25, 2023
450dc9f
[REF] l10n_br_purchase: Remove empty Lines, necessary for the new ver…
mbcosta Oct 25, 2023
99585b8
[REF] l10n_br_purchase_request: Remove empty Lines, necessary for the…
mbcosta Oct 25, 2023
a9bb72c
[REF] l10n_br_repair: Remove empty Lines, necessary for the new versi…
mbcosta Oct 25, 2023
5f34153
[REF] l10n_br_resource: Remove empty Lines, necessary for the new ver…
mbcosta Oct 25, 2023
5c6d48e
[REF] l10n_br_sale: Remove empty Lines, necessary for the new version…
mbcosta Oct 25, 2023
36ef0f5
[REF] l10n_br_sale_blanket_order: Remove empty Lines, necessary for t…
mbcosta Oct 25, 2023
44b6be6
[REF] l10n_br_sale_invoice_plan: Remove empty Lines, necessary for th…
mbcosta Oct 25, 2023
b38d703
[REF] l10n_br_sale_stock: Remove empty Lines, necessary for the new v…
mbcosta Oct 25, 2023
e4feaaa
[REF] l10n_br_stock_account: Remove empty Lines, necessary for the ne…
mbcosta Oct 25, 2023
88bc0cf
[REF] l10n_br_stock_account_report: Remove empty Lines, necessary for…
mbcosta Oct 25, 2023
3fbc6a4
[REF] l10n_br_website_sale: Remove empty Lines, necessary for the new…
mbcosta Oct 25, 2023
77bcea4
[REF] l10n_br_zip: Remove empty Lines, necessary for the new version …
mbcosta Oct 25, 2023
c96e709
[REF] payment_bacen_pix: Remove empty Lines, necessary for the new ve…
mbcosta Oct 25, 2023
c89a428
[WIP][FIX] GH actions
rvalyi Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion l10n_br_account/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def compute_all(
sum_repartition_factor = sum(tax_repartition_lines.mapped("factor"))

if fiscal_tax:

if fiscal_tax.get("base") < 0:
sign = -1
fiscal_tax["base"] = -fiscal_tax.get("base")
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account/report/account_invoice_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class AccountInvoiceReport(models.Model):

_inherit = "account.invoice.report"

issuer = fields.Selection(
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_nfe/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def load_simples_nacional_demo(env, registry):
"l10n_br_base.empresa_simples_nacional", raise_if_not_found=False
)
if company_sn:

# Allow all companies for OdooBot user and set default user company
companies = env["res.company"].search([])
env.user.company_ids = [(6, 0, companies.ids)]
Expand Down
3 changes: 0 additions & 3 deletions l10n_br_account_nfe/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@


class DocumentNfe(models.Model):

_inherit = "l10n_br_fiscal.document"

##########################
Expand Down Expand Up @@ -101,7 +100,6 @@ def _compute_nfe40_detpag(self):
for field in det_pag_vals
}
if det_pag_vals != detpag_current:

rec.nfe40_detPag = [(2, detpag, 0) for detpag in rec.nfe40_detPag.ids]
rec.nfe40_detPag = [(0, 0, det_pag_vals)]

Expand Down Expand Up @@ -142,7 +140,6 @@ def _is_without_payment(self):
@api.constrains("nfe40_detPag", "state_edoc")
def _check_fiscal_payment_mode(self):
for rec in self:

if (
rec.state_edoc == "em_digitacao"
or not rec._need_compute_nfe_tags()
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_nfe/models/leiauteNFe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class DetPag(models.AbstractModel):

_inherit = "nfe.40.detpag"

nfe40_indPag = fields.Selection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def multi_move_import(self, file_stream, ftype="csv"):
return res_cnab_log

def _move_import(self, parser, file_stream, result_row_list=None, ftype="csv"):

# Overwrite this method to create the CNAB Return Log and change
# the warning message when the file don't has any line to create
# the Journal Entry, because in CNAB exist the case where
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_payment_brcobranca/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def generate_boleto_pdf(self):
)

def _get_brcobranca_boleto(self, boletos):

content = json.dumps(boletos)
f = open(tempfile.mktemp(), "w")
f.write(content)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ class AccountMoveLine(models.Model):
# brcobranca/boleto/itau_spec.rb

def send_payment(self):

# super(AccountMoveLine, self).send_payment()
wrapped_boleto_list = []

for move_line in self:

bank_account_id = move_line.payment_mode_id.fixed_journal_id.bank_account_id
bank_name_brcobranca = get_brcobranca_bank(
bank_account_id, move_line.payment_mode_id.payment_method_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def _prepare_remessa_unicred_400(self, remessa_values):
remessa_values["codigo_beneficiario"] = int(self.payment_mode_id.code_convetion)

def _prepare_remessa_sicredi_240(self, remessa_values):

bank_account_id = self.journal_id.bank_account_id
remessa_values.update(
{
Expand Down Expand Up @@ -167,7 +166,6 @@ def generate_payment_file(self):
return remessa, self.get_file_name(cnab_type)

def _get_brcobranca_remessa(self, bank_brcobranca, remessa_values, cnab_type):

content = json.dumps(remessa_values)
f = open(tempfile.mktemp(), "w")
f.write(content)
Expand Down
7 changes: 0 additions & 7 deletions l10n_br_account_payment_brcobranca/parser/cnab_file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def parser_for(cls, parser_name):
return parser_name == "cnab240"

def parse(self, filebuffer):

files = {"data": base64.b64decode(filebuffer)}

data = self._get_brcobranca_retorno(files)
Expand All @@ -76,7 +75,6 @@ def parse(self, filebuffer):
yield self.result_row_list

def _get_brcobranca_retorno(self, files):

bank_name_brcobranca = dict_brcobranca_bank[self.bank.code_bc]
brcobranca_api_url = get_brcobranca_api_url(self.env)
# Ex.: "http://boleto_cnab_api:9292/api/retorno"
Expand Down Expand Up @@ -118,7 +116,6 @@ def _get_date_format(self, bank_name_brcobranca):
return zeros_date, date_format

def process_return_file(self, data):

# Forma de Lançamento do Retorno
# Em caso de Pagamento/Liquidação é feita a criação de uma Entrada de
# Diário para cada linha do arquivo CNAB com os valores de desconto,
Expand Down Expand Up @@ -199,7 +196,6 @@ def process_return_file(self, data):
registration_code_allowed = 1

for linha_cnab in data:

if int(linha_cnab["codigo_registro"]) != registration_code_allowed:
# Bradesco
# Existe o codigo de registro 9 que eh um totalizador
Expand Down Expand Up @@ -338,7 +334,6 @@ def process_return_file(self, data):
linha_cnab.get("data_vencimento")
and linha_cnab.get("data_vencimento") != zeros_date
):

due_date = datetime.datetime.strptime(
str(linha_cnab.get("data_vencimento")), date_format
).date()
Expand Down Expand Up @@ -367,7 +362,6 @@ def process_return_file(self, data):

# Caso de Pagamento deve criar os Lançamentos de Diário
if cod_ocorrencia in cnab_liq_move_code:

row_list, log_event_payment = self._get_accounting_entries(
linha_cnab, account_move_line, payment_lines
)
Expand Down Expand Up @@ -473,7 +467,6 @@ def _get_accounting_entries(self, linha_cnab, account_move_line, payment_lines):
valor_juros_mora = self.cnab_str_to_float(linha_cnab["juros_mora"])

if valor_juros_mora > 0.0:

row_list.append(
{
"name": "Valor Juros Mora (boleto) "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def setUpClass(cls):
}

def _run_boleto_remessa(self, invoice, boleto_file, remessa_file):

# I validate invoice
invoice.action_post()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ def _import_file(self, file_name):
return self.account_move_obj.browse(action["res_id"])

def test_valor_menor_1(self):

mocked_response = [
{
"codigo_registro": "1",
Expand Down Expand Up @@ -282,7 +281,6 @@ def test_valor_menor_1(self):
self.assertEqual("Banco UNICRED - Conta 371", log.name)

def test_valor_menor_2(self):

mocked_response = [
{
"codigo_registro": "1",
Expand Down Expand Up @@ -435,7 +433,6 @@ def test_valor_menor_2(self):
self.assertEqual(self.invoice_unicred_1.payment_state, "paid")

def test_valor_maior_3(self):

mocked_response = [
{
"codigo_registro": "1",
Expand Down Expand Up @@ -586,7 +583,6 @@ def test_valor_maior_3(self):
self.assertEqual("Banco UNICRED - Conta 371", log.name)

def test_valor_maior_4(self):

mocked_response = [
{
"codigo_registro": "1",
Expand Down Expand Up @@ -739,7 +735,6 @@ def test_valor_maior_4(self):
self.assertEqual(self.invoice_unicred_2.payment_state, "paid")

def test_ailos_return(self):

mocked_response = [
{
"codigo_registro": "03",
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_payment_order/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class AccountJournal(models.Model):

_inherit = "account.journal"

bank_code_bc = fields.Char(related="bank_id.code_bc")
1 change: 0 additions & 1 deletion l10n_br_account_payment_order/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ def load_cnab_info(self):
filtered_invoice_ids.create_account_payment_line()

def unlink(self):

# Verificar se é necessário solicitar a Baixa no caso de CNAB
cnab_already_start = False
for l_aml in self.mapped("line_ids"):
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_payment_order/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def create_payment_line_from_move_line(self, payment_order):
:return:
"""
for record in self:

cnab_state = "added"
if record.reconciled:
cnab_state = "added_paid"
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_payment_order/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class AccountPayment(models.Model):
_inherit = "account.payment"

def action_post(self):

for record in self:
if (
record.payment_method_code in BR_CODES_PAYMENT_ORDER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def _cnab_already_start(self):
return result

def update_cnab_for_cancel_invoice(self):

cnab_already_start = self._cnab_already_start()
if cnab_already_start:
reason_write_off = (
Expand Down
1 change: 0 additions & 1 deletion l10n_br_base/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def _check_cnpj_inscr_est(self):
def _check_cnpj_cpf(self):
result = True
for record in self:

disable_cnpj_ie_validation = record.env[
"ir.config_parameter"
].sudo().get_param(
Expand Down
6 changes: 0 additions & 6 deletions l10n_br_cnab_structure/cnab/cnab.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class RecordType(Enum):


class CnabField:

__slots__ = ["position", "value", "name"]

def __init__(self, position: int, value: str, name: str = "") -> None:
Expand All @@ -26,7 +25,6 @@ def __init__(self, position: int, value: str, name: str = "") -> None:


class CnabLine:

type: RecordType
fields: List[CnabField]

Expand Down Expand Up @@ -54,12 +52,10 @@ def output(self) -> str:
return "".join(self.sorted_values().values())

def asdict(self):

return {"type": self.type.name, "fields": self.sorted_values()}


class CnabDetailRecord:

segments: List[CnabLine]

def __init__(self, name: str) -> None:
Expand All @@ -80,7 +76,6 @@ def asdict(self):


class CnabBatch:

header: CnabLine
detail_records: List[CnabDetailRecord]
trailer: CnabLine
Expand Down Expand Up @@ -116,7 +111,6 @@ def asdict(self):


class Cnab:

header: CnabLine
batches: List[CnabBatch]
trailer: CnabLine
Expand Down
1 change: 0 additions & 1 deletion l10n_br_cnab_structure/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class AccountJournal(models.Model):

_inherit = "account.journal"

used_to_import_cnab = fields.Boolean(string="Journal used for import CNAB")
Expand Down
2 changes: 0 additions & 2 deletions l10n_br_cnab_structure/models/cnab_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class CNABBatch(models.Model):

_name = "l10n_br_cnab.batch"
_description = "A batch of lines in a CNAB structure."

Expand Down Expand Up @@ -110,7 +109,6 @@ def unlink(self):
return super(CNABBatch, self).unlink()

def check_batch(self):

if self.cnab_structure_id.cnab_format != "240":
raise UserError(
_(f"{self.name}: A batch must belong to a CNAB 240 structure!")
Expand Down
2 changes: 0 additions & 2 deletions l10n_br_cnab_structure/models/cnab_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


class CNABLine(models.Model):

_name = "l10n_br_cnab.line"
_description = "Lines that make up the CNAB."
_order = "sequence, id"
Expand Down Expand Up @@ -225,7 +224,6 @@ def unlink(self):
return super(CNABLine, self).unlink()

def check_line(self):

cnab_fields = self.field_ids.sorted(key=lambda r: r.start_pos)

if len(cnab_fields) == 0:
Expand Down
1 change: 0 additions & 1 deletion l10n_br_cnab_structure/models/cnab_line_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


class CNABField(models.Model):

_name = "l10n_br_cnab.line.field"
_description = "Fields in CNAB lines."
_order = "cnab_line_id, start_pos"
Expand Down
2 changes: 0 additions & 2 deletions l10n_br_cnab_structure/models/cnab_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class CNABStructure(models.Model):

_name = "l10n_br_cnab.structure"
_description = (
"An structure with header, body and trailer that make up the CNAB structure."
Expand Down Expand Up @@ -363,7 +362,6 @@ def action_draft(self):
self.write({"state": "draft"})

def check_structure(self):

for line in self.line_ids:
line.check_line()

Expand Down
1 change: 0 additions & 1 deletion l10n_br_cnab_structure/models/l10n_br_cnab_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class CNABReturnEvent(models.Model):

_inherit = "l10n_br_cnab.return.event"

# BASE FIELDS #
Expand Down
1 change: 0 additions & 1 deletion l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class L10nBrCNABReturnLog(models.Model):

_inherit = "l10n_br_cnab.return.log"

journal_id = fields.Many2one(
Expand Down
1 change: 0 additions & 1 deletion l10n_br_cnab_structure/tests/test_cnab_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ def test_cnab_structure_states(self):
self.assertEqual(cnab_structure.state, "draft")

def test_field_select_wizard(self):

cnab_field_id = self._create_valid_cnab_structure().line_ids[0].field_ids[0]
wiz_action = cnab_field_id.action_change_field_sending()

Expand Down
Loading
Loading