2
0

[12.0][FIX]traceback when deviating FY

This commit is contained in:
Luc De Meyer 2020-01-09 21:43:01 +01:00 committed by Rodrigo
parent e2ceca5842
commit cd3bd6bbd2
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
{ {
'name': 'Assets Management', 'name': 'Assets Management',
'version': '12.0.2.1.1', 'version': '12.0.2.1.2',
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': [ 'depends': [
'account', 'account',

View File

@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import calendar import calendar
from datetime import datetime from datetime import date
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
import logging import logging
from sys import exc_info from sys import exc_info
@ -626,11 +626,11 @@ class AccountAsset(models.Model):
duration = (fy_date_stop - fy_date_start).days + 1 duration = (fy_date_stop - fy_date_start).days + 1
else: else:
duration = ( duration = (
datetime(year, 12, 31) - fy_date_start).days + 1 date(year, 12, 31) - fy_date_start).days + 1
factor = float(duration) / cy_days factor = float(duration) / cy_days
elif i == cnt - 1: # last year elif i == cnt - 1: # last year
duration = ( duration = (
fy_date_stop - datetime(year, 1, 1)).days + 1 fy_date_stop - date(year, 1, 1)).days + 1
factor += float(duration) / cy_days factor += float(duration) / cy_days
else: else:
factor += 1.0 factor += 1.0