Skip to content

Comments

[IMP] account_payment_loan: added tests for loan flows#825

Open
rov-adhoc wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-account_payment_loan_test
Open

[IMP] account_payment_loan: added tests for loan flows#825
rov-adhoc wants to merge 1 commit intoingadhoc:18.0from
adhoc-dev:18.0-account_payment_loan_test

Conversation

@rov-adhoc
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 6, 2025 17:08
@roboadhoc
Copy link
Contributor

Pull request status dashboard

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Este PR agrega cobertura de tests para los flujos de negocio de préstamos y corrige el versionado del módulo card_installment. Los cambios principales incluyen:

  • Corrección del versionado en card_installment (downgrade de 18.0.1.1.0 a 18.0.1.0.0)
  • Implementación de tests completos para flujos de préstamos (registro, refinanciamiento y pagos con recargos)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
card_installment/__manifest__.py Corrige el número de versión, retornando a 18.0.1.0.0 desde 18.0.1.1.0
account_payment_loan/tests/test_loan_flows.py Agrega archivo nuevo con 3 tests completos para validar flujos de préstamos: registro desde factura, refinanciamiento y pago tardío con recargos
account_payment_loan/tests/__init__.py Registra el nuevo módulo de tests
Comments suppressed due to low confidence (1)

account_payment_loan/tests/test_loan_flows.py:31

  • Variable account_data is not used.
        account_data = cls.env["account.account"].sudo().search([("account_type", "=", "asset_receivable")], limit=1)

"website": "https://www.adhoc.com.ar",
"category": "Technical",
"version": "18.0.1.1.0",
"version": "18.0.1.0.0",
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El cambio reduce el número de versión de 18.0.1.1.0 a 18.0.1.0.0, lo cual representa un downgrade. Según las reglas de versionado, esto es inusual y podría indicar un error. ¿Es intencional este retroceso de versión? Si no hubo cambios estructurales previos que justificaran el bump a 1.1.0, considera documentar el motivo de este ajuste en el mensaje del commit o en el PR description.

Copilot generated this review using guidance from repository custom instructions.
})

# Setup accounts using CoA data
account_data = cls.env["account.account"].sudo().search([("account_type", "=", "asset_receivable")], limit=1)
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La variable account_data se crea pero nunca se utiliza en el código. Puede ser eliminada para mejorar la claridad del código de configuración de tests.

Suggested change
account_data = cls.env["account.account"].sudo().search([("account_type", "=", "asset_receivable")], limit=1)

Copilot uses AI. Check for mistakes.

# Use refinancial loan from demo data
cls.loan_type_6_cuotas = cls.env.ref('account_payment_loan.refinancial_loan')
cls.plan_6_cuotas = cls.loan_type_6_cuotas.installment_ids.filtered(lambda x: x.name == '3')[0]
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El filtro busca un plan con nombre '3' pero la variable se llama plan_6_cuotas, lo que sugiere que debería buscar '6' en lugar de '3'. Esto causará que se use el plan incorrecto en el test de refinanciamiento (línea 328).

Suggested change
cls.plan_6_cuotas = cls.loan_type_6_cuotas.installment_ids.filtered(lambda x: x.name == '3')[0]
cls.plan_6_cuotas = cls.loan_type_6_cuotas.installment_ids.filtered(lambda x: x.name == '6')[0]

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 2
# -*- coding: utf-8 -*-
from . import test_loan_flows
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se agregó un nuevo archivo de tests pero falta el bump de versión en account_payment_loan/__manifest__.py. Según las reglas de versionado, cuando se agregan tests (que implican cambios en el módulo), se debe incrementar la versión (por ejemplo, de 18.0.1.1.0 a 18.0.1.2.0).

Copilot generated this review using guidance from repository custom instructions.
@@ -0,0 +1,473 @@
# -*- coding: utf-8 -*-
from datetime import date
from dateutil.relativedelta import relativedelta
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'relativedelta' is not used.

Suggested change
from dateutil.relativedelta import relativedelta

Copilot uses AI. Check for mistakes.
from dateutil.relativedelta import relativedelta
from freezegun import freeze_time

from odoo import Command, fields
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'fields' is not used.

Suggested change
from odoo import Command, fields
from odoo import Command

Copilot uses AI. Check for mistakes.
@cav-adhoc cav-adhoc force-pushed the 18.0-account_payment_loan_test branch from 697ddd3 to 5897ffd Compare November 13, 2025 17:14
@cav-adhoc cav-adhoc force-pushed the 18.0-account_payment_loan_test branch from 5897ffd to a046c75 Compare November 13, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants