fix: add translate function to period in sales_analytics.py

This commit is contained in:
Ernesto Ruiz 2022-10-25 22:17:06 -06:00 committed by GitHub
parent c1e608d9ef
commit 083a78135c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,11 +313,11 @@ class Analytics(object):
def get_period(self, posting_date):
if self.filters.range == "Weekly":
period = "Week " + str(posting_date.isocalendar()[1]) + " " + str(posting_date.year)
period = _("Week {0} {1}").format(str(posting_date.isocalendar()[1]), str(posting_date.year))
elif self.filters.range == "Monthly":
period = str(self.months[posting_date.month - 1]) + " " + str(posting_date.year)
period = _(str(self.months[posting_date.month - 1])) + " " + str(posting_date.year)
elif self.filters.range == "Quarterly":
period = "Quarter " + str(((posting_date.month - 1) // 3) + 1) + " " + str(posting_date.year)
period = _("Quarter {0} {1}").format(str(((posting_date.month - 1) // 3) + 1), str(posting_date.year))
else:
year = get_fiscal_year(posting_date, company=self.filters.company)
period = str(year[0])