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

[16.0][FIX] l10n_br_account_payment_order: Teste CNAB de Alteração da Data de Vencimento de mais de 1 linha #3634

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions l10n_br_account_payment_order/tests/test_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from datetime import date, timedelta
from datetime import date

from dateutil.relativedelta import relativedelta

from odoo.exceptions import UserError
from odoo.fields import Date
Expand Down Expand Up @@ -102,7 +104,7 @@ def _send_new_cnab_code(
) as f:
f.change_type = code_to_send
if code_to_send == "change_date_maturity":
new_date = date.today() + timedelta(days=40)
new_date = date.today() + relativedelta(years=1)
payment_cheque = self.env.ref(
"l10n_br_account_payment_order." "payment_mode_cheque"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# @author Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from datetime import date, timedelta
from datetime import date

from dateutil.relativedelta import relativedelta

from odoo.tests import tagged

Expand Down Expand Up @@ -61,7 +63,7 @@ def setUpClass(cls):
def test_change_date_maturity_multiple(self):
"""Test Creation of a Payment Order an change MULTIPLE due date"""
date_maturity = self.financial_move_line_ids.mapped("date_maturity")
new_date = date.today() + timedelta(days=40)
new_date = date.today() + relativedelta(years=1)
self._send_and_check_new_cnab_code(
self.invoice_auto,
self.financial_move_line_ids,
Expand All @@ -77,7 +79,7 @@ def test_change_date_maturity_multiple(self):
def test_change_date_maturity_one(self):
"""Test Creation of a Payment Order an change ONE due date"""
date_maturity = self.financial_move_line_0.mapped("date_maturity")
new_date = date.today() + timedelta(days=40)
new_date = date.today() + relativedelta(years=1)
self._send_and_check_new_cnab_code(
self.invoice_auto,
self.financial_move_line_0,
Expand Down