[MIG] account_payment_order_notification: Migration to 16.0

This commit is contained in:
Yadier A. De Quesada
2023-06-07 23:30:03 -04:00
committed by Antoni Marroig Campomar
parent 727a2018ee
commit dab30c36a8
6 changed files with 118 additions and 48 deletions

View File

@@ -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)",

View File

@@ -6,48 +6,78 @@
name="model_id"
ref="account_payment_order_notification.model_account_payment_order_notification"
/>
<field name="email_from">${user.email_formatted |safe}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field
name="email_from"
>{{ object.company_id.email_formatted or user.email_formatted }}</field>
<field name="partner_to">{{ object.partner_id.id }}</field>
<field
name="subject"
>${object.company_id.name} Payment Order (Ref ${object.order_id.name or 'n/a'})</field>
<field
name="body_html"
><![CDATA[
<div style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Hello ${object.partner_id.name or ''},</p>
% if object.order_id.payment_type == 'inbound':
<p>A debit order including at least one of your invoices has been processed and sent to the bank.</p>
% else:
<p>A payment order including at least one of your invoices has been processed and sent to the bank.</p>
% endif
<p>It includes the following transactions:</p>
<table>
<thead>
<tr style="height: 15px; background-color: #d8d8d8;font-size: 13px;font-weight:bold;" align="center" valign="middle">
<td>Number</td>
<td>Date</td>
<td>Amount</td>
</tr>
</thead>
<tbody>
% for payment_line in object.payment_line_ids:
<tr>
% if payment_line.move_line_id.move_id.move_type in ("in_invoice", "in_refund") and payment_line.move_line_id.move_id.ref:
<td>${payment_line.move_line_id.move_id.ref}</td>
% else:
<td>${payment_line.communication}</td>
% endif
<td>${format_date(payment_line.date)}</td>
<td>${format_amount(payment_line.amount_currency, payment_line.currency_id)}</td>
</tr>
% endfor
</tbody>
</table>
<p>Do not hesitate to contact us if you have any questions.</p>
</div>
]]></field>
<field name="lang">${object.partner_id.lang}</field>
>{{ object.company_id.name }} Payment Order (Ref {{ object.order_id.name or 'n/a' }})</field>
<field name="body_html" type="html">
<div
style="font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF;
"
>
<p>Hello <t
t-out="object.partner_id.name or ''"
>Brandon Freeman</t>,</p>
<t t-if="object.order_id.payment_type == 'inbound'">
<p
>A debit order including at least one of your invoices has been processed and
sent to the bank.</p>
</t>
<t t-else="">
<p
>A payment order including at least one of your invoices has been processed
and sent to the bank.</p>
</t>
<p>It includes the following transactions:</p>
<table class="table table-striped">
<thead>
<tr
style="height: 15px; background-color: #d8d8d8;font-size: 13px;font-weight:bold;"
align="center"
valign="middle"
>
<td>Number</td>
<td>Date</td>
<td>Amount</td>
</tr>
</thead>
<tbody>
<t t-foreach="object.payment_line_ids" t-as="payment_line">
<tr>
<td>
<t
t-if="payment_line.move_line_id.move_id.move_type in ('in_invoice', 'in_refund') and payment_line.move_line_id.move_id.ref"
>
<t
t-out="payment_line.move_line_id.move_id.ref or ''"
>PY000</t>
</t>
<t t-else="">
<t
t-out="payment_line.communication or ''"
>Email</t>
</t>
</td>
<td>
<t t-out="format_date(payment_line.date)" />
</td>
<td>
<t
t-out="format_amount(payment_line.amount_currency, payment_line.currency_id) or ''"
>$
1000</t>
</td>
</tr>
</t>
</tbody>
</table>
<p>Do not hesitate to contact us if you have any questions.</p>
</div>
</field>
<field name="lang">{{object.partner_id.lang}}</field>
<field name="auto_delete" eval="True" />
</record>
</data>

View File

@@ -61,6 +61,46 @@ msgid ""
"</div>\n"
" "
msgstr ""
"\n"
"<div style=\"font-family: 'Lucida Grande', Ubuntu, Arial, Verdana, sans-"
"serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; \">\n"
" <p>Hello ${object.partner_id.name or ''},</p>\n"
" % if object.order_id.payment_type == 'inbound':\n"
" <p>Una orden de débito que incluye al menos una de sus facturas ha sido"
"procesada y enviada al banco.</p>\n"
" % else:\n"
" <p>Una orden de pago que incluye al menos una de sus facturas ha sido "
"procesada y enviada al banco..</p>\n"
" % endif\n"
" <p>Incluye las siguientes transacciones:</p>\n"
" <table>\n"
" <thead>\n"
" <tr style=\"height: 15px; background-color: #d8d8d8;font-size: "
"13px;font-weight:bold;\" align=\"center\" valign=\"middle\">\n"
" <td>Número</td>\n"
" <td>Fecha</td>\n"
" <td>Cantidad</td>\n"
" </tr>\n"
" </thead>\n"
" <tbody>\n"
" % for payment_line in object.payment_line_ids:\n"
" <tr>\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"
" <td>${payment_line.move_line_id.move_id.ref}</td>\n"
" % else:\n"
" <td>${payment_line.communication}</td>\n"
" % endif\n"
" <td>${format_date(payment_line.date)}</td>\n"
" <td>${format_amount(payment_line.amount_currency, "
"payment_line.currency_id)}</td>\n"
" </tr>\n"
" % endfor\n"
" </tbody>\n"
" </table>\n"
" <p>No dude en ponerse en contacto con nosotros si tiene alguna pregunta.</p>\n"
"</div>\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"

View File

@@ -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()

View File

@@ -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")

View File

@@ -11,8 +11,8 @@
<field name="mail_template_id" />
</group>
</group>
<group name="secondary_group">
<field name="line_ids" nolabel="1">
<group name="secondary_group" col="4">
<field name="line_ids" nolabel="1" colspan="4">
<tree editable="bottom" create="false" delete="false">
<field name="partner_id" force_save="1" />
<field name="email" />