Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Why is my custom QWeb report giving a QWebTemplateNotFound error?

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
2 Risposte
12000 Visualizzazioni
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
Abbandona
Avatar
Harsh Dhaduk
Risposta migliore

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
Abbandona
Yenthe Van Ginneken (Mainframe Monkey)
Autore

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

@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)
Autore

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

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
Abbandona
Yenthe Van Ginneken (Mainframe Monkey)
Autore

@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)
Autore

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

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

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