Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

How to change the report type from pdf to html in code

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
invoicereports
8 Réponses
12107 Vues
Avatar
Sameer Ahmad

Hi,

In the accounting app under the customers and in the invoice section, i want to print invoices but the challenge is that when i click on print, it directly downloads the report(PDF) but i want to show the preview first and then download if needed. I know this can be achieved by changing the report type to html from pdf in UI but i want to make code level changes to achieve this and I tried changing the report type to qweb-html from qweb-pdf  in the report_invoice.xml file but it didn't have any effect and now i'm stuck and confused what to do and where to start. Any guidance or help is  appreciated.

Thank you!

0
Avatar
Ignorer
OdooBot
Hi,
My karma wont allow commenting but yeah I've tried changing it to qweb-html from qweb-pdf and also upgraded the appropriate app but no luck. The reports are still in pdf and didn't get changed to html

Cheers,
Sameer Ahmad.


On Wednesday, 27 February, 2019, 1:02:27 pm IST, Cybrosys Techno Solutions Pvt.Ltd <odoo@cybrosys.com> wrote:


View Forum Post Odoo S.A.

A new question How to change the report type from pdf to html in code on Help has been posted. Click here to access the question :

See question


Sent by Odoo S.A. using Odoo.

Cybrosys Techno Solutions Pvt.Ltd

Can you check in a fresh database and see. Might be some custom code, creates the issue

Sameer Ahmad
Auteur

Hi Cybrosys,

As I'm building a custom app, I've tried the solution given by Mitul and it worked just fine :) but i'm still confused as to why your approach and very similar to your approach was my approach didn't work

Cybrosys Techno Solutions Pvt.Ltd

Nice to hear that you got a solution, so you have tried in the custom code, not inside the default code? we just thought you have edited the core and checked. Anyway, you have got a solution. :)

Sameer Ahmad
Auteur

I firstly tried in custom code then when it didn't work i went back and tried in base code to verify whether my approach was right or not. Then when the base code version also didn't give out any result i thought my approach was wrong and approached the forums.

I have just started learning odoo and still at the very beginning stages and i'm glad to see your prompt answers whenever i post a question in the forum. Please keep up this good work and guide novices like us :) A million thanks from newbie's like me

Avatar
Mitul Shingala
Meilleure réponse

hello 

try like below code into your module for changing the report type .

<record id="account.account_invoices" model="ir.actions.report">
        <field name="report_type" eval="'qweb-html'"/>
    </record>
2
Avatar
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

Hi,

What you have done is the right way, to change the PDF to HTML as you have told you can do it either from the front end or from the backend. While doing it from the backend what we have to do is to change the qweb-pdf to qweb-html


Make sure that you have upgraded the correct module. In the case of accounting report upgrade the module with name Invoicing(technical name account)

After upgrading the module after the changes in the code,


Type is changed to the HTML. In your case check the report tag is not rewritten in other places and the file contains have no noupdate="1"

Thanks


2
Avatar
Ignorer
Avatar
Se
Meilleure réponse

good community (Y)

1
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Invoice pdf report from API endpoint is not getting
invoice reports
Avatar
Avatar
1
sept. 24
3099
Customer Details on the left Résolu
invoice reports v17
Avatar
Avatar
2
avr. 24
2584
Odoo 16. Report same report has two different faces.
invoice reports odoo16features
Avatar
Avatar
1
déc. 23
2647
Strip string from a field with defined separator in invoice report
invoice custom reports
Avatar
0
mars 22
2
Override account_invoices report to use different template Résolu
invoice templates reports
Avatar
Avatar
2
juin 20
6686
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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