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

Override default QWEB template - not part of it but all content

S'inscrire

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

Cette question a été signalée
invoiceqwebtemplatesquotationsale.order
2 Réponses
8935 Vues
Avatar
Matija

Hi, I need to create custom template for Quotations/Invoices and inheriting parts of it is not option - I need to inherit all of its contents and replace it with customised content. 

I'm working on template report_saleorder_document

I tried to do it like this:

In my custom module in folder report I created sale_order_report_inherited.xml in which I put this code (only upper part of it is in screenshot) - see screenshot here https://ibb.co/5xWFnGw

I added that file in manifest.py and added 'sale' in depends. When I try to change some text in this template nothing changes on quotation pdf - what am I doing wrong - how to inherit entire template? Thank you!

0
Avatar
Ignorer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse

Hi,

You can achieve this in two ways. Either you can inherit the report_saleorder_document and replace it from the < t t-call web.external_layout> using xpath.

<template id="custom_report_saleorder_document" inherit_id="sale.report_saleorder_document">


    <xpath expr="//t[@t-call='web.external_layout'" position="replace">


        <t t-call="web.externale_layout>


            ---- Your Codes----


        </t>


    </xpath>


</template>


Or, you can call your custom template where the report_saleorder_document is being called. For that, create a custom temlplate, and where t-call for report_saleorder_document is happening, replace it using xpath and call your newly created template.

Regards

1
Avatar
Ignorer
Avatar
Ashish Hirpara
Meilleure réponse

To inherit an entire template in Odoo, you need to create a new XML file with the same structure as the original template. Then, you can copy the contents of the original template into your new XML file and modify it as needed.

Here is an example of how you could inherit the report_saleorder_document template:

  1. Create a new XML file in your custom module, for example my_module/views/report_saleorder_document_inherited.xml
  2. In this new XML file, create a new template that extends the original report_saleorder_document template. This is done using the t-extend attribute:
id="report_saleorder_document_inherited" inherit_id="sale.report_saleorder_document">
    ...

  1. Inside this new template, you can now copy the entire contents of the original report_saleorder_document template and modify it as needed.

  2. In your module's __manifest__.py file, make sure to add the sale module to the depends list, as well as the new XML file you created to the data list:

'depends': ['sale'],
'data': [
    'views/report_saleorder_document_inherited.xml',
],
  1. Finally, you need to tell Odoo to use your new template instead of the original one. You can do this by adding a report_saleorder_document_inherited entry to the ir.actions.report.xml_id dictionary in your __manifest__.py file:
'ir.actions.report.xml_id': [
    ('report_saleorder_document', 'my_module.report_saleorder_document_inherited'),
],

After installing your module, the system should now use your custom template for quotations and invoices instead of the original one. Note that you may need to clear the cache and restart the server for the changes to take effect.

4
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é
Custom Invoice Report
invoice qweb templates
Avatar
0
janv. 24
2305
Custom Invoice PDF template
invoice qweb templates replace
Avatar
1
déc. 23
2507
How to hide "discount" columns on saleorders/invoices if there are none? Résolu
invoice discount qweb sale.order
Avatar
Avatar
2
déc. 22
9628
Edit invoice template in Odoo 8
invoice templates printing quotation
Avatar
Avatar
3
juin 17
4559
Print Invoice with 10 lines per pages Résolu
python invoice qweb print templates
Avatar
Avatar
2
oct. 19
9488
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