Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4597 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis

It did the job! Thank you

thank you so much,it's still useful

Post Terkait Replies Tampilan Aktivitas
0
Jan 24
4405
1
Mar 15
4157
0
Mar 15
3349
0
Mar 24
2746
5
Mei 20
17282