From e11bc3c1db228c39a464d45dcfff60933c0a3a48 Mon Sep 17 00:00:00 2001 From: Ajmal JK Date: Tue, 11 Feb 2020 14:45:15 +0530 Subject: [PATCH] [FIX] Bug fixed asset deprec. date 'base_accounting_kit' --- base_accounting_kit/__manifest__.py | 2 +- base_accounting_kit/doc/{RELEASE_NOTES.md => changelog.md} | 5 +++++ base_accounting_kit/models/account_asset.py | 7 +++---- 3 files changed, 9 insertions(+), 5 deletions(-) rename base_accounting_kit/doc/{RELEASE_NOTES.md => changelog.md} (88%) diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index d91b66b79..6307a78dc 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Odoo 13 Full Accounting Kit', - 'version': '13.0.3.4.2', + 'version': '13.0.3.4.3', 'category': 'Accounting', 'summary': """ Asset and Budget Management, Accounting Reports, PDC, Lock dates, diff --git a/base_accounting_kit/doc/RELEASE_NOTES.md b/base_accounting_kit/doc/changelog.md similarity index 88% rename from base_accounting_kit/doc/RELEASE_NOTES.md rename to base_accounting_kit/doc/changelog.md index 468c348c7..89995c5d5 100644 --- a/base_accounting_kit/doc/RELEASE_NOTES.md +++ b/base_accounting_kit/doc/changelog.md @@ -34,3 +34,8 @@ #### Version 13.0.3.4.2 #### FIX - Bug Fixed reccuring payment templates. + +#### 11.02.2020 +#### Version 13.0.3.4.3 +#### FIX +- Asset depreciation date issue diff --git a/base_accounting_kit/models/account_asset.py b/base_accounting_kit/models/account_asset.py index ee25ffd21..ed407455e 100644 --- a/base_accounting_kit/models/account_asset.py +++ b/base_accounting_kit/models/account_asset.py @@ -264,7 +264,7 @@ class AccountAssetAsset(models.Model): amount = amount_to_depr / self.method_number if sequence == 1: if self.method_period % 12 != 0: - date = datetime.strptime(self.date, '%Y-%m-%d') + date = datetime.strptime(str(self.date), '%Y-%m-%d') month_days = \ calendar.monthrange(date.year, date.month)[1] days = month_days - date.day + 1 @@ -311,7 +311,6 @@ class AccountAssetAsset(models.Model): return undone_dotation_number def compute_depreciation_board(self): - print("compute_depreciatopn_board") self.ensure_one() posted_depreciation_line_ids = self.depreciation_line_ids.filtered( @@ -353,9 +352,9 @@ class AccountAssetAsset(models.Model): self.date.year)) # e.g. 2018-12-31 +1 -> 2019 else: asset_date = datetime.strptime( - self.date[:4] + '-01-01', DF).date() + str(self.date)[:4] + '-01-01', DF).date() else: - asset_date = datetime.strptime(self.date[:7] + '-01', + asset_date = datetime.strptime(str(self.date)[:7] + '-01', DF).date() # if we already have some previous validated entries, starting date isn't 1st January but last entry + method period if posted_depreciation_line_ids and \