Skip to content

Commit

Permalink
[MIG] account_consolidation_oca: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Jan 22, 2024
1 parent 82e0e1f commit 3faf4d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion account_consolidation_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Account Consolidation",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Generic Modules/Accounting",
Expand Down
4 changes: 2 additions & 2 deletions account_consolidation_oca/tests/test_account_company_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import exceptions
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase


class TestAccountCompanyRules(SavepointCase):
class TestAccountCompanyRules(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def setUp(self):

def test_default_values(self):
wizard = self.env["account.consolidation.consolidate"].create({})
last_month = date.today() - relativedelta(month=1)
last_month = date.today() - relativedelta(months=1)
self.assertEqual(wizard.year, last_month.strftime("%Y"))
self.assertEqual(wizard.month, last_month.strftime("%m"))
self.assertEqual(wizard.company_id, self.holding)
Expand Down
8 changes: 4 additions & 4 deletions account_consolidation_oca/wizard/consolidation_consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ def _default_journal(self):

@api.model
def _default_get_month(self):
today = fields.Date.from_string(fields.Date.context_today(self))
return (today - relativedelta(month=1)).strftime("%m")
today = fields.Date.context_today(self)
return (today - relativedelta(months=1)).strftime("%m")

@api.model
def _default_get_year(self):
today = fields.Date.from_string(fields.Date.context_today(self))
today = fields.Date.context_today(self)
if today.strftime("%m") != "01":
return today.strftime("%Y")
else:
return (today - relativedelta(year=1)).strftime("%Y")
return (today - relativedelta(years=1)).strftime("%Y")

@api.model
def _get_month_last_date(self):
Expand Down

0 comments on commit 3faf4d8

Please sign in to comment.