Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to show sum of tax groups in Quotations view and report

on 6/8/15, 8:42 AM 851 views

The standard quotation view shows eg:

Product | Description | Quantity | Unit Price | Taxes | Subtotal

                                                               untaxed Amount:



We have 2 different kind of tax groups and they must be separeted in the total tax calculation. This is an order of the local
tax authority. So there is the tax group with VAT 20% and another taxgroup with lets call it WA 5%.

Right now, the taxes in the quotations will be right calculated, but they will displayed as sum in the field 'Taxes' (before Total).
We have to display the sum of VAT 20% and the sum of WA 5%. It would look like this:

Product | Description | Quantity | Unit Price | Taxes | Subtotal

                                                                 untaxed Amount:

                                                                            VAT   5%:

                                                                            VAT 20%:


How can I achieve that in the Quotations View as well as in the Quotations report?

Hi, did you solved your requirements? best regards

on 10/16/15, 10:42 AM

Akhil P Sivan

--Akhil P Sivan--
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 10/16/15, 1:40 PM


I hope you need like this: 

Form view 


For that you can create two compute fields in purchase.order model, that calculates the sum of each tax groups in the product lines. Then you need to call these fields in the form view and reports. Try like this:

in .py file

class purchase_order(models.Model):
_inherit = 'purchase.order'

tax_t1 = fields.Float(compute='_compute_tax', string="VAT5%")
tax_t2 = fields.Float(compute='_compute_tax', string="VAT20%")

def _compute_tax(self):

sum_v5 = 0
sum_v20 = 0
for rec in self.order_line:
if rec.taxes_id:
for tax in rec.taxes_id:
if tax.name == "VAT5":
sum_v5 = sum_v5 + (rec.price_subtotal * tax.amount)
elif tax.name == "VAT20":
sum_v20 = sum_v20 + (rec.price_subtotal * tax.amount)
self.tax_t1 = sum_v5
self.tax_t2 = sum_v20

in xml view file:

<record id="purchase_order_form_inherited" model="ir.ui.view">
<field name="name">purchase.order.form.inherited</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name="amount_tax" position="replace">
<field name="tax_t1" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="tax_t2" widget="monetary" options="{'currency_field': 'currency_id'}"/>

create an xml file to override the purchase order report (for eg: views/custom_purchase_order.xml) and put the following code:

<template id="report_purchaseorder_document_inherited" inherit_id="purchase.report_purchaseorder_document">
<xpath expr="//t/div/div[4]/div/table[@class='table table-condensed']/tr[2]" position="replace">
<td>VAT 5%</td>
<td class="text-right">
<span t-field="o.tax_t1"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>
<td>VAT 20%</td>
<td class="text-right">
<span t-field="o.tax_t2"
t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>


Don't forget to include this file in __openerp__.py. This will override the purchase order report with new tax fields.

You can also override quotations report similarly.

Hope this helps!

thank you this helps a lot

on 10/17/15, 7:37 AM
On 2/11/16, 6:49 AM

For Odoo 9 in SALE.ORDER ?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)


Asked: 6/8/15, 8:42 AM
Seen: 851 times
Last updated: 2/11/16, 7:31 AM