From 2b0d65105113b6930701e0521cc5616dc983dc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 22 Feb 2023 16:38:22 +0100 Subject: [PATCH 1/2] [FIX] account_payment_order_notification: Show supplier invoice reference if applicable. TT40795 --- .../data/mail_template_data.xml | 6 +++++- .../account_payment_order_notification.pot | 8 +++++++- account_payment_order_notification/i18n/es.po | 20 ++++++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/account_payment_order_notification/data/mail_template_data.xml b/account_payment_order_notification/data/mail_template_data.xml index e246b6f72..afb49bde0 100644 --- a/account_payment_order_notification/data/mail_template_data.xml +++ b/account_payment_order_notification/data/mail_template_data.xml @@ -33,7 +33,11 @@ % for payment_line in object.payment_line_ids: - ${payment_line.communication} + % if payment_line.move_line_id.move_id.move_type in ("in_invoice", "in_refund") and payment_line.move_line_id.move_id.ref: + ${payment_line.move_line_id.move_id.ref} + % else: + ${payment_line.communication} + % endif ${payment_line.date} ${format_amount(payment_line.amount_currency, payment_line.currency_id)} diff --git a/account_payment_order_notification/i18n/account_payment_order_notification.pot b/account_payment_order_notification/i18n/account_payment_order_notification.pot index 867ca035e..43965d27e 100644 --- a/account_payment_order_notification/i18n/account_payment_order_notification.pot +++ b/account_payment_order_notification/i18n/account_payment_order_notification.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-02-22 15:35+0000\n" +"PO-Revision-Date: 2023-02-22 15:35+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -36,7 +38,11 @@ msgid "" " \n" " % for payment_line in object.payment_line_ids:\n" " \n" -" ${payment_line.communication}\n" +" % if payment_line.move_line_id.move_id.move_type in (\"in_invoice\", \"in_refund\") and payment_line.move_line_id.move_id.ref:\n" +" ${payment_line.move_line_id.move_id.ref}\n" +" % else:\n" +" ${payment_line.communication}\n" +" % endif\n" " ${payment_line.date}\n" " ${format_amount(payment_line.amount_currency, payment_line.currency_id)}\n" " \n" diff --git a/account_payment_order_notification/i18n/es.po b/account_payment_order_notification/i18n/es.po index 4764d1fee..2e4d6d845 100644 --- a/account_payment_order_notification/i18n/es.po +++ b/account_payment_order_notification/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-14 07:51+0000\n" -"PO-Revision-Date: 2022-12-14 08:54+0100\n" +"POT-Creation-Date: 2023-02-22 15:35+0000\n" +"PO-Revision-Date: 2023-02-22 16:37+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: es\n" @@ -44,7 +44,12 @@ msgid "" " \n" " % for payment_line in object.payment_line_ids:\n" " \n" -" ${payment_line.communication}\n" +" % if payment_line.move_line_id.move_id.move_type in " +"(\"in_invoice\", \"in_refund\") and payment_line.move_line_id.move_id.ref:\n" +" ${payment_line.move_line_id.move_id.ref}\n" +" % else:\n" +" ${payment_line.communication}\n" +" % endif\n" " ${payment_line.date}\n" " ${format_amount(payment_line.amount_currency, " "payment_line.currency_id)}\n" @@ -80,7 +85,12 @@ msgstr "" " \n" " % for payment_line in object.payment_line_ids:\n" " \n" -" ${payment_line.communication}\n" +" % if payment_line.move_line_id.move_id.move_type in " +"(\"in_invoice\", \"in_refund\") and payment_line.move_line_id.move_id.ref:\n" +" ${payment_line.move_line_id.move_id.ref}\n" +" % else:\n" +" ${payment_line.communication}\n" +" % endif\n" " ${payment_line.date}\n" " ${format_amount(payment_line.amount_currency, " "payment_line.currency_id)}\n" @@ -91,7 +101,7 @@ msgstr "" "

No dude en ponerse en contacto con nosotros si tiene alguna pregunta." "

\n" "\n" -" " +" " #. module: account_payment_order_notification #: model:mail.template,subject:account_payment_order_notification.email_account_payment_order_notification From a729ad5257212213be207957cacb692f7605f0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Thu, 23 Feb 2023 08:15:29 +0100 Subject: [PATCH 2/2] [OU-FIX] account_payment_order_notification: Remove unnecessary migration script TT40795 --- .../14.0.1.2.0/noupdate_changes.xml | 37 ------------------- .../migrations/14.0.1.2.0/post-migration.py | 18 --------- 2 files changed, 55 deletions(-) delete mode 100644 account_payment_order_notification/migrations/14.0.1.2.0/noupdate_changes.xml delete mode 100644 account_payment_order_notification/migrations/14.0.1.2.0/post-migration.py diff --git a/account_payment_order_notification/migrations/14.0.1.2.0/noupdate_changes.xml b/account_payment_order_notification/migrations/14.0.1.2.0/noupdate_changes.xml deleted file mode 100644 index 31b2f608c..000000000 --- a/account_payment_order_notification/migrations/14.0.1.2.0/noupdate_changes.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - -

Hello ${object.partner_id.name or ''},

- % if object.order_id.payment_type == 'inbound': -

A debit order including at least one of your invoices has been processed and sent to the bank.

- % else: -

A payment order including at least one of your invoices has been processed and sent to the bank.

- % endif -

It includes the following transactions:

- - - - - - - - - - % for payment_line in object.payment_line_ids: - - - - - - % endfor - -
NumberDateAmount
${payment_line.communication}${payment_line.date}${format_amount(payment_line.amount_currency, payment_line.currency_id)}
-

Do not hesitate to contact us if you have any questions.

- - ]]>
-
-
diff --git a/account_payment_order_notification/migrations/14.0.1.2.0/post-migration.py b/account_payment_order_notification/migrations/14.0.1.2.0/post-migration.py deleted file mode 100644 index 56b2c642e..000000000 --- a/account_payment_order_notification/migrations/14.0.1.2.0/post-migration.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2022 Tecnativa - Víctor Martínez -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.load_data( - env.cr, - "account_payment_order_notification", - "migrations/14.0.1.2.0/noupdate_changes.xml", - ) - openupgrade.delete_record_translations( - env.cr, - "account_payment_order_notification", - ["email_account_payment_order_notification"], - )