Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

AssertionError: Element odoo has extra content: report, line 9

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
2 Respuestas
4156 Vistas
Avatar
lisa

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> 



0
Avatar
Descartar
Avatar
lisa
Autor Mejor respuesta

@ Waleed Mohsen, I  have enforced the suggested changes and I am still getting the same error.

0
Avatar
Descartar
Waleed Ali Mohsen

You have many issues in your code.

The below link an artical for how to Inheriting and modifying QWeb reports:

https://www.odoo.yenthevg.com/inheriting-and-modifying-qweb-reports/

Here you are the Qweb Tutorial:

https://www.odoo.com/documentation/12.0/reference/qweb.html#id3

lisa
Autor

Thank you for the links. I have made a few changes:

I am getting this error: AssertionError: Element odoo has extra content: template, line 3

This is how my code looks like now:

<?xml version="1.0"?>

<odoo>

<template id="report_payment_document_extend" inherit_id="account.report_payment_receipt_document"></template>

<!-- xpath to where I want the change -->

<xpath expr="//div[class='page']" position="inside">

<table class="table table-bordered">

<tr>

<th colspan="5">

<h1>PAYMENT VOUCHER</h1>

<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>

<h2>PAYEE NAME</h2>

</th>

<!-- name goes here -->

<td colspan="7"><span t-field="o.partner_id"/></td>

</tr>

<tr>

<th>

<h2>AMOUNT</h2>

</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>

<h2>AMOUNT IN WORDS</h2>

</th>

<td colspan="7"></td>

</tr>

<tr>

<th rowspan="2"><h2>PAID IN</h2></th>

<th><h2>cash</h2></th>

<td><h2>to be added</h2></td>

<th><h2>cheque</h2></th>

<!-- <span><t-field="account.journal.Bank"></span> -->

<td><span t-field="o.journal.Bank"></span></td>

<th><h2>checkbox</h2></th>

<td><h2>x</h2></td>

<th><h2>mpesa</h2></th>

<td><h2>to</h2></td>

<tr>

<td colspan="2"></td>

<td colspan="2"><h2>Some amount</h2></td>

<td colspan="3"></td>

</tr>

</tr>

<tr>

<th><h2>BEING PAYMENT FOR</h2></th>

<td colspan="8"></td>

</tr>

</table>

<table class="table table-bordered">

<tbody>

<tr t-foreach="o.invoice_ids" t-as="inv">

<th><span><h2>Invoice Number</h2></span></th>

<td><span t-field="inv.number"></span></td>

<th><span><h2>Amount</h2></span></th>

<td><span t-field="inv.amount_total"></span></td>

</tr>

</tbody>

</table>

<br/>

<table class="table table-bordered">

<tr>

<th><h2>PREPARED BY</h2></th>

<td colspan="3">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2" t-if="o.payment_date"></td>

<th><h2>SIGN</h2></th>

<td colspan="3">space</td>

</tr>

<tr>

<th><h2>APPROVED BY</h2></th>

<td colspan="3">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2">to be added</td>

<th><h2>SIGN</h2></th>

<td colspan="3">space</td>

</tr>

<tr>

<th><h2>RECEIVED BY</h2></th>

<td colspan="2">to be added</td>

<th><h2>ID no</h2></th>

<td colspan="2">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2">to be added</td>

<th><h2>SIGN</h2></th>

<td colspan="2">space</td>

</tr>

</table>

</xpath>

</odoo>

Waleed Ali Mohsen

As I can see, you closed the template tag

<template id="report_payment_document_extend" inherit_id="account.report_payment_receipt_document"></template>

You should move the </template> to the end of the report as below:

<?xml version="1.0"?>

<odoo>

<template id="report_payment_document_extend" inherit_id="account.report_payment_receipt_document">

<!-- xpath to where I want the change -->

<xpath expr="//div[class='page']" position="inside">

<table class="table table-bordered">

<tr>

<th colspan="5">

<h1>PAYMENT VOUCHER</h1>

<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>

<h2>PAYEE NAME</h2>

</th>

<!-- name goes here -->

<td colspan="7"><span t-field="o.partner_id"/></td>

</tr>

<tr>

<th>

<h2>AMOUNT</h2>

</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>

<h2>AMOUNT IN WORDS</h2>

</th>

<td colspan="7"></td>

</tr>

<tr>

<th rowspan="2"><h2>PAID IN</h2></th>

<th><h2>cash</h2></th>

<td><h2>to be added</h2></td>

<th><h2>cheque</h2></th>

<!-- <span><t-field="account.journal.Bank"></span> -->

<td><span t-field="o.journal.Bank"></span></td>

<th><h2>checkbox</h2></th>

<td><h2>x</h2></td>

<th><h2>mpesa</h2></th>

<td><h2>to</h2></td>

<tr>

<td colspan="2"></td>

<td colspan="2"><h2>Some amount</h2></td>

<td colspan="3"></td>

</tr>

</tr>

<tr>

<th><h2>BEING PAYMENT FOR</h2></th>

<td colspan="8"></td>

</tr>

</table>

<table class="table table-bordered">

<tbody>

<tr t-foreach="o.invoice_ids" t-as="inv">

<th><span><h2>Invoice Number</h2></span></th>

<td><span t-field="inv.number"></span></td>

<th><span><h2>Amount</h2></span></th>

<td><span t-field="inv.amount_total"></span></td>

</tr>

</tbody>

</table>

<br/>

<table class="table table-bordered">

<tr>

<th><h2>PREPARED BY</h2></th>

<td colspan="3">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2" t-if="o.payment_date"></td>

<th><h2>SIGN</h2></th>

<td colspan="3">space</td>

</tr>

<tr>

<th><h2>APPROVED BY</h2></th>

<td colspan="3">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2">to be added</td>

<th><h2>SIGN</h2></th>

<td colspan="3">space</td>

</tr>

<tr>

<th><h2>RECEIVED BY</h2></th>

<td colspan="2">to be added</td>

<th><h2>ID no</h2></th>

<td colspan="2">to be added</td>

<th><h2>DATE</h2></th>

<td colspan="2">to be added</td>

<th><h2>SIGN</h2></th>

<td colspan="2">space</td>

</tr>

</table>

</xpath>

</template>

</odoo>

Avatar
Waleed Ali Mohsen
Mejor respuesta

Hi, I think your code is not working due to the below line as you have to put the module name

 <t t-name="report_payment_receipt_document" t-extend="report_payment_receipt_document">

it should be:

 <t  t-extend="account.report_payment_receipt_document">
 Here you will extend the report, but you have to use t-jquery sub-directives to determine where you will add your additions. 
</t>

example:

<t t-extend="base.template">
    <t t-jquery="ul" t-operation="append">
        <li>new element</li>
    </t>
</t>

Here you are the Qweb Tutorial:

https://www.odoo.com/documentation/12.0/reference/qweb.html#id3

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now