diff --git a/addons/account/models/company.py b/addons/account/models/company.py index 33297625a6d..b1d5b151259 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -544,3 +544,16 @@ class ResCompany(models.Model): results_by_journal['results'].append(rslt) return results_by_journal + + def compute_fiscalyear_dates(self, current_date): + """ + The role of this method is to provide a fallback when account_accounting is not installed. + As the fiscal year is irrelevant when account_accounting is not installed, this method returns the calendar year. + :param current_date: A datetime.date/datetime.datetime object. + :return: A dictionary containing: + * date_from + * date_to + """ + + return {'date_from': datetime(year=current_date.year, month=1, day=1).date(), + 'date_to': datetime(year=current_date.year, month=12, day=31).date()}