From edcf08588f1828515f84e83d94e78cba8e5bc075 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:26:22 -0300 Subject: [PATCH 01/34] [REF] l10n_br_account: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_account/models/account_tax.py | 1 - l10n_br_account/report/account_invoice_report.py | 1 - 2 files changed, 2 deletions(-) diff --git a/l10n_br_account/models/account_tax.py b/l10n_br_account/models/account_tax.py index 0fda34eb90d2..599200edf851 100644 --- a/l10n_br_account/models/account_tax.py +++ b/l10n_br_account/models/account_tax.py @@ -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") diff --git a/l10n_br_account/report/account_invoice_report.py b/l10n_br_account/report/account_invoice_report.py index 8c8563c66cee..91c56f3d3631 100644 --- a/l10n_br_account/report/account_invoice_report.py +++ b/l10n_br_account/report/account_invoice_report.py @@ -11,7 +11,6 @@ class AccountInvoiceReport(models.Model): - _inherit = "account.invoice.report" issuer = fields.Selection( From b6836aa63c01b68274d675cad3e287823391ec91 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:29:22 -0300 Subject: [PATCH 02/34] [REF] l10n_br_account_nfe: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_account_nfe/hooks.py | 1 - l10n_br_account_nfe/models/document.py | 3 --- l10n_br_account_nfe/models/leiauteNFe.py | 1 - 3 files changed, 5 deletions(-) diff --git a/l10n_br_account_nfe/hooks.py b/l10n_br_account_nfe/hooks.py index 738fcbdb1817..351792dcf3ff 100644 --- a/l10n_br_account_nfe/hooks.py +++ b/l10n_br_account_nfe/hooks.py @@ -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)] diff --git a/l10n_br_account_nfe/models/document.py b/l10n_br_account_nfe/models/document.py index 37c166701d5f..1e70fe075d96 100644 --- a/l10n_br_account_nfe/models/document.py +++ b/l10n_br_account_nfe/models/document.py @@ -19,7 +19,6 @@ class DocumentNfe(models.Model): - _inherit = "l10n_br_fiscal.document" ########################## @@ -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)] @@ -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() diff --git a/l10n_br_account_nfe/models/leiauteNFe.py b/l10n_br_account_nfe/models/leiauteNFe.py index 6e219856c60b..5370d15acf8f 100644 --- a/l10n_br_account_nfe/models/leiauteNFe.py +++ b/l10n_br_account_nfe/models/leiauteNFe.py @@ -6,7 +6,6 @@ class DetPag(models.AbstractModel): - _inherit = "nfe.40.detpag" nfe40_indPag = fields.Selection( From 82c38240ce879c5853febdfb6d534253c5204a06 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:31:23 -0300 Subject: [PATCH 03/34] [REF] l10n_br_account_payment_brcobranca: Remove empty Lines, necessary for the new version of pre-commit. --- .../models/account_journal.py | 1 - l10n_br_account_payment_brcobranca/models/account_move.py | 1 - .../models/account_move_line.py | 2 -- .../models/account_payment_order.py | 2 -- .../parser/cnab_file_parser.py | 7 ------- .../tests/test_payment_order.py | 1 - .../tests/test_return_import.py | 5 ----- 7 files changed, 19 deletions(-) diff --git a/l10n_br_account_payment_brcobranca/models/account_journal.py b/l10n_br_account_payment_brcobranca/models/account_journal.py index f3b2af8a1798..d2faebaadb52 100644 --- a/l10n_br_account_payment_brcobranca/models/account_journal.py +++ b/l10n_br_account_payment_brcobranca/models/account_journal.py @@ -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 diff --git a/l10n_br_account_payment_brcobranca/models/account_move.py b/l10n_br_account_payment_brcobranca/models/account_move.py index 661aa53819db..c9c6e8ef8f4a 100644 --- a/l10n_br_account_payment_brcobranca/models/account_move.py +++ b/l10n_br_account_payment_brcobranca/models/account_move.py @@ -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) diff --git a/l10n_br_account_payment_brcobranca/models/account_move_line.py b/l10n_br_account_payment_brcobranca/models/account_move_line.py index 136608882a06..c580b8cbe6d6 100644 --- a/l10n_br_account_payment_brcobranca/models/account_move_line.py +++ b/l10n_br_account_payment_brcobranca/models/account_move_line.py @@ -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 diff --git a/l10n_br_account_payment_brcobranca/models/account_payment_order.py b/l10n_br_account_payment_brcobranca/models/account_payment_order.py index feff110ce3e4..49901681c25d 100644 --- a/l10n_br_account_payment_brcobranca/models/account_payment_order.py +++ b/l10n_br_account_payment_brcobranca/models/account_payment_order.py @@ -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( { @@ -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) diff --git a/l10n_br_account_payment_brcobranca/parser/cnab_file_parser.py b/l10n_br_account_payment_brcobranca/parser/cnab_file_parser.py index bf858fe2f40a..eeeca275d0dd 100644 --- a/l10n_br_account_payment_brcobranca/parser/cnab_file_parser.py +++ b/l10n_br_account_payment_brcobranca/parser/cnab_file_parser.py @@ -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) @@ -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" @@ -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, @@ -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 @@ -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() @@ -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 ) @@ -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) " diff --git a/l10n_br_account_payment_brcobranca/tests/test_payment_order.py b/l10n_br_account_payment_brcobranca/tests/test_payment_order.py index 18163e0a799a..6610ab5a61fd 100644 --- a/l10n_br_account_payment_brcobranca/tests/test_payment_order.py +++ b/l10n_br_account_payment_brcobranca/tests/test_payment_order.py @@ -85,7 +85,6 @@ def setUpClass(cls): } def _run_boleto_remessa(self, invoice, boleto_file, remessa_file): - # I validate invoice invoice.action_post() diff --git a/l10n_br_account_payment_brcobranca/tests/test_return_import.py b/l10n_br_account_payment_brcobranca/tests/test_return_import.py index 0fc3c0c7e58d..7044266d06b6 100644 --- a/l10n_br_account_payment_brcobranca/tests/test_return_import.py +++ b/l10n_br_account_payment_brcobranca/tests/test_return_import.py @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", From 705f12cb49c59ee8def9fe298b3d9207496745c8 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:33:59 -0300 Subject: [PATCH 04/34] [REF] l10n_br_account_payment_order: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_account_payment_order/models/account_journal.py | 1 - l10n_br_account_payment_order/models/account_move.py | 1 - l10n_br_account_payment_order/models/account_move_line.py | 1 - l10n_br_account_payment_order/models/account_payment.py | 1 - .../models/l10n_br_cnab_change_methods.py | 1 - 5 files changed, 5 deletions(-) diff --git a/l10n_br_account_payment_order/models/account_journal.py b/l10n_br_account_payment_order/models/account_journal.py index 57195750219d..6d0e4f751757 100644 --- a/l10n_br_account_payment_order/models/account_journal.py +++ b/l10n_br_account_payment_order/models/account_journal.py @@ -5,7 +5,6 @@ class AccountJournal(models.Model): - _inherit = "account.journal" bank_code_bc = fields.Char(related="bank_id.code_bc") diff --git a/l10n_br_account_payment_order/models/account_move.py b/l10n_br_account_payment_order/models/account_move.py index 00a7432e1d57..89a43bf51678 100644 --- a/l10n_br_account_payment_order/models/account_move.py +++ b/l10n_br_account_payment_order/models/account_move.py @@ -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"): diff --git a/l10n_br_account_payment_order/models/account_move_line.py b/l10n_br_account_payment_order/models/account_move_line.py index b063311b14b0..7144e52ac3a1 100644 --- a/l10n_br_account_payment_order/models/account_move_line.py +++ b/l10n_br_account_payment_order/models/account_move_line.py @@ -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" diff --git a/l10n_br_account_payment_order/models/account_payment.py b/l10n_br_account_payment_order/models/account_payment.py index 485d7f1414fc..5f375cd41714 100644 --- a/l10n_br_account_payment_order/models/account_payment.py +++ b/l10n_br_account_payment_order/models/account_payment.py @@ -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 diff --git a/l10n_br_account_payment_order/models/l10n_br_cnab_change_methods.py b/l10n_br_account_payment_order/models/l10n_br_cnab_change_methods.py index 671822e0ac2c..04db8a1752c1 100644 --- a/l10n_br_account_payment_order/models/l10n_br_cnab_change_methods.py +++ b/l10n_br_account_payment_order/models/l10n_br_cnab_change_methods.py @@ -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 = ( From 0521306c5f88efea8125bd385ec5a6261bfe0041 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:35:35 -0300 Subject: [PATCH 05/34] [REF] l10n_br_base: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_base/models/res_partner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_base/models/res_partner.py b/l10n_br_base/models/res_partner.py index 37747bb0ddb1..d5c57bf575a4 100644 --- a/l10n_br_base/models/res_partner.py +++ b/l10n_br_base/models/res_partner.py @@ -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( From 00e86075e62964178be8931d419674fff4e7677f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:50:23 -0300 Subject: [PATCH 06/34] [REF] l10n_br_cnab_structure: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_cnab_structure/cnab/cnab.py | 6 ------ l10n_br_cnab_structure/models/account_journal.py | 1 - l10n_br_cnab_structure/models/cnab_batch.py | 2 -- l10n_br_cnab_structure/models/cnab_line.py | 2 -- l10n_br_cnab_structure/models/cnab_line_field.py | 1 - l10n_br_cnab_structure/models/cnab_structure.py | 2 -- l10n_br_cnab_structure/models/l10n_br_cnab_event.py | 1 - l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py | 1 - l10n_br_cnab_structure/tests/test_cnab_structure.py | 1 - l10n_br_cnab_structure/wizard/cnab_import_wizard.py | 2 -- l10n_br_cnab_structure/wizard/cnab_preview_wizard.py | 1 - l10n_br_cnab_structure/wizard/field_select_wizard.py | 1 - 12 files changed, 21 deletions(-) diff --git a/l10n_br_cnab_structure/cnab/cnab.py b/l10n_br_cnab_structure/cnab/cnab.py index cb6300b10db0..dc69ef75d790 100644 --- a/l10n_br_cnab_structure/cnab/cnab.py +++ b/l10n_br_cnab_structure/cnab/cnab.py @@ -16,7 +16,6 @@ class RecordType(Enum): class CnabField: - __slots__ = ["position", "value", "name"] def __init__(self, position: int, value: str, name: str = "") -> None: @@ -26,7 +25,6 @@ def __init__(self, position: int, value: str, name: str = "") -> None: class CnabLine: - type: RecordType fields: List[CnabField] @@ -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: @@ -80,7 +76,6 @@ def asdict(self): class CnabBatch: - header: CnabLine detail_records: List[CnabDetailRecord] trailer: CnabLine @@ -116,7 +111,6 @@ def asdict(self): class Cnab: - header: CnabLine batches: List[CnabBatch] trailer: CnabLine diff --git a/l10n_br_cnab_structure/models/account_journal.py b/l10n_br_cnab_structure/models/account_journal.py index 6e97271d2904..b935a3a72222 100644 --- a/l10n_br_cnab_structure/models/account_journal.py +++ b/l10n_br_cnab_structure/models/account_journal.py @@ -7,7 +7,6 @@ class AccountJournal(models.Model): - _inherit = "account.journal" used_to_import_cnab = fields.Boolean(string="Journal used for import CNAB") diff --git a/l10n_br_cnab_structure/models/cnab_batch.py b/l10n_br_cnab_structure/models/cnab_batch.py index 22c87e9aecaf..f049b2d6c1d6 100644 --- a/l10n_br_cnab_structure/models/cnab_batch.py +++ b/l10n_br_cnab_structure/models/cnab_batch.py @@ -10,7 +10,6 @@ class CNABBatch(models.Model): - _name = "l10n_br_cnab.batch" _description = "A batch of lines in a CNAB structure." @@ -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!") diff --git a/l10n_br_cnab_structure/models/cnab_line.py b/l10n_br_cnab_structure/models/cnab_line.py index e98af8e14625..330efc5358b8 100644 --- a/l10n_br_cnab_structure/models/cnab_line.py +++ b/l10n_br_cnab_structure/models/cnab_line.py @@ -12,7 +12,6 @@ class CNABLine(models.Model): - _name = "l10n_br_cnab.line" _description = "Lines that make up the CNAB." _order = "sequence, id" @@ -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: diff --git a/l10n_br_cnab_structure/models/cnab_line_field.py b/l10n_br_cnab_structure/models/cnab_line_field.py index 755e7ebaf601..6b70cdf53f54 100644 --- a/l10n_br_cnab_structure/models/cnab_line_field.py +++ b/l10n_br_cnab_structure/models/cnab_line_field.py @@ -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" diff --git a/l10n_br_cnab_structure/models/cnab_structure.py b/l10n_br_cnab_structure/models/cnab_structure.py index cabb6117e7c9..6f4518363eb1 100644 --- a/l10n_br_cnab_structure/models/cnab_structure.py +++ b/l10n_br_cnab_structure/models/cnab_structure.py @@ -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." @@ -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() diff --git a/l10n_br_cnab_structure/models/l10n_br_cnab_event.py b/l10n_br_cnab_structure/models/l10n_br_cnab_event.py index d31999a6e070..a51eb01296b0 100644 --- a/l10n_br_cnab_structure/models/l10n_br_cnab_event.py +++ b/l10n_br_cnab_structure/models/l10n_br_cnab_event.py @@ -8,7 +8,6 @@ class CNABReturnEvent(models.Model): - _inherit = "l10n_br_cnab.return.event" # BASE FIELDS # diff --git a/l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py b/l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py index 6d746cb34d21..ced56fef7db4 100644 --- a/l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py +++ b/l10n_br_cnab_structure/models/l10n_br_cnab_return_log.py @@ -8,7 +8,6 @@ class L10nBrCNABReturnLog(models.Model): - _inherit = "l10n_br_cnab.return.log" journal_id = fields.Many2one( diff --git a/l10n_br_cnab_structure/tests/test_cnab_structure.py b/l10n_br_cnab_structure/tests/test_cnab_structure.py index ebfdc6c912d0..d3d761137c31 100644 --- a/l10n_br_cnab_structure/tests/test_cnab_structure.py +++ b/l10n_br_cnab_structure/tests/test_cnab_structure.py @@ -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() diff --git a/l10n_br_cnab_structure/wizard/cnab_import_wizard.py b/l10n_br_cnab_structure/wizard/cnab_import_wizard.py index 97d6cdb77e03..eab491f9fe23 100644 --- a/l10n_br_cnab_structure/wizard/cnab_import_wizard.py +++ b/l10n_br_cnab_structure/wizard/cnab_import_wizard.py @@ -9,7 +9,6 @@ class CNABImportWizard(models.TransientModel): - _name = "cnab.import.wizard" _description = "CNAB Import Wizard" @@ -328,7 +327,6 @@ def _get_dict_value_from_line(self, data_line): return value_dict def _create_return_events(self, details, return_lot_id, return_log_id): - return_event_obj = self.env["l10n_br_cnab.return.event"] for detail in details: diff --git a/l10n_br_cnab_structure/wizard/cnab_preview_wizard.py b/l10n_br_cnab_structure/wizard/cnab_preview_wizard.py index c641c55c6992..b86e39aabdbc 100644 --- a/l10n_br_cnab_structure/wizard/cnab_preview_wizard.py +++ b/l10n_br_cnab_structure/wizard/cnab_preview_wizard.py @@ -7,7 +7,6 @@ class CNABPreviewWizard(models.TransientModel): - _name = "cnab.preview.wizard" _description = "CNAB Preview Wizard" diff --git a/l10n_br_cnab_structure/wizard/field_select_wizard.py b/l10n_br_cnab_structure/wizard/field_select_wizard.py index 994b1f7f15c5..9be89b881938 100644 --- a/l10n_br_cnab_structure/wizard/field_select_wizard.py +++ b/l10n_br_cnab_structure/wizard/field_select_wizard.py @@ -6,7 +6,6 @@ class FieldSelectWizard(models.TransientModel): - _name = "field.select.wizard" _description = "Field Select Wizard" From 61225a47d931157dd18497d5b1692873cd82e618 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:53:10 -0300 Subject: [PATCH 07/34] [REF] l10n_br_coa: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_coa/models/account_chart_template.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_coa/models/account_chart_template.py b/l10n_br_coa/models/account_chart_template.py index b790e494bdf6..5e62b59c3361 100644 --- a/l10n_br_coa/models/account_chart_template.py +++ b/l10n_br_coa/models/account_chart_template.py @@ -31,7 +31,6 @@ def _load_template( if self.parent_id and self.parent_id == self.env.ref( "l10n_br_coa.l10n_br_coa_template" ): - acc_names = { "sale": { "account_id": "account_id", From ef9d4dee4b13e3ff3b4e22386e33a94c8526579d Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:56:41 -0300 Subject: [PATCH 08/34] [REF] l10n_br_contract: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_contract/models/contract_contract.py | 1 - l10n_br_contract/models/res_company.py | 1 - l10n_br_contract/tests/test_l10n_br_contract.py | 1 - 3 files changed, 3 deletions(-) diff --git a/l10n_br_contract/models/contract_contract.py b/l10n_br_contract/models/contract_contract.py index 19e1f303a42d..b2b1a0dbf350 100644 --- a/l10n_br_contract/models/contract_contract.py +++ b/l10n_br_contract/models/contract_contract.py @@ -121,7 +121,6 @@ def _prepare_recurring_invoices_values(self, date_ref=False): document_type_list = [] for invoice_val in super_inv_vals: - # Identify how many Document Types exist for inv_line in invoice_val.get("invoice_line_ids"): if type(inv_line[2]) == list: diff --git a/l10n_br_contract/models/res_company.py b/l10n_br_contract/models/res_company.py index 312e5a16253b..6603d7fb2e99 100644 --- a/l10n_br_contract/models/res_company.py +++ b/l10n_br_contract/models/res_company.py @@ -5,7 +5,6 @@ class ResCompany(models.Model): - _inherit = "res.company" contract_sale_fiscal_operation_id = fields.Many2one( diff --git a/l10n_br_contract/tests/test_l10n_br_contract.py b/l10n_br_contract/tests/test_l10n_br_contract.py index 2a4db131fca4..3e86f31e473c 100644 --- a/l10n_br_contract/tests/test_l10n_br_contract.py +++ b/l10n_br_contract/tests/test_l10n_br_contract.py @@ -86,7 +86,6 @@ def test_created_invoices(self): according to the Fiscal Operation of their lines """ for invoice in self.contract_id._get_related_invoices(): - if len(invoice.invoice_line_ids) == 1: service_product_id = self.env.ref( "l10n_br_fiscal.customized_development_sale" From 65d98697b18c5b8ea822902ccbeff4d2f4085c89 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 14:57:59 -0300 Subject: [PATCH 09/34] [REF] l10n_br_delivery: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_delivery/models/stock_picking.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_delivery/models/stock_picking.py b/l10n_br_delivery/models/stock_picking.py index db45611220d5..a88f937d201c 100644 --- a/l10n_br_delivery/models/stock_picking.py +++ b/l10n_br_delivery/models/stock_picking.py @@ -5,7 +5,6 @@ class StockPicking(models.Model): - _inherit = "stock.picking" def _add_delivery_cost_to_so(self): From 47f24115744a422955045d40ab43cf43eca79013 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:10:23 -0300 Subject: [PATCH 10/34] [REF] l10n_br_fiscal: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_fiscal/migrations/14.0.11.0.0/post-migration.py | 1 - l10n_br_fiscal/models/city_taxation_code.py | 1 - l10n_br_fiscal/models/comment.py | 1 - l10n_br_fiscal/models/data_ncm_nbs_abstract.py | 2 -- l10n_br_fiscal/models/document_fiscal_mixin_methods.py | 2 -- l10n_br_fiscal/models/ibpt.py | 1 - l10n_br_fiscal/models/icms_regulation.py | 2 -- l10n_br_fiscal/models/operation.py | 1 - l10n_br_fiscal/models/operation_line.py | 1 - l10n_br_fiscal/models/res_company.py | 1 - l10n_br_fiscal/models/tax_definition.py | 1 - l10n_br_fiscal/tests/test_fiscal_document_generic.py | 2 -- l10n_br_fiscal/tests/test_icms_regulation.py | 1 - l10n_br_fiscal/tests/test_subsequent_operation.py | 2 -- l10n_br_fiscal/wizards/document_import_wizard_mixin.py | 1 - 15 files changed, 20 deletions(-) diff --git a/l10n_br_fiscal/migrations/14.0.11.0.0/post-migration.py b/l10n_br_fiscal/migrations/14.0.11.0.0/post-migration.py index 6a252cae2f83..a5c834b88772 100644 --- a/l10n_br_fiscal/migrations/14.0.11.0.0/post-migration.py +++ b/l10n_br_fiscal/migrations/14.0.11.0.0/post-migration.py @@ -7,7 +7,6 @@ @openupgrade.migrate() def migrate(env, version): - tools.convert_file( env.cr, "l10n_br_fiscal", diff --git a/l10n_br_fiscal/models/city_taxation_code.py b/l10n_br_fiscal/models/city_taxation_code.py index c6eac7b4e648..4a012ac125b9 100644 --- a/l10n_br_fiscal/models/city_taxation_code.py +++ b/l10n_br_fiscal/models/city_taxation_code.py @@ -5,7 +5,6 @@ class CityTaxationCode(models.Model): - _name = "l10n_br_fiscal.city.taxation.code" _inherit = "l10n_br_fiscal.data.abstract" _description = "City Taxation Code" diff --git a/l10n_br_fiscal/models/comment.py b/l10n_br_fiscal/models/comment.py index 3580218747ae..f066feb85f09 100644 --- a/l10n_br_fiscal/models/comment.py +++ b/l10n_br_fiscal/models/comment.py @@ -116,7 +116,6 @@ def format_amount(self, env, amount, currency): return "{pre}{0}{post}".format(formatted_amount, pre=pre, post=post) def compute_message(self, vals, manual_comment=None): - if not self.ids and not manual_comment: return False diff --git a/l10n_br_fiscal/models/data_ncm_nbs_abstract.py b/l10n_br_fiscal/models/data_ncm_nbs_abstract.py index aa09395beaad..2037da4f5450 100644 --- a/l10n_br_fiscal/models/data_ncm_nbs_abstract.py +++ b/l10n_br_fiscal/models/data_ncm_nbs_abstract.py @@ -95,7 +95,6 @@ def action_ibpt_inquiry(self): result = self._get_ibpt(config, record.code_unmasked) if result: - values = { object_field: record.id, "key": result.chave, @@ -125,7 +124,6 @@ def action_ibpt_inquiry(self): @api.model def _scheduled_update(self): - object_name = OBJECT_NAMES.get(self._name) _logger.info(_("Scheduled {} estimate taxes update...").format(object_name)) diff --git a/l10n_br_fiscal/models/document_fiscal_mixin_methods.py b/l10n_br_fiscal/models/document_fiscal_mixin_methods.py index 3c7404b711d6..700c5a8c975a 100644 --- a/l10n_br_fiscal/models/document_fiscal_mixin_methods.py +++ b/l10n_br_fiscal/models/document_fiscal_mixin_methods.py @@ -112,7 +112,6 @@ def _inverse_amount_freight(self): record.delivery_costs == "total" or record.force_compute_delivery_costs_by_total ): - amount_freight_value = record.amount_freight_value if all(record._get_product_amount_lines().mapped("freight_value")): amount_freight_old = sum( @@ -160,7 +159,6 @@ def _inverse_amount_insurance(self): record.delivery_costs == "total" or record.force_compute_delivery_costs_by_total ): - amount_insurance_value = record.amount_insurance_value if all(record._get_product_amount_lines().mapped("insurance_value")): amount_insurance_old = sum( diff --git a/l10n_br_fiscal/models/ibpt.py b/l10n_br_fiscal/models/ibpt.py index a8935749be87..82aecbff4fe8 100644 --- a/l10n_br_fiscal/models/ibpt.py +++ b/l10n_br_fiscal/models/ibpt.py @@ -46,7 +46,6 @@ def _request(ws_url, params): def get_ibpt_product( config, ncm, ex="0", reference="", description="", uom="", amount="0", gtin="" ): - data = { "token": config.token, "cnpj": config.cnpj, diff --git a/l10n_br_fiscal/models/icms_regulation.py b/l10n_br_fiscal/models/icms_regulation.py index d385a2f5b061..e217fde2597b 100644 --- a/l10n_br_fiscal/models/icms_regulation.py +++ b/l10n_br_fiscal/models/icms_regulation.py @@ -1645,14 +1645,12 @@ class ICMSRegulation(models.Model): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - view_super = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": doc = etree.fromstring(view_super.get("arch")) for node in doc.xpath("//notebook"): - br_states = self.env["res.country.state"].search( [("country_id", "=", self.env.ref("base.br").id)], order="code" ) diff --git a/l10n_br_fiscal/models/operation.py b/l10n_br_fiscal/models/operation.py index 9e0ef0b17391..3667e6dc3575 100644 --- a/l10n_br_fiscal/models/operation.py +++ b/l10n_br_fiscal/models/operation.py @@ -184,7 +184,6 @@ def get_document_serie(self, company, document_type): return serie def _line_domain(self, company, partner, product): - domain = [ ("fiscal_operation_id", "=", self.id), ("fiscal_operation_type", "=", self.fiscal_operation_type), diff --git a/l10n_br_fiscal/models/operation_line.py b/l10n_br_fiscal/models/operation_line.py index df4ec0a8bedd..e61cfc61e0d8 100644 --- a/l10n_br_fiscal/models/operation_line.py +++ b/l10n_br_fiscal/models/operation_line.py @@ -204,7 +204,6 @@ def map_fiscal_taxes( city_taxation_code=None, ind_final=None, ): - mapping_result = { "taxes": {}, "cfop": False, diff --git a/l10n_br_fiscal/models/res_company.py b/l10n_br_fiscal/models/res_company.py index 2939073aa747..d075827adde8 100644 --- a/l10n_br_fiscal/models/res_company.py +++ b/l10n_br_fiscal/models/res_company.py @@ -352,7 +352,6 @@ def _set_tax_definition(self, tax): @api.onchange("profit_calculation", "tax_framework") def _onchange_profit_calculation(self): - # Get all Simples Nacional default taxes sn_piscofins_id = self.env.ref("l10n_br_fiscal.tax_pis_cofins_simples_nacional") diff --git a/l10n_br_fiscal/models/tax_definition.py b/l10n_br_fiscal/models/tax_definition.py index 116c1184626a..80649bcd3e6e 100644 --- a/l10n_br_fiscal/models/tax_definition.py +++ b/l10n_br_fiscal/models/tax_definition.py @@ -361,7 +361,6 @@ def map_tax_definition( cest=None, city_taxation_code=None, ): - if not ncm: ncm = product.ncm_id diff --git a/l10n_br_fiscal/tests/test_fiscal_document_generic.py b/l10n_br_fiscal/tests/test_fiscal_document_generic.py index 6713d6b4a0ee..58d35ee4bf76 100644 --- a/l10n_br_fiscal/tests/test_fiscal_document_generic.py +++ b/l10n_br_fiscal/tests/test_fiscal_document_generic.py @@ -221,7 +221,6 @@ def test_nfe_other_state(self): " for Venda de Contribuinte p/ Fora do Estado.", ) else: - self.assertEqual( line.icms_tax_id.name, "ICMS 7%", @@ -1152,7 +1151,6 @@ def test_fields_freight_insurance_other_costs(self): ) def test_nfe_purchase_same_state(self): - self.nfe_purchase_same_state.action_document_confirm() self.assertEqual( diff --git a/l10n_br_fiscal/tests/test_icms_regulation.py b/l10n_br_fiscal/tests/test_icms_regulation.py index 76a42123b3ca..6766a0028ed5 100644 --- a/l10n_br_fiscal/tests/test_icms_regulation.py +++ b/l10n_br_fiscal/tests/test_icms_regulation.py @@ -60,7 +60,6 @@ def test_icms_sc_sp_ind_final_yes_default(self): self.assertEqual(tax_icms.percent_amount, 12.00) def find_icms_tax(self, in_state_id, out_state_id, ncm_id, ind_final): - self.partner.state_id = in_state_id self.company.partner_id.inscr_est = False self.company.inscr_est = False diff --git a/l10n_br_fiscal/tests/test_subsequent_operation.py b/l10n_br_fiscal/tests/test_subsequent_operation.py index 512dcece7df9..2f7ade24378c 100644 --- a/l10n_br_fiscal/tests/test_subsequent_operation.py +++ b/l10n_br_fiscal/tests/test_subsequent_operation.py @@ -38,7 +38,6 @@ def test_subsequent_operation_simple_faturamento(self): subsequent_documents = self.nfe_simples_faturamento.document_subsequent_ids for document in subsequent_documents: - self.assertTrue( document.subsequent_document_id, "Subsequent document was not created" ) @@ -52,7 +51,6 @@ def test_subsequent_operation_simple_faturamento(self): # Subsequent Lines for product in document.subsequent_document_id.fiscal_line_ids: - # Document Line ICMS tax self.assertEqual( product.icms_tax_id.id, diff --git a/l10n_br_fiscal/wizards/document_import_wizard_mixin.py b/l10n_br_fiscal/wizards/document_import_wizard_mixin.py index 42427006d95d..6231fdcaac67 100644 --- a/l10n_br_fiscal/wizards/document_import_wizard_mixin.py +++ b/l10n_br_fiscal/wizards/document_import_wizard_mixin.py @@ -7,7 +7,6 @@ class DocumentImportWizardMixin(models.TransientModel): - _name = "l10n_br_fiscal.document.import.wizard.mixin" _inherit = "l10n_br_fiscal.base.wizard.mixin" From b50b15b0692db16e0f169e63dfd0bf790e902310 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:14:39 -0300 Subject: [PATCH 11/34] [REF] l10n_br_hr: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_hr/models/res_partner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_hr/models/res_partner.py b/l10n_br_hr/models/res_partner.py index ef6e9082d497..2bc7f571f628 100644 --- a/l10n_br_hr/models/res_partner.py +++ b/l10n_br_hr/models/res_partner.py @@ -16,7 +16,6 @@ def create_depentent(self): @api.model def create(self, vals): - if "depentent_employee_id" in self.env.context: employee_id = self.env["hr.employee"].browse( self.env.context.get("depentent_employee_id") From 28375369b9ad3b8510f312dd969fcad58de1767b Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:18:54 -0300 Subject: [PATCH 12/34] [REF] l10n_br_ie_search: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_ie_search/tests/test_sefaz.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_ie_search/tests/test_sefaz.py b/l10n_br_ie_search/tests/test_sefaz.py index ad1467ab68cd..0f78e80486ef 100644 --- a/l10n_br_ie_search/tests/test_sefaz.py +++ b/l10n_br_ie_search/tests/test_sefaz.py @@ -103,7 +103,6 @@ def _switch_user_company(self, user, company): ) def test_sefaz(self): - dummy = self.model.create( { "name": "Dummy", From a3a94dbcbb186ce28c2a8601758480046562c645 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:26:29 -0300 Subject: [PATCH 13/34] [REF] l10n_br_nfe: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_nfe/models/document_line.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/l10n_br_nfe/models/document_line.py b/l10n_br_nfe/models/document_line.py index e21c64576e69..5b7d75798e59 100644 --- a/l10n_br_nfe/models/document_line.py +++ b/l10n_br_nfe/models/document_line.py @@ -167,7 +167,6 @@ class NFeLine(spec_models.StackedModel): ################################ def _export_fields_nfe_40_prod(self, xsd_fields, class_obj, export_dict): - nfe40_cProd = self.product_id.default_code or self.nfe40_cProd or "" export_dict["cProd"] = nfe40_cProd @@ -281,7 +280,6 @@ def _export_fields_nfe_40_prod(self, xsd_fields, class_obj, export_dict): nfe40_vTotTrib = fields.Monetary(related="estimate_tax") def _export_fields_nfe_40_imposto(self, xsd_fields, class_obj, export_dict): - if self.nfe40_choice10 == "nfe40_ICMS": xsd_fields.remove("nfe40_ISSQN") else: @@ -591,12 +589,10 @@ def _export_fields_nfe_40_tipi(self, xsd_fields, class_obj, export_dict): xsd_fields.remove("nfe40_IPINT") def _export_fields_ipi(self, xsd_fields, class_obj, export_dict): - export_dict["CST"] = self.ipi_cst_id.code export_dict["vBC"] = self.ipi_base def _export_fields_nfe_40_ipitrib(self, xsd_fields, class_obj, export_dict): - self._export_fields_ipi(xsd_fields, class_obj, export_dict) if self.nfe40_choice20 == "nfe40_pIPI": @@ -607,7 +603,6 @@ def _export_fields_nfe_40_ipitrib(self, xsd_fields, class_obj, export_dict): xsd_fields.remove("nfe40_pIPI") def _export_fields_nfe_40_ipint(self, xsd_fields, class_obj, export_dict): - self._export_fields_ipi(xsd_fields, class_obj, export_dict) ################################ @@ -712,20 +707,16 @@ def _export_fields_nfe_40_pis(self, xsd_fields, class_obj, export_dict): xsd_fields.remove(tag_to_remove) def _export_fields_pis(self, xsd_fields, class_obj, export_dict): - export_dict["CST"] = self.pis_cst_id.code export_dict["vBC"] = self.pis_base def _export_fields_nfe_40_pisaliq(self, xsd_fields, class_obj, export_dict): - self._export_fields_pis(xsd_fields, class_obj, export_dict) def _export_fields_nfe_40_pisqtde(self, xsd_fields, class_obj, export_dict): - self._export_fields_pis(xsd_fields, class_obj, export_dict) def _export_fields_nfe_40_pisoutr(self, xsd_fields, class_obj, export_dict): - self._export_fields_pis(xsd_fields, class_obj, export_dict) if self.nfe40_choice13 == "nfe40_pPIS": @@ -737,7 +728,6 @@ def _export_fields_nfe_40_pisoutr(self, xsd_fields, class_obj, export_dict): xsd_fields.remove("nfe40_pPIS") def _export_fields_nfe_40_pisnt(self, xsd_fields, class_obj, export_dict): - self._export_fields_pis(xsd_fields, class_obj, export_dict) ################# @@ -854,21 +844,17 @@ def _export_fields_nfe_40_cofins(self, xsd_fields, class_obj, export_dict): xsd_fields.remove(tag_to_remove) def _export_fields_cofins(self, xsd_fields, class_obj, export_dict): - export_dict["CST"] = self.cofins_cst_id.code export_dict["vBC"] = self.cofins_base export_dict["vCOFINS"] = self.cofins_value def _export_fields_nfe_40_cofinsaliq(self, xsd_fields, class_obj, export_dict): - self._export_fields_cofins(xsd_fields, class_obj, export_dict) def _export_fields_nfe_40_cofinsqtde(self, xsd_fields, class_obj, export_dict): - self._export_fields_cofins(xsd_fields, class_obj, export_dict) def _export_fields_nfe_40_cofinsoutr(self, xsd_fields, class_obj, export_dict): - self._export_fields_cofins(xsd_fields, class_obj, export_dict) if self.nfe40_choice16 == "nfe40_pCOFINS": @@ -880,7 +866,6 @@ def _export_fields_nfe_40_cofinsoutr(self, xsd_fields, class_obj, export_dict): xsd_fields.remove("nfe40_pCOFINS") def _export_fields_nfe_40_cofinsnt(self, xsd_fields, class_obj, export_dict): - self._export_fields_cofins(xsd_fields, class_obj, export_dict) #################### From c33a95a3911ce2332df10a2b2b43148e56653b6a Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:30:10 -0300 Subject: [PATCH 14/34] [REF] l10n_br_nfse: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_nfse/models/document.py | 1 - l10n_br_nfse/models/res_company.py | 1 - l10n_br_nfse/models/res_partner.py | 1 - 3 files changed, 3 deletions(-) diff --git a/l10n_br_nfse/models/document.py b/l10n_br_nfse/models/document.py index 3fa0c432eb71..3843d2038343 100644 --- a/l10n_br_nfse/models/document.py +++ b/l10n_br_nfse/models/document.py @@ -39,7 +39,6 @@ def filter_processador_edoc_nfse(record): class Document(models.Model): - _inherit = "l10n_br_fiscal.document" edoc_error_message = fields.Text( diff --git a/l10n_br_nfse/models/res_company.py b/l10n_br_nfse/models/res_company.py index 1de27e065bd4..bf4609d61088 100644 --- a/l10n_br_nfse/models/res_company.py +++ b/l10n_br_nfse/models/res_company.py @@ -7,7 +7,6 @@ class ResCompany(models.Model): - _inherit = "res.company" provedor_nfse = fields.Selection( diff --git a/l10n_br_nfse/models/res_partner.py b/l10n_br_nfse/models/res_partner.py index c0101ea157b2..3bba562016ea 100644 --- a/l10n_br_nfse/models/res_partner.py +++ b/l10n_br_nfse/models/res_partner.py @@ -7,7 +7,6 @@ class ResPartner(models.Model): - _inherit = "res.partner" def prepare_partner_tomador(self, country_id): From aac844823c7a7303e4b6221fd65fb0d2163ea322 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:32:24 -0300 Subject: [PATCH 15/34] [REF] l10n_br_nfse_ginfes: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_nfse_ginfes/models/document.py | 4 ---- l10n_br_nfse_ginfes/models/res_company.py | 1 - 2 files changed, 5 deletions(-) diff --git a/l10n_br_nfse_ginfes/models/document.py b/l10n_br_nfse_ginfes/models/document.py index 7ef557160ca8..d7214ab7ab85 100644 --- a/l10n_br_nfse_ginfes/models/document.py +++ b/l10n_br_nfse_ginfes/models/document.py @@ -48,7 +48,6 @@ def filter_ginfes(record): class Document(models.Model): - _inherit = "l10n_br_fiscal.document" def _serialize(self, edocs): @@ -160,7 +159,6 @@ def _serialize_ginfes_dados_tomador(self): ) def _serialize_ginfes_rps(self, dados): - return tcRps( InfRps=tcInfRps( Id=dados["id"], @@ -294,7 +292,6 @@ def _get_protocolo(record, processador, vals): if processo.resposta.ListaMensagemRetorno: lista_msgs = processo.resposta.ListaMensagemRetorno for mr in lista_msgs.MensagemRetorno: - correcao = "" if mr.Correcao: correcao = mr.Correcao @@ -327,7 +324,6 @@ def _set_response(record, processador, protocolo, vals): if processo.resposta.ListaMensagemRetorno: lista_msgs = processo.resposta.ListaMensagemRetorno for mr in lista_msgs.MensagemRetorno: - correcao = "" if mr.Correcao: correcao = mr.Correcao diff --git a/l10n_br_nfse_ginfes/models/res_company.py b/l10n_br_nfse_ginfes/models/res_company.py index 3c6445fa1429..0e519fafa985 100644 --- a/l10n_br_nfse_ginfes/models/res_company.py +++ b/l10n_br_nfse_ginfes/models/res_company.py @@ -5,7 +5,6 @@ class ResCompany(models.Model): - _inherit = "res.company" provedor_nfse = fields.Selection( From bbaf5f66da86ada017ad5720569674cd17ce2c09 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:35:32 -0300 Subject: [PATCH 16/34] [REF] l10n_br_nfse_paulistana: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_nfse_paulistana/models/document.py | 1 - l10n_br_nfse_paulistana/models/res_company.py | 1 - 2 files changed, 2 deletions(-) diff --git a/l10n_br_nfse_paulistana/models/document.py b/l10n_br_nfse_paulistana/models/document.py index ee915d788161..87ee4bc3601c 100644 --- a/l10n_br_nfse_paulistana/models/document.py +++ b/l10n_br_nfse_paulistana/models/document.py @@ -45,7 +45,6 @@ def filter_paulistana(record): class Document(models.Model): - _inherit = "l10n_br_fiscal.document" def convert_type_nfselib(self, class_object, object_filed, value): diff --git a/l10n_br_nfse_paulistana/models/res_company.py b/l10n_br_nfse_paulistana/models/res_company.py index 325a6060cd3b..c11622b44dbb 100644 --- a/l10n_br_nfse_paulistana/models/res_company.py +++ b/l10n_br_nfse_paulistana/models/res_company.py @@ -5,7 +5,6 @@ class ResCompany(models.Model): - _inherit = "res.company" provedor_nfse = fields.Selection( From 5c04987415a8311e63392afc787a8dea1f67f9c0 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:37:04 -0300 Subject: [PATCH 17/34] [REF] l10n_br_portal: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_portal/tests/test_load_process.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_portal/tests/test_load_process.py b/l10n_br_portal/tests/test_load_process.py index 40fa18245916..9a63ae00cef4 100644 --- a/l10n_br_portal/tests/test_load_process.py +++ b/l10n_br_portal/tests/test_load_process.py @@ -12,7 +12,6 @@ @tagged("post_install", "-at_install") class TestUi(HttpCase): def test_01_l10n_br_portal_load_tour(self): - mocked_response = { "zip_code": "37500015", "street_name": " Rua Coronel Renno", From cb51aaa20af3b88950df5d788b4ad014d6df5441 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:42:10 -0300 Subject: [PATCH 18/34] [REF] l10n_br_pos: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_pos/models/l10n_br_pos_product_fiscal_map.py | 1 - l10n_br_pos/models/pos_order.py | 1 - l10n_br_pos/models/product_product.py | 1 - l10n_br_pos/models/product_template.py | 1 - l10n_br_pos/tests/test_l10n_br_pos_order.py | 1 - l10n_br_pos/tests/test_l10n_br_pos_partner.py | 2 -- 6 files changed, 7 deletions(-) diff --git a/l10n_br_pos/models/l10n_br_pos_product_fiscal_map.py b/l10n_br_pos/models/l10n_br_pos_product_fiscal_map.py index 003dd9a0eeaa..d4e6b9816c75 100644 --- a/l10n_br_pos/models/l10n_br_pos_product_fiscal_map.py +++ b/l10n_br_pos/models/l10n_br_pos_product_fiscal_map.py @@ -5,7 +5,6 @@ class L10nBrPosProductFiscalMap(models.Model): - _name = "l10n_br_pos.product_fiscal_map" _description = "Pos Product Fiscal Map" _inherit = "l10n_br_fiscal.document.line.mixin" diff --git a/l10n_br_pos/models/pos_order.py b/l10n_br_pos/models/pos_order.py index d13178f7ada6..f83dede4ba25 100644 --- a/l10n_br_pos/models/pos_order.py +++ b/l10n_br_pos/models/pos_order.py @@ -265,7 +265,6 @@ def _amount_all(self): @api.model def _process_order(self, order, draft, existing_order): - order_id = super( PosOrder, self.with_context( diff --git a/l10n_br_pos/models/product_product.py b/l10n_br_pos/models/product_product.py index bff908b4471f..152eb14b89f1 100644 --- a/l10n_br_pos/models/product_product.py +++ b/l10n_br_pos/models/product_product.py @@ -5,7 +5,6 @@ class ProductProduct(models.Model): - _inherit = "product.product" @api.depends_context("company") diff --git a/l10n_br_pos/models/product_template.py b/l10n_br_pos/models/product_template.py index 7d69a008d0d1..57e38583f3a3 100644 --- a/l10n_br_pos/models/product_template.py +++ b/l10n_br_pos/models/product_template.py @@ -5,7 +5,6 @@ class ProductTemplate(models.Model): - _inherit = "product.template" pos_fiscal_map_ids = fields.One2many( diff --git a/l10n_br_pos/tests/test_l10n_br_pos_order.py b/l10n_br_pos/tests/test_l10n_br_pos_order.py index ee31e816638f..020687f66da4 100644 --- a/l10n_br_pos/tests/test_l10n_br_pos_order.py +++ b/l10n_br_pos/tests/test_l10n_br_pos_order.py @@ -95,7 +95,6 @@ def _generate_order(self): self.env["pos.order"].create_from_ui([generic_order]) def test_create_from_ui_l10n_brazil(self): - orders_exported_to_ui = [] self.pos_config.open_session_cb(check_coa=False) diff --git a/l10n_br_pos/tests/test_l10n_br_pos_partner.py b/l10n_br_pos/tests/test_l10n_br_pos_partner.py index f36c07ef9823..96df3bd3c297 100644 --- a/l10n_br_pos/tests/test_l10n_br_pos_partner.py +++ b/l10n_br_pos/tests/test_l10n_br_pos_partner.py @@ -11,7 +11,6 @@ def setUpClass(cls): cls.pos_config = cls.env.ref("point_of_sale.pos_config_main") def test_create_partner_from_ui_l10n_brazil(self): - partner_vals = { "country_id": 31, "state_id": 95, @@ -32,7 +31,6 @@ def test_create_partner_from_ui_l10n_brazil(self): self.assertEqual(1, len(partner), "Error creating the partner from UI.") def test_create_company_partner_from_ui_l10n_brazil(self): - company_partner_vals = { "country_id": 31, "state_id": 95, From 519ab37cd7da49acb611706fbad6180f0193cf63 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:45:55 -0300 Subject: [PATCH 19/34] [REF] l10n_br_pos_nfce: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_pos_nfce/models/pos_payment_method.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_pos_nfce/models/pos_payment_method.py b/l10n_br_pos_nfce/models/pos_payment_method.py index 3b8e10e76f6d..0dca2bdf7095 100644 --- a/l10n_br_pos_nfce/models/pos_payment_method.py +++ b/l10n_br_pos_nfce/models/pos_payment_method.py @@ -5,7 +5,6 @@ class PosPaymentMethod(models.Model): - _inherit = "pos.payment.method" payment_mode_id = fields.Many2one( From 477e28e08fbaa1f110426189563ab1fdc93e3067 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:47:28 -0300 Subject: [PATCH 20/34] [REF] l10n_br_product_contract: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_product_contract/models/sale_order.py | 1 - l10n_br_product_contract/models/sale_order_line.py | 1 - 2 files changed, 2 deletions(-) diff --git a/l10n_br_product_contract/models/sale_order.py b/l10n_br_product_contract/models/sale_order.py index f52bec7d7235..03b61a8eca6f 100644 --- a/l10n_br_product_contract/models/sale_order.py +++ b/l10n_br_product_contract/models/sale_order.py @@ -5,7 +5,6 @@ class SaleOrder(models.Model): - _inherit = "sale.order" def _prepare_contract_value(self, contract_template): diff --git a/l10n_br_product_contract/models/sale_order_line.py b/l10n_br_product_contract/models/sale_order_line.py index 92d55bcd6b03..a864079446db 100644 --- a/l10n_br_product_contract/models/sale_order_line.py +++ b/l10n_br_product_contract/models/sale_order_line.py @@ -5,7 +5,6 @@ class SaleOrderLine(models.Model): - _inherit = "sale.order.line" def _prepare_contract_line_values( From 450dc9fbebad83ee86b5c70c21c8f325a8b1f77d Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:48:50 -0300 Subject: [PATCH 21/34] [REF] l10n_br_purchase: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_purchase/hooks.py | 1 - l10n_br_purchase/models/purchase_order.py | 2 -- l10n_br_purchase/tests/test_l10n_br_purchase.py | 1 - 3 files changed, 4 deletions(-) diff --git a/l10n_br_purchase/hooks.py b/l10n_br_purchase/hooks.py index 4d8326e6513a..5493430237eb 100644 --- a/l10n_br_purchase/hooks.py +++ b/l10n_br_purchase/hooks.py @@ -5,7 +5,6 @@ def post_init_hook(cr, registry): - cr.execute("select demo from ir_module_module where name='l10n_br_purchase';") if cr.fetchone()[0]: env = api.Environment(cr, SUPERUSER_ID, {}) diff --git a/l10n_br_purchase/models/purchase_order.py b/l10n_br_purchase/models/purchase_order.py index f761f68c3c54..e1c2c7ec4eab 100644 --- a/l10n_br_purchase/models/purchase_order.py +++ b/l10n_br_purchase/models/purchase_order.py @@ -57,11 +57,9 @@ def _fiscal_operation_domain(self): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": - view = self.env["ir.ui.view"] sub_form_view = order_view["fields"]["order_line"]["views"]["form"]["arch"] diff --git a/l10n_br_purchase/tests/test_l10n_br_purchase.py b/l10n_br_purchase/tests/test_l10n_br_purchase.py index 62ee2b3ab2e8..3b432997c654 100644 --- a/l10n_br_purchase/tests/test_l10n_br_purchase.py +++ b/l10n_br_purchase/tests/test_l10n_br_purchase.py @@ -487,7 +487,6 @@ def test_fields_freight_insurance_other_costs(self): self.po_products.amount_other_value = 10.0 for line in self.po_products.order_line: - self.assertEqual( line.freight_value, 5.0, From 99585b8d49e98465af7c220fdb98015844f1f8e5 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:49:56 -0300 Subject: [PATCH 22/34] [REF] l10n_br_purchase_request: Remove empty Lines, necessary for the new version of pre-commit. --- .../wizards/purchase_request_line_make_purchase_order.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_purchase_request/wizards/purchase_request_line_make_purchase_order.py b/l10n_br_purchase_request/wizards/purchase_request_line_make_purchase_order.py index 01eb0322d5d6..f354b47f8497 100644 --- a/l10n_br_purchase_request/wizards/purchase_request_line_make_purchase_order.py +++ b/l10n_br_purchase_request/wizards/purchase_request_line_make_purchase_order.py @@ -5,7 +5,6 @@ class PurchaseRequestLineMakePurchaseOrder(models.TransientModel): - _inherit = "purchase.request.line.make.purchase.order" def make_purchase_order(self): From a9bb72c379fa7d1e11a0a7ddee4f5e415c6ffd50 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:51:17 -0300 Subject: [PATCH 23/34] [REF] l10n_br_repair: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_repair/models/repair_order.py | 4 ---- l10n_br_repair/models/res_company.py | 1 - 2 files changed, 5 deletions(-) diff --git a/l10n_br_repair/models/repair_order.py b/l10n_br_repair/models/repair_order.py index 4ae0c7e29edf..8f76723cedef 100644 --- a/l10n_br_repair/models/repair_order.py +++ b/l10n_br_repair/models/repair_order.py @@ -205,11 +205,9 @@ def _compute_get_invoiced(self): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": - view = self.env["ir.ui.view"] sub_form_view = order_view["fields"]["operations"]["views"]["form"]["arch"] @@ -473,7 +471,6 @@ def _create_invoices(self, group=False): return {repair.id: repair.invoice_id.id for repair in repairs} def _split_invoice(self, group=False): - self.ensure_one() document_type_list = [] @@ -496,7 +493,6 @@ def _split_invoice(self, group=False): if ( fiscal_document_type.id != invoice_created_by_super.document_type_id.id ) or (len(document_type_list) > 1): - # Remove the First Document Type, # already has Invoice created invoice_created_by_super.document_type_id = document_type_list.pop(0) diff --git a/l10n_br_repair/models/res_company.py b/l10n_br_repair/models/res_company.py index b9672b6fead4..1f9c9ea8b25a 100644 --- a/l10n_br_repair/models/res_company.py +++ b/l10n_br_repair/models/res_company.py @@ -5,7 +5,6 @@ class ResCompany(models.Model): - _inherit = "res.company" repair_fiscal_operation_id = fields.Many2one( From 5f34153193f73405992f7408c035c3a20e2641ff Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:53:09 -0300 Subject: [PATCH 24/34] [REF] l10n_br_resource: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_resource/models/resource_calendar.py | 1 - l10n_br_resource/models/resource_calendar_leaves.py | 1 - l10n_br_resource/tools/brazil_all_holidays_set.py | 3 --- l10n_br_resource/wizards/workalendar_holiday_import_wizard.py | 2 -- 4 files changed, 7 deletions(-) diff --git a/l10n_br_resource/models/resource_calendar.py b/l10n_br_resource/models/resource_calendar.py index 688f02fefd46..65efa2d0357f 100644 --- a/l10n_br_resource/models/resource_calendar.py +++ b/l10n_br_resource/models/resource_calendar.py @@ -8,7 +8,6 @@ class ResourceCalendar(models.Model): - _inherit = "resource.calendar" _parent_store = True diff --git a/l10n_br_resource/models/resource_calendar_leaves.py b/l10n_br_resource/models/resource_calendar_leaves.py index 76948c15593b..7abce938741e 100644 --- a/l10n_br_resource/models/resource_calendar_leaves.py +++ b/l10n_br_resource/models/resource_calendar_leaves.py @@ -23,7 +23,6 @@ class ResourceCalendarLeave(models.Model): - _inherit = "resource.calendar.leaves" country_id = fields.Many2one( diff --git a/l10n_br_resource/tools/brazil_all_holidays_set.py b/l10n_br_resource/tools/brazil_all_holidays_set.py index 0bfb8968fbb5..2dba84f5f3ab 100644 --- a/l10n_br_resource/tools/brazil_all_holidays_set.py +++ b/l10n_br_resource/tools/brazil_all_holidays_set.py @@ -6,7 +6,6 @@ class BrazilianHoliday: def __init__(self, nome, data, estado_ibge, municipio_ibge, abrangencia, tipo): - self.estado_ibge = estado_ibge self.municipio_ibge = municipio_ibge self.municipio_nome = "" @@ -58,7 +57,6 @@ def brazil_all_holidays_set(year): for register in IBGE_REGISTER.items(): estado_ibge = re.sub("BR-IBGE-", "", register[0]) if len(estado_ibge) == 2: - cal_state = IBGE_REGISTER[register[0]]() for state_holidays in cal_state.holidays(year): holiday_name = state_holidays[1] @@ -80,7 +78,6 @@ def brazil_all_holidays_set(year): municipio_ibge = re.sub("BR-IBGE-", "", register[0]) estado_ibge = municipio_ibge[0:2] if len(municipio_ibge) > 2: - cal_city = IBGE_REGISTER[register[0]]() for city_holiday in cal_city.holidays(year): diff --git a/l10n_br_resource/wizards/workalendar_holiday_import_wizard.py b/l10n_br_resource/wizards/workalendar_holiday_import_wizard.py index 41e01481db17..b18ea5f24f2a 100644 --- a/l10n_br_resource/wizards/workalendar_holiday_import_wizard.py +++ b/l10n_br_resource/wizards/workalendar_holiday_import_wizard.py @@ -21,7 +21,6 @@ class WorkalendarHolidayImport(models.TransientModel): - _name = "wizard.workalendar.holiday.import" _description = "Wizard de import de feriados" @@ -147,7 +146,6 @@ def holiday_import(self): while date_reference.year <= fields.Date.to_date(wiz.end_date).year: all_holidays = brazil_all_holidays_set(date_reference.year) for holiday in all_holidays: - if holiday.municipio_ibge: municipio_nome = ( self.env["res.city"] From 5c6d48efa3648388744a0381c188a14eaee90866 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:55:02 -0300 Subject: [PATCH 25/34] [REF] l10n_br_sale: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_sale/hooks.py | 1 - l10n_br_sale/models/sale_order.py | 2 -- l10n_br_sale/tests/test_l10n_br_sale.py | 1 - l10n_br_sale/tests/test_l10n_br_sale_discount.py | 2 -- 4 files changed, 6 deletions(-) diff --git a/l10n_br_sale/hooks.py b/l10n_br_sale/hooks.py index 7b08b09c41b5..3cc518cef2c8 100644 --- a/l10n_br_sale/hooks.py +++ b/l10n_br_sale/hooks.py @@ -5,7 +5,6 @@ def post_init_hook(cr, registry): - cr.execute("select demo from ir_module_module where name='l10n_br_sale';") if cr.fetchone()[0]: env = api.Environment(cr, SUPERUSER_ID, {}) diff --git a/l10n_br_sale/models/sale_order.py b/l10n_br_sale/models/sale_order.py index fe1a66ed6053..c2dea99c2191 100644 --- a/l10n_br_sale/models/sale_order.py +++ b/l10n_br_sale/models/sale_order.py @@ -107,11 +107,9 @@ def _amount_all(self): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": - view = self.env["ir.ui.view"] sub_form_view = order_view["fields"]["order_line"]["views"]["form"]["arch"] diff --git a/l10n_br_sale/tests/test_l10n_br_sale.py b/l10n_br_sale/tests/test_l10n_br_sale.py index f723e8150309..56a000ed994f 100644 --- a/l10n_br_sale/tests/test_l10n_br_sale.py +++ b/l10n_br_sale/tests/test_l10n_br_sale.py @@ -563,7 +563,6 @@ def test_fields_freight_insurance_other_costs(self): self.so_products.amount_other_value = 10.0 for line in self.so_products.order_line: - self.assertEqual( line.freight_value, 5.0, diff --git a/l10n_br_sale/tests/test_l10n_br_sale_discount.py b/l10n_br_sale/tests/test_l10n_br_sale_discount.py index a3f2972ec6a5..a9bd88efdf4e 100644 --- a/l10n_br_sale/tests/test_l10n_br_sale_discount.py +++ b/l10n_br_sale/tests/test_l10n_br_sale_discount.py @@ -119,7 +119,6 @@ def test_l10n_br_sale_discount_value_with_total(self): self.assertEqual(line.discount_value, 150) def test_l10n_br_sale_discount_percent(self): - self.assertFalse(self.order_line.user_discount_value) self.assertFalse(self.order_line.user_total_discount) self.assertTrue(self.order_line.need_change_discount_value()) @@ -134,7 +133,6 @@ def test_l10n_br_sale_discount_percent(self): line.discount_value = 20 def test_l10n_br_sale_discount_percent_with_total(self): - self.user.groups_id = [(4, self.group_total_discount_id)] self.assertFalse(self.order_line.user_discount_value) From 36ef0f5cca441d3e745e3ba6dfe3d74d6c9d6949 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:56:37 -0300 Subject: [PATCH 26/34] [REF] l10n_br_sale_blanket_order: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_sale_blanket_order/models/sale_blanket_order.py | 2 -- .../wizards/sale_blanket_order_wizard.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/l10n_br_sale_blanket_order/models/sale_blanket_order.py b/l10n_br_sale_blanket_order/models/sale_blanket_order.py index 2114bd27900b..7952af976c24 100644 --- a/l10n_br_sale_blanket_order/models/sale_blanket_order.py +++ b/l10n_br_sale_blanket_order/models/sale_blanket_order.py @@ -84,11 +84,9 @@ def _amount_all(self): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": - view = self.env["ir.ui.view"] sub_form_view = order_view["fields"]["line_ids"]["views"]["form"]["arch"] diff --git a/l10n_br_sale_blanket_order/wizards/sale_blanket_order_wizard.py b/l10n_br_sale_blanket_order/wizards/sale_blanket_order_wizard.py index 376c1a59ce5c..f81ad5cebd08 100644 --- a/l10n_br_sale_blanket_order/wizards/sale_blanket_order_wizard.py +++ b/l10n_br_sale_blanket_order/wizards/sale_blanket_order_wizard.py @@ -6,11 +6,9 @@ class SaleBlanketOrderWizard(models.TransientModel): - _inherit = ["sale.blanket.order.wizard"] def _prepare_so_line_vals(self, line): - fiscal_vals = line.blanket_line_id._prepare_br_fiscal_dict() # change quantity @@ -48,7 +46,6 @@ def _prepare_so_vals( payment_term_id, order_lines_by_customer, ): - vals = super()._prepare_so_vals( customer=customer, user_id=user_id, From 44b6be6cf5427e6c1bf981b9bc4f443e4534c2cc Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:57:50 -0300 Subject: [PATCH 27/34] [REF] l10n_br_sale_invoice_plan: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_sale_invoice_plan/models/sale_invoice_plan.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/l10n_br_sale_invoice_plan/models/sale_invoice_plan.py b/l10n_br_sale_invoice_plan/models/sale_invoice_plan.py index 20feb1977915..8b524d262c13 100644 --- a/l10n_br_sale_invoice_plan/models/sale_invoice_plan.py +++ b/l10n_br_sale_invoice_plan/models/sale_invoice_plan.py @@ -5,11 +5,9 @@ class SaleInvoicePlan(models.Model): - _inherit = "sale.invoice.plan" def _compute_new_invoice_quantity(self, invoice_move): - result = super()._compute_new_invoice_quantity(invoice_move=invoice_move) if invoice_move: From b38d703a0751fc88a3144e04311135e357bd9bff Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 15:59:15 -0300 Subject: [PATCH 28/34] [REF] l10n_br_sale_stock: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_sale_stock/wizards/stock_invoice_onshipping.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_sale_stock/wizards/stock_invoice_onshipping.py b/l10n_br_sale_stock/wizards/stock_invoice_onshipping.py index a0feb34b6dcf..417bfeda3022 100644 --- a/l10n_br_sale_stock/wizards/stock_invoice_onshipping.py +++ b/l10n_br_sale_stock/wizards/stock_invoice_onshipping.py @@ -5,7 +5,6 @@ class StockInvoiceOnshipping(models.TransientModel): - _inherit = "stock.invoice.onshipping" def _build_invoice_values_from_pickings(self, pickings): From e4feaaa0d43076cffbfe716432e67f2e99156051 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 16:00:40 -0300 Subject: [PATCH 29/34] [REF] l10n_br_stock_account: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_stock_account/hooks.py | 1 - l10n_br_stock_account/models/stock_move.py | 1 - l10n_br_stock_account/models/stock_picking.py | 2 -- l10n_br_stock_account/tests/test_invoicing_picking.py | 1 - l10n_br_stock_account/wizards/stock_return_picking.py | 1 - 5 files changed, 6 deletions(-) diff --git a/l10n_br_stock_account/hooks.py b/l10n_br_stock_account/hooks.py index 9a2e3a1f0410..98f55d353997 100644 --- a/l10n_br_stock_account/hooks.py +++ b/l10n_br_stock_account/hooks.py @@ -5,7 +5,6 @@ def post_init_hook(cr, registry): - cr.execute("select demo from ir_module_module where name='l10n_br_stock_account';") if cr.fetchone()[0]: env = api.Environment(cr, SUPERUSER_ID, {}) diff --git a/l10n_br_stock_account/models/stock_move.py b/l10n_br_stock_account/models/stock_move.py index 0ff9e5651a0b..f5565219b81e 100644 --- a/l10n_br_stock_account/models/stock_move.py +++ b/l10n_br_stock_account/models/stock_move.py @@ -123,7 +123,6 @@ def _prepare_move_split_vals(self, uom_qty): return values def _get_price_unit_invoice(self, inv_type, partner, qty=1): - result = super()._get_price_unit_invoice(inv_type, partner, qty) if not self.fiscal_operation_id: # Caso não tenha a Operação Fiscal não é uma Fatura do Brasil diff --git a/l10n_br_stock_account/models/stock_picking.py b/l10n_br_stock_account/models/stock_picking.py index 5e556128a4aa..47d09e7af92b 100644 --- a/l10n_br_stock_account/models/stock_picking.py +++ b/l10n_br_stock_account/models/stock_picking.py @@ -66,11 +66,9 @@ def _amount_all(self): def fields_view_get( self, view_id=None, view_type="form", toolbar=False, submenu=False ): - order_view = super().fields_view_get(view_id, view_type, toolbar, submenu) if view_type == "form": - view = self.env["ir.ui.view"] sub_form_view = order_view["fields"]["move_ids_without_package"]["views"][ diff --git a/l10n_br_stock_account/tests/test_invoicing_picking.py b/l10n_br_stock_account/tests/test_invoicing_picking.py index cfe9eb1e75f1..09df488d3c6d 100644 --- a/l10n_br_stock_account/tests/test_invoicing_picking.py +++ b/l10n_br_stock_account/tests/test_invoicing_picking.py @@ -573,7 +573,6 @@ def test_fields_freight_insurance_other_costs(self): self.stock_picking_sp.amount_other_value = 9.0 for line in self.stock_picking_sp.move_lines: - self.assertEqual( line.freight_value, 3.0, diff --git a/l10n_br_stock_account/wizards/stock_return_picking.py b/l10n_br_stock_account/wizards/stock_return_picking.py index 7b69a35599e9..fd08864e3f56 100644 --- a/l10n_br_stock_account/wizards/stock_return_picking.py +++ b/l10n_br_stock_account/wizards/stock_return_picking.py @@ -22,7 +22,6 @@ def _create_returns(self): origin_picking = self.env["stock.picking"].browse(self.env.context["active_id"]) if origin_picking.fiscal_operation_id: - refund_fiscal_operation = ( origin_picking.fiscal_operation_id.return_fiscal_operation_id ) From 88bc0cf1c6472a496439952544824211e0b6c2b3 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 16:04:02 -0300 Subject: [PATCH 30/34] [REF] l10n_br_stock_account_report: Remove empty Lines, necessary for the new version of pre-commit. --- .../wizards/l10n_br_p7_model_inventory_report_wizard.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/l10n_br_stock_account_report/wizards/l10n_br_p7_model_inventory_report_wizard.py b/l10n_br_stock_account_report/wizards/l10n_br_p7_model_inventory_report_wizard.py index bc3a68653e19..6b33aa257646 100644 --- a/l10n_br_stock_account_report/wizards/l10n_br_p7_model_inventory_report_wizard.py +++ b/l10n_br_stock_account_report/wizards/l10n_br_p7_model_inventory_report_wizard.py @@ -30,7 +30,6 @@ class L10nBRP7ModelInventoryReportWizard(models.TransientModel): ) def print_report(self): - data = self.read()[0] result = self.get_report_values() data.update( @@ -50,7 +49,6 @@ def print_report(self): @api.model def get_report_values(self): - # Informar no relatorio o fuso/horario do usuario if self.env.context.get("tz"): time_zone = pytz.timezone(self.env.context.get("tz")) @@ -74,7 +72,6 @@ def get_report_values(self): return result def header_footer(self, to_date_with_tz, time_zone): - company = self.env.company header = { "company_name": company.name, @@ -136,7 +133,6 @@ def _prepare_result_line( } def lines(self): - # Precision obj_precision = self.env["decimal.precision"] price_precision = obj_precision.precision_get("Product Price") @@ -171,7 +167,6 @@ def lines(self): fiscal_type_dict = {} for product in products_sorted_by_ncm: - tmp_ncm_controler_line = False # TODO ? product.price.history foi removido na v13, @@ -208,7 +203,6 @@ def lines(self): svl.unit_cost, precision_rounding=price_precision ) elif not float_is_zero(svl.value, precision_rounding=price_precision): - # Migração da OCA não preenche o unit_cost apenas o value # https://github.com/OCA/OpenUpgrade/blob/13.0/addons/ # stock_account/migrations/13.0.1.1/post-migration.py#L80 From 3fbc6a4526171f80e06eba55938da865fbf86a2c Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 16:08:34 -0300 Subject: [PATCH 31/34] [REF] l10n_br_website_sale: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_website_sale/controllers/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/l10n_br_website_sale/controllers/main.py b/l10n_br_website_sale/controllers/main.py index 845e717efcc1..03277e9bcd1d 100644 --- a/l10n_br_website_sale/controllers/main.py +++ b/l10n_br_website_sale/controllers/main.py @@ -16,7 +16,6 @@ class L10nBrWebsiteSale(WebsiteSale): - # overwrite confirm_order @http.route( ["/shop/confirm_order"], type="http", auth="public", website=True, sitemap=False From 77bcea4f63c8b8e9a3ba20c964a066b8b33989fe Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 16:13:29 -0300 Subject: [PATCH 32/34] [REF] l10n_br_zip: Remove empty Lines, necessary for the new version of pre-commit. --- l10n_br_zip/models/l10n_br_zip.py | 4 ---- l10n_br_zip/wizard/l10n_br_zip_search.py | 1 - 2 files changed, 5 deletions(-) diff --git a/l10n_br_zip/models/l10n_br_zip.py b/l10n_br_zip/models/l10n_br_zip.py index a55f027a0df9..c7a8f68c13d2 100644 --- a/l10n_br_zip/models/l10n_br_zip.py +++ b/l10n_br_zip/models/l10n_br_zip.py @@ -166,7 +166,6 @@ def _consultar_cep(self, zip_code): @api.model def zip_search(self, obj): - try: domain = self._set_domain( country_id=obj.country_id.id, @@ -188,12 +187,10 @@ def zip_search(self, obj): # More than one ZIP was found elif len(zips) > 1: - return self.create_wizard(obj, zips) # Address not found in local DB, search by PyCEP-Correios elif not zips and obj.zip: - cep_values = self._consultar_cep(obj.zip) if cep_values: @@ -203,7 +200,6 @@ def zip_search(self, obj): return True def create_wizard(self, obj, zips): - context = dict(self.env.context) context.update({"address_id": obj.id, "object_name": obj._name}) diff --git a/l10n_br_zip/wizard/l10n_br_zip_search.py b/l10n_br_zip/wizard/l10n_br_zip_search.py index 4509633f715b..5399a17a0989 100644 --- a/l10n_br_zip/wizard/l10n_br_zip_search.py +++ b/l10n_br_zip/wizard/l10n_br_zip_search.py @@ -66,7 +66,6 @@ def default_get(self, fields_list): return data def zip_search(self): - self.ensure_one() data = self obj_zip = self.env["l10n_br.zip"] From c96e7097d3f9d1c286b6923f8a44dd5886c763cf Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Wed, 25 Oct 2023 16:14:58 -0300 Subject: [PATCH 33/34] [REF] payment_bacen_pix: Remove empty Lines, necessary for the new version of pre-commit. --- payment_bacen_pix/controllers/main.py | 1 - payment_bacen_pix/models/payment_acquirer.py | 1 - payment_bacen_pix/models/payment_transaction.py | 1 - 3 files changed, 3 deletions(-) diff --git a/payment_bacen_pix/controllers/main.py b/payment_bacen_pix/controllers/main.py index 52b52c9f65d5..f7f51335e007 100644 --- a/payment_bacen_pix/controllers/main.py +++ b/payment_bacen_pix/controllers/main.py @@ -12,7 +12,6 @@ class PaymentController(http.Controller): - _accept_url = "/payment/bacenpix/feedback" @http.route( diff --git a/payment_bacen_pix/models/payment_acquirer.py b/payment_bacen_pix/models/payment_acquirer.py index 3633ff991670..f9ad61adb397 100644 --- a/payment_bacen_pix/models/payment_acquirer.py +++ b/payment_bacen_pix/models/payment_acquirer.py @@ -33,7 +33,6 @@ class PaymentAcquirer(models.Model): - _inherit = "payment.acquirer" provider = fields.Selection( diff --git a/payment_bacen_pix/models/payment_transaction.py b/payment_bacen_pix/models/payment_transaction.py index b5fed073b2dc..5b3a71ec2e2f 100644 --- a/payment_bacen_pix/models/payment_transaction.py +++ b/payment_bacen_pix/models/payment_transaction.py @@ -24,7 +24,6 @@ class PaymentTransaction(models.Model): - _inherit = "payment.transaction" bacenpix_date_due = fields.Datetime() From c89a428c7aec44172d1ccc165510554a41981486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Fri, 27 Oct 2023 08:26:31 -0300 Subject: [PATCH 34/34] [WIP][FIX] GH actions see https://github.com/OCA/oca-addons-repo-template/pull/214 --- .github/workflows/pre-commit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 755f8a225170..cf9ff12db454 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + with: + python-version: "3.11" - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1