Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
7665 Visninger

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.

Avatar
Kassér
Bedste svar

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"/>

</group>

</search>

</field>

</record>

Avatar
Kassér
Forfatter Bedste svar

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

 

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
jul. 16
5834
3
jul. 15
9941
2
mar. 15
5010
0
feb. 18
3441
4
okt. 16
30937