Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] contract: Invoice creation message translatable #1189

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contract/i18n/contract.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,13 @@ msgstr ""
msgid "You must supply a date of next invoice for contract line '%s'"
msgstr ""

#. module: contract
#. odoo-python
#: code:addons/contract/models/contract.py:0
#, python-format
msgid "by contract"
msgstr ""

#. module: contract
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
msgid "e.g. Contract XYZ"
Expand Down
7 changes: 7 additions & 0 deletions contract/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,13 @@ msgstr ""
"Debe proporcionar la fecha de la próxima factura para la línea del contrato "
"'%s'"

#. module: contract
#. odoo-python
#: code:addons/contract/models/contract.py:0
#, python-format
msgid "by contract"
msgstr "por el contrato"

#. module: contract
#: model_terms:ir.ui.view,arch_db:contract.contract_contract_form_view
msgid "e.g. Contract XYZ"
Expand Down
13 changes: 4 additions & 9 deletions contract/models/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,12 @@ def _invoice_followers(self, invoices):
def _add_contract_origin(self, invoices):
for item in self:
for move in invoices & item._get_related_invoices():
translation = _("by contract")
move.message_post(
body=(
_(
(
"%(msg)s by contract <a href=# data-oe-model=contract.contract"
" data-oe-id=%(contract_id)d>%(contract)s</a>."
),
msg=move._creation_message(),
contract_id=item.id,
contract=item.display_name,
)
f"{move._creation_message()} {translation} "
f"<a href=# data-oe-model=contract.contract"
f" data-oe-id={item.id}>{item.display_name}</a>."
)
)

Expand Down
Loading