Working on odoo12
I am trying to extend an existing report (report_payment_receipt_document) by creating a Qweb for printing payments in the form of a table.
When trying to install the extension I get the error:AssertionError: Element odoo has extra content: report, line 9
Here is my code.
reports/payment_voucher.xml
<?xml version="1.0"?>
<odoo>
<!-- string="payment voucher" -->
<report id="account.report_payment_receipt_document" model="account.payment" report_type="qweb-html" name="account.report_payment_document_extend" ></report>
<template id="report_payment_document_extend">
<!-- inherit_id="account.report_payment_receipt" -->
<!-- <t t-name="account.report_payment_receipt_document" -->
<t t-name="report_payment_receipt_document" t-extend="report_payment_receipt_document">
<t t-call="web.external_layout">
<!-- <t t-debug="pdb"/> -->
<t t-set="o" t-value="o.with_context({'lang': lang})"/>
<div class="page">
<table class="table table-bordered">
<tr>
<th colspan="5">PAYMENT VOUCHER <span t-field="o.name"/></th>
<!-- t-field="res.company.logo" -->
<td colspan="3"><span t-field="res.company.logo"></span></td>
</tr>
<tr>
<th>PAYEE NAME</th>
<!-- name goes here -->
<td colspan="7"><span t-field="o.partner_id"/></td>
</tr>
<tr>
<th>AMOUNT</th>
<!-- amount goes here -->
<td colspan="7"><span t-field="o.amount" t-options="{'widget': 'monetary', 'display_currency': o.currency_id}"/>
</td>
</tr>
<tr>
<th>AMOUNT IN WORDS</th>
<td colspan="7"></td>
</tr>
<tr>
<th rowspan="2">PAID IN</th>
<td>cash</td>
<td>to be added</td>
<td>cheque</td>
<!-- <span><t-field="account.journal.Bank"></span> -->
<td><span t-field="o.journal.Bank"></span></td>
<td>checkbox x</td>
<td>mpesa</td>
<td>to be added</td>
<tr>
<td colspan="2"></td>
<td colspan="2">some amount</td>
<td colspan="3"></td>
</tr>
</tr>
<tr>
<th>BEING PAYMENT FOR</th>
<td colspan="7">to be added</td>
</tr>
</table>
<table class="table table-bordered">
<tbody>
<tr t-foreach="o.invoice_ids" t-as="inv">
<th><span>Invoice Number</span></th>
<td><span t-field="inv.number"></span></td>
<th><span>Amount</span></th>
<td><span t-field="inv.amount_total"></span></td>
</tr>
</tbody>
</table>
<br/>
<table class="table table-bordered">
<tr>
<th>PREPARED BY</th>
<td colspan="3">to be added</td>
<th>DATE</th>
<td colspan="2" t-if="o.payment_date"></td>
<th>SIGN</th>
<td colspan="3">space</td>
</tr>
<tr>
<th>APPROVED BY</th>
<td colspan="3">to be added</td>
<th>DATE</th>
<td colspan="2">to be added</td>
<th>SIGN</th>
<td colspan="3">space</td>
</tr>
<tr>
<th>RECEIVED BY</th>
<td colspan="2">to be added</td>
<th>ID no</th>
<td colspan="2">to be added</td>
<th>DATE</th>
<td colspan="2">to be added</td>
<th>SIGN</th>
<td colspan="2">space</td>
</tr>
</table>
</div>
</t>
</t>
</template>
</odoo>