Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Removing default invoice template

Subscribe

Get notified when there's activity on this post

This question has been flagged
invoicexmltemplatesprintbuttonodooV8
3 Replies
9789 Views
Avatar
E.M.

Hi, I have created a module which installs a new custom invoice template.

So from PRINT menu the user can choose either the "Standard Invoice" or the new "Custom Invoice".

I would like to remove the "Standard Invoice", what should I do? 

Is it possible to do it via XML?

0
Avatar
Discard
Akhil P Sivan

You want to override the default invoice template by your custom module?

Avatar
Emipro Technologies Pvt. Ltd.
Best Answer

There are two different ways to remove the already available report.

1) Override new report on existing (default) report.

This is simple way to hide / delete existing (default) report. While creating new report we just need to give External ID same as like existing report. In your case while you create your report you have to define it as like below.

 <report 
id="account.account_invoices"
model="account.invoice"
string="New Invoice Report"
report_type="qweb-pdf"
name="account.new_report_invoice"
file="new_report_invoice"
/>

2) Create new report and delete existing (default) report

This is complex method as compare to first. In this method we have to use <delete> tag to delete existing (default) report. While use of the <delete> tag we have to take care about noupdate parameter of <data> tag. In your case we have to define <delete> tag as like below.

<data noupdate="1">
<delete model="ir.actions.report.xml" id="account.account_invoices" />
</data>

It will helpful to you.

Thanks.


2
Avatar
Discard
Avatar
Akhil P Sivan
Best Answer

If you want to override the default invoice template by your custom module, with different header and footer, refer the following code:

<openerp>
<data>
<template id="report_invoice_document_inherited" inherit_id="account.report_invoice_document">
<xpath expr="//t[@t-call='report.external_layout']" position="replace">
<t t-call="report.new_layout">
<div class="page">
<t t-set="company" t-value="res_company">
</t>
<br />

<div class="row mt16 mb16">
<div class="col-xs-5">

<br />
<div style="background:#01008A; font-size:13.5pt;font-family:&quot;Helvetica&quot;,sans-serif;color:white" valign="top">
<strong><center>Bill To</center></strong>
</div>
<address style="padding:5px 5px 5px 5px;border-width: 1px; border-style: solid; border-color: #002b49;" t-field="o.address_shipping_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
</div>
<div class="col-xs-5 col-xs-push-2" >
<br />
<div style="background:#01008A; font-size:13.5pt;font-family:&quot;Helvetica&quot;,sans-serif;color:white" valign="top">
<strong><center>Ship To</center></strong>
</div>
<address style="padding:5px 5px 5px 5px;border-width: 1px; border-style: solid; border-color: #002b49;" t-field="o.partner_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
</div>
</div>
<h2>
<span t-if="o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')">Invoice</span>
<span t-if="o.type == 'out_invoice' and o.state == 'proforma2'">PRO-FORMA</span>
<span t-if="o.type == 'out_invoice' and o.state == 'draft'">Draft Invoice</span>
<span t-if="o.type == 'out_invoice' and o.state == 'cancel'">Cancelled Invoice</span>
<span t-if="o.type == 'out_refund'">Refund</span>
<span t-if="o.type == 'in_refund'">Supplier Refund</span>
<span t-if="o.type == 'in_invoice'">Supplier Invoice</span>
<span t-field="o.number"/>
</h2>
<div class="row mt32 mb32">
<div class="col-xs-2" t-if="o.name">
<strong>Description:</strong>
<p t-field="o.name"/>
</div>
<div class="col-xs-2" t-if="o.date_invoice">
<strong>Invoice Date:</strong>
<p t-field="o.date_invoice"/>
</div>
<div class="col-xs-2" t-if="o.origin">
<strong>Source:</strong>
<p t-field="o.origin"/>
</div>
<div class="col-xs-2" t-if="o.partner_id.ref">
<strong>Customer Code:</strong>
<p t-field="o.partner_id.ref"/>
</div>
<div class="col-xs-2" t-if="o.reference">
<strong>Reference:</strong>
<p t-field="o.reference"/>
</div>
</div>
<div class="row mt16 mb16">
<div class="col-xs-12">

<table class="table table-condensed" style="border-left:1px solid #000000;border-top:1px solid #000000;border-right:1px solid #000000;">
<thead>
<tr style="background-color:#F4F4F4;">
<th style="border:1px solid #000000;">Quantity</th>
<th style="border:1px solid #000000;">Item Code</th>
<th style="border:1px solid #000000;">Description</th>
<th class="text-right" style="border:1px solid #000000;">Price Each</th>
<th class="text-right" style="border:1px solid #000000;">Amount</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-set="item_no" t-value="1" />
<tr style="border:1px solid #000000;" t-foreach="o.invoice_line" t-as="l">
<t t-if="item_no%2!=0">

