[FIX] tools: fiscal year of 30/12 is taken as 31
To reproduce: - Put your fiscal year to the 30th of December (yes it's unlikely) - Create an asset - Compute depreciations => they are created for the 31th of December It comes from the `get_fiscal_year` in `date_utils` which considers it as the case of the 28th of February opw-3704466 closes odoo/odoo#153528 X-original-commit: cd0bb178441790e7e33c0d1c01b7ade82d4ab8c0 Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
This commit is contained in:
@@ -65,7 +65,7 @@ def get_fiscal_year(date, day=31, month=12):
|
||||
|
||||
def fix_day(year, month, day):
|
||||
max_day = calendar.monthrange(year, month)[1]
|
||||
if (month == 2 and day in (28, max_day)) or (month != 2 and day in (30, max_day)):
|
||||
if month == 2 and day in (28, max_day):
|
||||
return max_day
|
||||
return min(day, max_day)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user