mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] contract: Invoice creation message translatable
As it was, the text to translate is not correctly extracted, so it's not translated, creating a mix of languages, as `_creation_message` is returning a translated sentence. We take also the opportunity to change the way the sentence is built for having as translatable only the "by contract" words, to avoid possible errors in translations due to the placeholders.
This commit is contained in:
@@ -2334,6 +2334,13 @@ msgstr ""
|
|||||||
msgid "You must supply a date of next invoice for contract line '%s'"
|
msgid "You must supply a date of next invoice for contract line '%s'"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: contract
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/contract/models/contract.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "by contract"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: contract
|
#. module: contract
|
||||||
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
|
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
|
||||||
msgid "e.g. Contract XYZ"
|
msgid "e.g. Contract XYZ"
|
||||||
|
|||||||
@@ -2542,6 +2542,13 @@ msgstr ""
|
|||||||
"Debe proporcionar la fecha de la próxima factura para la línea del contrato "
|
"Debe proporcionar la fecha de la próxima factura para la línea del contrato "
|
||||||
"'%s'"
|
"'%s'"
|
||||||
|
|
||||||
|
#. module: contract
|
||||||
|
#. odoo-python
|
||||||
|
#: code:addons/contract/models/contract.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "by contract"
|
||||||
|
msgstr "por el contrato"
|
||||||
|
|
||||||
#. module: contract
|
#. module: contract
|
||||||
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
|
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
|
||||||
msgid "e.g. Contract XYZ"
|
msgid "e.g. Contract XYZ"
|
||||||
|
|||||||
@@ -613,11 +613,13 @@ class ContractContract(models.Model):
|
|||||||
def _add_contract_origin(self, invoices):
|
def _add_contract_origin(self, invoices):
|
||||||
for item in self:
|
for item in self:
|
||||||
for move in invoices & item._get_related_invoices():
|
for move in invoices & item._get_related_invoices():
|
||||||
body = Markup(_("%(msg)s by contract: %(contract_link)s")) % {
|
translation = _("by contract")
|
||||||
"msg": move._creation_message(),
|
move.message_post(
|
||||||
"contract_link": item._get_html_link(title=item.display_name),
|
body=Markup(
|
||||||
}
|
f"{move._creation_message()} {translation} "
|
||||||
move.message_post(body=body)
|
f"{item._get_html_link(title=item.display_name)}."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def _recurring_create_invoice(self, date_ref=False):
|
def _recurring_create_invoice(self, date_ref=False):
|
||||||
invoices_values = self._prepare_recurring_invoices_values(date_ref)
|
invoices_values = self._prepare_recurring_invoices_values(date_ref)
|
||||||
|
|||||||
Reference in New Issue
Block a user