mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract: Use %m instead of %B to obtain month
Related to https://github.com/OCA/contract/pull/1153 Fixes https://github.com/OCA/contract/issues/1160 Use the month number to set the text of the month and avoid problems according to the language defined in locale.
This commit is contained in:
@@ -597,18 +597,18 @@ class ContractLine(models.Model):
|
|||||||
|
|
||||||
def _translate_marker_month_name(self, month_name):
|
def _translate_marker_month_name(self, month_name):
|
||||||
months = {
|
months = {
|
||||||
"January": _("January"),
|
"01": _("January"),
|
||||||
"February": _("February"),
|
"02": _("February"),
|
||||||
"March": _("March"),
|
"03": _("March"),
|
||||||
"April": _("April"),
|
"04": _("April"),
|
||||||
"May": _("May"),
|
"05": _("May"),
|
||||||
"June": _("June"),
|
"06": _("June"),
|
||||||
"July": _("July"),
|
"07": _("July"),
|
||||||
"August": _("August"),
|
"08": _("August"),
|
||||||
"September": _("September"),
|
"09": _("September"),
|
||||||
"October": _("October"),
|
"10": _("October"),
|
||||||
"November": _("November"),
|
"11": _("November"),
|
||||||
"December": _("December"),
|
"12": _("December"),
|
||||||
}
|
}
|
||||||
return months[month_name]
|
return months[month_name]
|
||||||
|
|
||||||
@@ -623,7 +623,7 @@ class ContractLine(models.Model):
|
|||||||
name = name.replace(
|
name = name.replace(
|
||||||
"#INVOICEMONTHNAME#",
|
"#INVOICEMONTHNAME#",
|
||||||
self.with_context(lang=lang.code)._translate_marker_month_name(
|
self.with_context(lang=lang.code)._translate_marker_month_name(
|
||||||
first_date_invoiced.strftime("%B")
|
first_date_invoiced.strftime("%m")
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
return name
|
return name
|
||||||
|
|||||||
Reference in New Issue
Block a user