From 48bb22b5f2ac9fad4b9a7ce3d54a02430835254f Mon Sep 17 00:00:00 2001 From: "Yadier A. De Quesada" Date: Wed, 7 Jun 2023 23:30:03 -0400 Subject: [PATCH] [MIG] account_payment_order_notification: Migration to 16.0 --- .../__manifest__.py | 2 +- .../data/mail_template_data.xml | 110 +++++++++++------- account_payment_order_notification/i18n/es.po | 44 ++++++- ...test_account_payment_order_notification.py | 4 +- ...zard_account_payment_order_notification.py | 2 +- ...count_payment_order_notification_views.xml | 4 +- 6 files changed, 118 insertions(+), 48 deletions(-) diff --git a/account_payment_order_notification/__manifest__.py b/account_payment_order_notification/__manifest__.py index ce0632a48..abc062139 100644 --- a/account_payment_order_notification/__manifest__.py +++ b/account_payment_order_notification/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Account Payment Order Notification", - "version": "14.0.1.5.0", + "version": "16.0.1.0.0", "category": "Banking addons", "website": "https://github.com/OCA/bank-payment", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/account_payment_order_notification/data/mail_template_data.xml b/account_payment_order_notification/data/mail_template_data.xml index 148e6a376..d43cf8c8d 100644 --- a/account_payment_order_notification/data/mail_template_data.xml +++ b/account_payment_order_notification/data/mail_template_data.xml @@ -6,48 +6,78 @@ name="model_id" ref="account_payment_order_notification.model_account_payment_order_notification" /> - ${user.email_formatted |safe} - ${object.partner_id.id} + {{ object.company_id.email_formatted or user.email_formatted }} + {{ object.partner_id.id }} ${object.company_id.name} Payment Order (Ref ${object.order_id.name or 'n/a'}) - -

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: - - % if payment_line.move_line_id.move_id.move_type in ("in_invoice", "in_refund") and payment_line.move_line_id.move_id.ref: - - % else: - - % endif - - - - % endfor - -
NumberDateAmount
${payment_line.move_line_id.move_id.ref}${payment_line.communication}${format_date(payment_line.date)}${format_amount(payment_line.amount_currency, payment_line.currency_id)}
-

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

- - ]]>
- ${object.partner_id.lang} + >{{ object.company_id.name }} Payment Order (Ref {{ object.order_id.name or 'n/a' }}) + +
+

Hello Brandon Freeman,

+ +

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

+
+ +

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

+
+

It includes the following transactions:

+ + + + + + + + + + + + + + + + + +
NumberDateAmount
+ + PY000 + + + Email + + + + + $ + 1000 +
+

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

+
+
+ {{object.partner_id.lang}} diff --git a/account_payment_order_notification/i18n/es.po b/account_payment_order_notification/i18n/es.po index e2d7aa86f..e500bb532 100644 --- a/account_payment_order_notification/i18n/es.po +++ b/account_payment_order_notification/i18n/es.po @@ -61,6 +61,46 @@ msgid "" "\n" " " msgstr "" +"\n" +"
\n" +"

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

\n" +" % if object.order_id.payment_type == 'inbound':\n" +"

Una orden de débito que incluye al menos una de sus facturas ha sido" +"procesada y enviada al banco.

\n" +" % else:\n" +"

Una orden de pago que incluye al menos una de sus facturas ha sido " +"procesada y enviada al banco..

\n" +" % endif\n" +"

Incluye las siguientes transacciones:

\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" % for payment_line in object.payment_line_ids:\n" +" \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" +" \n" +" % else:\n" +" \n" +" % endif\n" +" \n" +" \n" +" \n" +" % endfor\n" +" \n" +"
NúmeroFechaCantidad
${payment_line.move_line_id.move_id.ref}${payment_line.communication}${format_date(payment_line.date)}${format_amount(payment_line.amount_currency, " +"payment_line.currency_id)}
\n" +"

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 @@ -341,12 +381,12 @@ msgstr "Historial de comunicación del sitio web" #. module: account_payment_order_notification #: model:ir.model,name:account_payment_order_notification.model_wizard_account_payment_order_notification msgid "Wizard Account Payment Order Notification" -msgstr "" +msgstr "Ventana de notificación de orden de pago de cuenta" #. module: account_payment_order_notification #: model:ir.model,name:account_payment_order_notification.model_wizard_account_payment_order_notification_line msgid "Wizard Account Payment Order Notification Line" -msgstr "" +msgstr "Ventana de notificación para línea de orden de pago" #~ msgid "" #~ "\n" diff --git a/account_payment_order_notification/tests/test_account_payment_order_notification.py b/account_payment_order_notification/tests/test_account_payment_order_notification.py index 2ee102552..43dec6678 100644 --- a/account_payment_order_notification/tests/test_account_payment_order_notification.py +++ b/account_payment_order_notification/tests/test_account_payment_order_notification.py @@ -1,9 +1,9 @@ # Copyright 2022 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests import Form, common +from odoo.tests import Form, TransactionCase -class TestAccountPaymentOrderNotification(common.SavepointCase): +class TestAccountPaymentOrderNotification(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py index d87eda53f..c3acf7752 100644 --- a/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py +++ b/account_payment_order_notification/wizard/wizard_account_payment_order_notification.py @@ -89,5 +89,5 @@ class WizardAccountPaymentOrderNotificationLine(models.TransientModel): partner_id = fields.Many2one( comodel_name="res.partner", required=True, string="Partner", readonly=True ) - email = fields.Char(string="Email") + email = fields.Char() to_send = fields.Boolean(string="To send") diff --git a/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml b/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml index 9dda850c1..6598ebc4d 100644 --- a/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml +++ b/account_payment_order_notification/wizard/wizard_account_payment_order_notification_views.xml @@ -11,8 +11,8 @@ - - + +