[FIX] account_payment_order_notification: Fix template body.

Avoid re-formatting the content causing an error when rendering the template.

TT40795
This commit is contained in:
Víctor Martínez
2022-12-13 16:21:43 +01:00
committed by Yadier A. De Quesada
parent b0e691cf7f
commit 14add33a8e
6 changed files with 63 additions and 3 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.0.1",
"version": "14.0.1.2.0",
"category": "Banking addons",
"website": "https://github.com/OCA/bank-payment",
"author": "Tecnativa, Odoo Community Association (OCA)",

View File

@@ -30,6 +30,7 @@
<td>Amount</td>
</tr>
</thead>
<tbody>
% for payment_line in object.payment_line_ids:
<tr>
<td>${payment_line.communication}</td>
@@ -37,6 +38,7 @@
<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>

View File

@@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-14 07:51+0000\n"
"PO-Revision-Date: 2022-12-14 07:51+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -33,6 +35,7 @@ msgid ""
" <td>Amount</td>\n"
" </tr>\n"
" </thead>\n"
" <tbody>\n"
" % for payment_line in object.payment_line_ids:\n"
" <tr>\n"
" <td>${payment_line.communication}</td>\n"
@@ -40,6 +43,7 @@ msgid ""
" <td>${format_amount(payment_line.amount_currency, payment_line.currency_id)}</td>\n"
" </tr>\n"
" % endfor\n"
" </tbody>\n"
" </table>\n"
" <p>Do not hesitate to contact us if you have any questions.</p>\n"
"</div>\n"

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-19 06:43+0000\n"
"PO-Revision-Date: 2022-10-19 08:44+0200\n"
"POT-Creation-Date: 2022-12-14 07:51+0000\n"
"PO-Revision-Date: 2022-12-14 08:54+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
@@ -41,6 +41,7 @@ msgid ""
" <td>Amount</td>\n"
" </tr>\n"
" </thead>\n"
" <tbody>\n"
" % for payment_line in object.payment_line_ids:\n"
" <tr>\n"
" <td>${payment_line.communication}</td>\n"
@@ -49,6 +50,7 @@ msgid ""
"payment_line.currency_id)}</td>\n"
" </tr>\n"
" % endfor\n"
" </tbody>\n"
" </table>\n"
" <p>Do not hesitate to contact us if you have any questions.</p>\n"
"</div>\n"
@@ -75,6 +77,7 @@ msgstr ""
" <td>Importe</td>\n"
" </tr>\n"
" </thead>\n"
" <tbody>\n"
" % for payment_line in object.payment_line_ids:\n"
" <tr>\n"
" <td>${payment_line.communication}</td>\n"
@@ -83,6 +86,7 @@ msgstr ""
"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"

View File

@@ -0,0 +1,37 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="email_account_payment_order_notification" model="ir.rule">
<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>
<td>${payment_line.communication}</td>
<td>${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>
</record>
</odoo>

View File

@@ -0,0 +1,13 @@
# 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",
)