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

Hello, I am trying to create a custom form view to stock.picking module. The view have the following structure:

<record id="raizs_stock_picking_form_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.form.view</field>
    <field name="model">stock.picking</field>
    <field name="priority" eval="20"/>
    <field name="arch" type="xml">
        <form string="Movimentos">
            <sheet>
                <group>
                    <field name="name"></field>
                    <field name="partner_id"></field>
                    <field name="state"></field>
                    <field name="scheduled_date"></field>
                </group>
                <notebook>
                    <page string="Produtos" >
                        <field name="id" invisible="1"/>
                        <field name="move_lines">
                            <tree>
                                ...tree content...
                            </tree>
                        </field>
                    </page>
                </notebook>
            </sheet>
        </form>
    </field>
</record>


I can load the view correctly on desktop, but when I try to do so on the odoo app, odoo uses a kanban view instead of the tree view I defined for the "move_lines" field. 

Is there a way I can prevent odoo from loading the kanban view and make it load the tree view I defined instead? 

Thank you!

Avatar
Discard
Best Answer

U use mode="tree"

<record id="raizs_stock_picking_form_view" model="ir.ui.view">
    <field name="name">raizs.stock.picking.form.view</field>
    <field name="model">stock.picking</field>
    <field name="inherit_id" ref="stock_picking.form_view(To be stock_picking_form_id)"/>
    <field name="priority" eval="20"/>
    <field name="arch" type="xml">
                        <field name="move_lines" position="attributes">
                            <attribute name="mode">tree</attribute>
                        </field>
    </field>
</record>


<field name="move_lines" mode="tree">
<tree>
<field
name="display_name"/>
</tree>
</field>
Avatar
Discard
Author

It did the job! Thank you

thank you so much,it's still useful

Related Posts Replies Views Activity
0
Jan 24
3725
1
Mar 15
3539
0
Mar 15
2624
0
Mar 24
1801
5
May 20
16109