Odoo Help


How to create list/tree view for categorizing sale order line items according to a custom field

on 3/7/15, 8:31 AM 1,198 views

i have created a cutom field x_lob in the sale.order.line model and i want to know if there is a way to create a list  / tree view of a wizard where i can view the line items categorized by x_lob field

i have created a wizard view to show the sale order items but i am unable to do it, it only displays the sale.order module.

otherwise is it  possible to create a list and populate the list from python.

i have lookin for a solution for a long time, i am stuck. Please Help.

Alby Antony
On 3/9/15, 3:09 AM

i didn't get your question properly but i think a search view could create you issue. you can categorise items in search view using groupby property

if you have database like

_columns = { 'fee_type': fields.many2one('fee_type','Type of fee paid:',size=20,required=True), 'amount_paid':fields.integer('Amount paid: ',size=20,required=True), 'date_of_pay':fields.date('date of pay',required=True) }

and your xml view can be

<record id="view_fee_payment_search_form" model="ir.ui.view">

<field name="name">fee.payment.search.form</field>

<field name="model">fee_payment</field>

<field name="arch" type="xml">

<search string="payment"

<field name="fee_type"/>

<field name="date_of_pay"/> 

<group expand="0" string="Group By">

<filter string="Fee type" name="fee_type" context="{'group_by':'fee_type'}"/>

 <filter string="payment Month" context="{'group_by':'date_of_pay:month'}" help="Payment Date"/> <filter string="payment year" context="{'group_by':'date_of_pay:year'}" help="Payment Date"/>





On 3/9/15, 4:10 AM

thankyou, but i am unable to create a wizard to show the sale order line items as a tree view.

    def launch_lob_overview(self,cr,uid,ids,context):
        return {
        'type': 'ir.actions.act_window',
        'name': "LOB Overview",
        'res_model': 'sale.order.line',
        'view_type': 'tree',
        'view_mode': 'tree',
        'target': 'new',
        'nodestroy': True,
        #'view_id': view_id,
        'context': context,

but this is showing all the line items of all the saleorders, how do i show the line items of only the active sale order, and then have them grouped


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

2 follower(s)


Asked: 3/7/15, 8:31 AM
Seen: 1198 times
Last updated: 3/16/15, 8:10 AM