Files
odoo_source/addons/account/views/report_payment_receipt_templates.xml
T
Martin Trigaux f9432df1b8 [FIX] account: fallback on company language
The field partner_id of an account.payment is not required and there
are no value specified for internal transfers.
Before this patch the report had lang=None so was bypassing the
translation system.
Fallback on company's language instead

Fixes odoo/odoo#43377

closes odoo/odoo#56030

X-original-commit: 63b161e8c927889cd82da1ed6a0973234c639fb1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-08-18 07:55:11 +00:00

71 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_payment_receipt_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<div class="page">
<h3><strong>Payment Receipt: <span t-field="o.name"/></strong></h3>
<div class="row mt64">
<div class="col-6" t-if="o.date">
<strong>Payment Date: </strong> <span t-field="o.date"/>
</div>
</div>
<div class="row">
<div class="col-6" t-if="o.partner_type">
<t t-if="o.partner_type == 'customer'">
<strong>Customer: </strong>
</t>
<t t-if="o.partner_type == 'supplier'">
<strong>Vendor: </strong>
</t><span t-field="o.partner_id"/>
</div>
<div class="col-6" t-if="o.payment_method_id">
<strong>Payment Method: </strong><span t-field="o.payment_method_id.name"/>
</div>
</div>
<div class="row mb64">
<div class="col-6" t-if="o.amount">
<strong>Payment Amount: </strong><span t-field="o.amount" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
</div>
<div class="col-6" t-if="o.ref">
<strong>Memo: </strong><span t-field="o.ref"/>
</div>
</div>
<table class="table table-sm">
<thead>
<tr>
<th><span>Invoice Date</span></th>
<th><span>Invoice Number</span></th>
<th><span>Reference</span></th>
<th class="text-right"><span>Original Amount</span></th>
<th class="text-right"><span>Amount Paid</span></th>
<th class="text-right"><span>Balance</span></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.move_id._get_reconciled_invoices_partials()" t-as="rec">
<t t-set="amount" t-value="rec[1]"/>
<t t-set="inv" t-value="rec[2].move_id"/>
<td><span t-field="inv.invoice_date"/></td>
<td><span t-field="inv.name"/></td>
<td><span t-field="inv.ref"/></td>
<td class="text-right"><span t-field="inv.amount_total"/></td>
<td class="text-right"><span t-esc="amount" t-options="{'widget': 'monetary', 'display_currency': inv.currency_id}"/></td>
<td class="text-right"><span t-field="inv.amount_residual"/></td>
</tr>
</tbody>
</table>
</div>
</t>
</template>
<template id="report_payment_receipt">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="lang" t-value="o.partner_id.lang or o.company_id.partner_id.lang"/>
<t t-call="account.report_payment_receipt_document" t-lang="lang"/>
</t>
</t>
</template>
</odoo>