[FIX] account: fall back to YEAR/12/31 for fiscalyear

This commit is contained in:
Lucas Perais (lpe)
2017-09-26 12:58:27 +02:00
parent 8efecd31bd
commit be997fc113
+2 -2
View File
@@ -65,8 +65,8 @@ Best Regards,''')
@api.model
def _verify_fiscalyear_last_day(self, company_id, last_day, last_month):
company = self.browse(company_id)
last_day = last_day or company.fiscalyear_last_day
last_month = last_month or company.fiscalyear_last_month
last_day = last_day or (company and company.fiscalyear_last_day) or 31
last_month = last_month or (company and company.fiscalyear_last_month) or 12
current_year = datetime.now().year
last_day_of_month = calendar.monthrange(current_year, last_month)[1]
return last_day > last_day_of_month and last_day_of_month or last_day