From cd3bd6bbd23165888cefc6eda8a7d14d51a38b7b Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Thu, 9 Jan 2020 21:43:01 +0100 Subject: [PATCH] [12.0][FIX]traceback when deviating FY --- account_asset_management/__manifest__.py | 2 +- account_asset_management/models/account_asset.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/account_asset_management/__manifest__.py b/account_asset_management/__manifest__.py index 67ea9346..878528a7 100644 --- a/account_asset_management/__manifest__.py +++ b/account_asset_management/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Assets Management', - 'version': '12.0.2.1.1', + 'version': '12.0.2.1.2', 'license': 'AGPL-3', 'depends': [ 'account', diff --git a/account_asset_management/models/account_asset.py b/account_asset_management/models/account_asset.py index 45345d28..1d6a8570 100644 --- a/account_asset_management/models/account_asset.py +++ b/account_asset_management/models/account_asset.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import calendar -from datetime import datetime +from datetime import date from dateutil.relativedelta import relativedelta import logging from sys import exc_info @@ -626,11 +626,11 @@ class AccountAsset(models.Model): duration = (fy_date_stop - fy_date_start).days + 1 else: duration = ( - datetime(year, 12, 31) - fy_date_start).days + 1 + date(year, 12, 31) - fy_date_start).days + 1 factor = float(duration) / cy_days elif i == cnt - 1: # last year duration = ( - fy_date_stop - datetime(year, 1, 1)).days + 1 + fy_date_stop - date(year, 1, 1)).days + 1 factor += float(duration) / cy_days else: factor += 1.0