Odoo Help


Addition of 'Internal Category' to the Sale Order/Quotation

Derek Strong
on 2/4/16, 9:04 AM 469 views

Good Morning, All.

I have been playing with the creation of a custom module, in an effort to display changes to the sale order report, that fit how my customers wish to see a quotation.

Basically, I've inherited the sale module and attempted to add the 'Internal Category' from the product module in a column.

This is what I have so far:


# -*- coding: utf-8 -*-
import controllers
import models
# from .import modify_type_quotation


# -*- coding: utf-8 -*-

'name': "Module name",

'summary': """

Sale Order/Quotation with Internal Categories listed""",

'description': """
        Long description of module's purpose

'category': 'Sales Management',
    'version': '0.4',

'depends': ['base', 'sale', 'product'],

 'data': [




# -*- coding: utf-8 -*-

from openerp import models, fields, api

class add_intcat(models.Model):
 #Inherits the model product.template
 _inherit = 'product.template'

 _name = 'add_intcat.add_intcat'


        <!-- Inherit quotation report (from module sale) -->
  <template id="report_quotation_inherit_demo" inherit_id="sale.report_saleorder_document">
  <xpath expr="//div[@class='col-xs-6']//div//strong[1]" position="replace">
            <strong t-if="o.partner_shipping_id == o.partner_invoice_id">Requesting Business Unit/Customer:</strong>
    <xpath expr="//table[@class='table table-condensed']//thead//tr" position="replace">
    <tr style ="background-color:lightgray;">
     <th>Internal Category</th>
     <th class="text-right">Quantity</th>
     <th class="text-right">Unit Price</th>
     <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
     <th class="text-right">Price</th>
  <xpath expr="//tbody[@class='sale_tbody']//tr" position="replace">
   <tr t-foreach="o.order_line" t-as="l">
                    <span t-field="l.name"/>
     <!-- Place holder for 'Internal Category' -->
     <span t-field="product_template.categ_id"/>
                    <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
                <td class="text-right">
                    <span t-field="l.product_uom_qty"/>
                    <span groups="product.group_uom" t-field="l.product_uom"/>
                <td class="text-right">
                    <span t-field="l.price_unit"/>
                <td groups="sale.group_discount_per_so_line">
                    <span t-field="l.discount"/>
                <td class="text-right">
                    <span t-field="l.price_subtotal"
                        t-field-options='{"widget": "monetary", "display_currency": "o.pricelist_id.currency_id"}'/>

So, I know that I'm missing parts to make this print a complete quotation, sale order, what am I missing here?

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/4/16, 9:04 AM
Seen: 469 times
Last updated: 2/4/16, 9:06 AM