Skip to Content
Menu
This question has been flagged
1 Reply
4573 Views

Im trying to display the Purchase and Purchase Order Line in Tree structure. When I click on PO Tree structure i need the below Format

PO1
 PO1Line1
 Po1line2
PO2
 PO2Line1

Tried the Below Code but failed to display the POLine details :

 <record id="view_purchase_list" model="ir.ui.view">
        <field name="name">purchase.order.tree</field>
        <field name="model">purchase.order</field>
         <field name="type">tree</field>
         <field name="field_parent">order_line</field>
        <field name="arch" type="xml">
            <tree fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="purchase_form_action">
                <field name="message_unread" invisible="1"/>
                <field icon="icon" name="name" string="Reference"/>
                <field name="date_order" />
                <field name="partner_id"/>
                <field name="origin"/>
                <field name="amount_total" sum="Total amount"/>
                <field name="state"/>
                <field name="product_id" invisible="1"/>
            </tree>
        </field>
 </record>

 <record id="action_purchase_list" model="ir.actions.act_window">
    <field name="name">PO Tree Structure</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">purchase.order</field>
    <field name="view_type">tree</field>
    <field name="view_id" ref="view_purchase_list"/>
    <field name="domain">[('state','in',('draft','sent','confirmed'))]</field>
    <field name="search_view_id" ref="view_purchase_order_filter"/>
 </record>

 <menuitem action="action_purchase_list" id="menu_purchase_list"
        parent="menu_procurement_management"
        sequence="0"/>

Any advice will be helpful

Avatar
Discard
Best Answer

may be, you could try

    <field name="order_id" invisible="1"/>

instead of

<field name="product_id" invisible="1"/>
Avatar
Discard