fix: add translate function to period in sales_analytics.py

(cherry picked from commit 083a78135c)
This commit is contained in:
Ernesto Ruiz
2022-10-25 22:17:06 -06:00
committed by Mergify
parent b0c06d5a04
commit e681f06883

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])