<td style="border-left:1px solid #000000;">

<span t-field="l.quantity"/>


</td>
<td style="border-left:1px solid #000000;">
<span t-field="l.product_id.name"/>
</td>
<td style="border-left:1px solid #000000;">
<span t-field="l.name"/>
</td>

<td style="border-left:1px solid #000000;" class="text-right">
<span t-field="l.price_unit"/>
</td>

<td style="border-left:1px solid #000000;" class="text-right">
<span t-field="l.price_subtotal" t-field-options='{"widget": "monetary", "display_currency":
"o.currency_id"}'/>
</td>
</t>
<t t-if="item_no%2==0">

<td style="border-left:1px solid #000000;background-color:#F4F4F4;">

<span t-field="l.quantity"/>


</td>
<td style="border-left:1px solid #000000;background-color:#F4F4F4;">
<span t-field="l.product_id.name"/>
</td>
<td style="border-left:1px solid #000000;background-color:#F4F4F4;">
<span t-field="l.name"/>
</td>

<td style="border-left:1px solid #000000;background-color:#F4F4F4;" class="text-right">
<span t-field="l.price_unit"/>
</td>

<td style="border-left:1px solid #000000;background-color:#F4F4F4;" class="text-right">
<span t-field="l.price_subtotal" t-field-options='{"widget": "monetary", "display_currency":
"o.currency_id"}'/>
</td>
</t>
<t t-set="item_no" t-value="item_no+1" />

</tr>
<tr style="border-top:1px solid #000000;">
<td style="border-left:2px solid #ffffff;border-top:1px solid #000000;"></td>
<td style="border-top:1px solid #000000;"></td>
<td style="border-top:1px solid #000000;"></td>
<td style="border-left:1px solid #000000;border-bottom:1px solid #000000;border-top:1px solid #000000;"><strong>Total:</strong></td>
<td style="border-bottom:1px solid #000000;border-top:1px solid #000000;"><span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency":
"o.currency_id"}'/></td>
</tr>

</tbody>
</table>
</div>

</div>
<p t-if="o.comment">
<span t-field="o.comment"/>
</p>
<p t-if="o.fiscal_position.note">
<strong>Fiscal Position Remark:</strong>
<span t-field="o.fiscal_position.note"/>
</p>
</div>
</t>
</xpath>


</template>


<template id="report.new_layout">
<!-- Multicompany -->
<t t-if="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id"></t>
</t>
<t t-if="not o or not 'company_id' in o">
<t t-set="company" t-value="res_company"></t>
</t>

<t t-call="report.new_layout_header" />
<t t-raw="0" />
<t t-call="report.new_layout_footer" />
</template>

<template id="report.new_layout_header">
<div class="header">
<div class="row">
<div class="col-xs-3">
<img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
</div>
<div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
</div>
<div class="row zero_min_height">
<div class="col-xs-12">
<div style="border-bottom: 1px solid black;"></div>
</div>
</div>
<div class="row mt8 mb8">
<div class="col-xs-5">
<div t-field="company.partner_id"
t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'
style="border:1px solid #000000;"/>
</div>
</div>

</div>
</template>

<template id="report.new_layout_footer">

<div class="footer">

<div t-if="company.sale_note" class="row mt16 mb16">
<div class="col-xs-6">
<div style="border:1px solid #000000;background-color:#01008A;color:#ffffff">
<strong>International Banking Detail</strong>
</div>
<div style="border:1px solid #000000;">
<div t-field="company.sale_note"/>
</div>
</div>

</div>

</div>
</template>

</data>
</openerp>


1
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Limited number of available templates with print button - V8 - JasperReport
templates jasper ireport printbutton odooV8
Avatar
1
Jul 17
3350
How to edit the template by customizing a module which has already edited from front end website editor.
xml templates odoo odooV8 website_sale
Avatar
0
Oct 15
119
Add Fields to Invoice
invoice templates
Avatar
Avatar
1
Oct 25
4562
Change text of "View Invoice" button from Invoice email
invoice templates
Avatar
0
Jan 25
1882
Where can I find the Invoice Template in v17?
invoice templates
Avatar
Avatar
Avatar
3
Feb 24
6503
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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