fix: add translate function to period in stock_analytics.py
This commit is contained in:
parent
71a0ae2e59
commit
c1e608d9ef
@ -114,11 +114,11 @@ def get_period(posting_date, filters):
|
|||||||
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
||||||
|
|
||||||
if filters.range == "Weekly":
|
if 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 filters.range == "Monthly":
|
elif filters.range == "Monthly":
|
||||||
period = str(months[posting_date.month - 1]) + " " + str(posting_date.year)
|
period = _(str(months[posting_date.month - 1])) + " " + str(posting_date.year)
|
||||||
elif filters.range == "Quarterly":
|
elif 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:
|
else:
|
||||||
year = get_fiscal_year(posting_date, company=filters.company)
|
year = get_fiscal_year(posting_date, company=filters.company)
|
||||||
period = str(year[2])
|
period = str(year[2])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user