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

Why is my custom QWeb report giving a QWebTemplateNotFound error?

Suscribirse

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

Se marcó esta pregunta
2 Respuestas
11998 Vistas
Avatar
Yenthe Van Ginneken (Mainframe Monkey)

Hi everybody

I'm trying to figure out what is the correct way to create a new report in Odoo 8, but I don't get it 100% correct.

What I now have is the following..
sale/sale_report.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            id="report_sale_order"
            string="Quotation / Order"
            model="sale.order" 
            report_type="qweb-pdf"
            file="sale.report_saleorder" 
            name="sale.report_saleorder" 
        />
        <report 
            id="report_opleveringsattest_id"
            string="Opleveringsattest"
            model="res.partner" 
            report_type="qweb-pdf"
            file="sale.report_opleveringsattest" 
            name="sale.report_opleveringsattest" 
        />
    </data>
</openerp>

sale/views/report_opleveringsattest.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_opleveringsattest_document">
    <t t-call="report.external_layout">
        <div class="page">
            <div class="oe_structure"/>
            <div class="row">
                <div class="col-xs-6">
                    <p>TEST</p>
                </div>
            </div>
            <div class="oe_structure"/>
        </div>
    </t>
</template>

<template id="report_opleveringsattest">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, 'partner_id.lang', 'sale.report_opleveringsattest_document')"/>
        </t>
    </t>
</template>
</data>
</openerp>

But then I get the error "SyntaxError: JSON.parse: unexpected end of data at line 2 column 1 of the JSON data"..
Which then tells me

QWebTemplateNotFound: External ID not found in the system: sale.report_opleveringsattest

With kind regards
Yenthe
 

0
Avatar
Descartar
Avatar
Harsh Dhaduk
Mejor respuesta

Hi Yenthe,
You can try this.

In sale/views/report_opleveringsattest.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="report_opleveringsattest_document">

    <t t-call="report.html_container">
        <t t-foreach="docs" t-as="o">
            <t t-call="report.external_layout">
                <div class="page">
                    <h2>TeSt</h2>
        </div>
            </t>
        </t>
    </t>
</template>

<template id="report_opleveringsattest">
    <t t-call="report.html_container">
        <t t-foreach="doc_ids" t-as="doc_id">
            <t t-raw="translate_doc(doc_id, doc_model, ''commercial_partner_id.lang', 'sale.report_opleveringsattest_document')"/>
        </t>
    </t>
</template>
</data>
</openerp>

 

And sale/sale_report.xml

<report
    id="report_opleveringsattest_id"
    string="Opleveringsattest"
    model="res.partner"
    report_type="qweb-pdf"
    file="sale.report_opleveringsattest"
    name="sale.report_opleveringsattest"
/>

 

And finally add the xml files in __openerp__.py like this:

    'data': [
        //other imports are here
       'views/report_opleveringsattest.xml',
       'sale_report.xml',
    ]

2
Avatar
Descartar
Yenthe Van Ginneken (Mainframe Monkey)
Autor

Thank you very much Harsh! I've been so free to edit your answer to fill up a few more details and format it a bit for people in the future. I've both accepted and upvoted your answer as this helped me A LOT. Thanks!

Yenthe Van Ginneken (Mainframe Monkey)
Autor

@Harsh, do you happen to know how I can get the customer his name etc in this report now? I can't seem to access it with just

Yenthe Van Ginneken (Mainframe Monkey)
Autor

If anybody wants to know this you'll need to do a foreach and then print it out with for example.

Harsh Dhaduk

Yes you can simple use o.name and other fields access using "o"

Avatar
Thomas Fossoul
Mejor respuesta

like the same way odoo do it on its module.

Check the following file in the account module :

account_report.xml

views/report_invoice.xml

That's all :)

 

 

0
Avatar
Descartar
Yenthe Van Ginneken (Mainframe Monkey)
Autor

@Thomas, I've updated my question so you can see the code.. in my view it looks like I have everything I need then? What is the reason there is no printing option being showed?

Yenthe Van Ginneken (Mainframe Monkey)
Autor

@Thomas, nevermind I asked for the wrong model on the report. Alright the option is showing up now but when I print I get the error "SyntaxError: JSON.parse: unexpected end of data at line 2 column 1 of the JSON data" any clue on this?

¿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