Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
5593 Visninger

Hi ,

Is it possible to Enable drag and Drop event in kanban view for my custom class ? In my custom class i've defined kanban box and i want the move this Boxes along with Mouse Pointer(same as Opportunity Module Kanban). Here is my code :

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

            <field name="name">sale.order.kanban</field>

            <field name="model">sale.order</field>

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

                <kanban default_order="probability desc" default_group_by="dashboard_stage_id" class="o_kanban_small_column">

                    <field name="dashboard_stage_id"/>

                    <field name="user_id"/>

                    <templates>

                        <t t-name="kanban-box">

                                <div class="oe_dropdown_toggle oe_dropdown_kanban">

                                    <span class="oe_e">í</span>

                                    <ul class="oe_dropdown_menu">

                                        <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>

                                        <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>

                                        <li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>

                                    </ul>

                                </div>

                            <div t-attf-class="oe_kanban_card oe_kanban_global_click">

                                <div class="oe_kanban_content">

                                    <div>

                                        <b><field name="partner_id"/> - <field name="name"/></b>

                                    </div>

                                    <div class="oe_kanban_footer_left">

                                                    <field name="probability"/>%

                                                    <field name="priority" widget="priority"/>

                                    </div>

                                </div>

                                <div class="oe_clear"></div>

                            </div>

                        </t>

                    </templates>

                </kanban>

            </field>

     </record>

Thanks :)

Avatar
Kassér
Bedste svar

This can be done using default_group_by="dashboard_stage_id" and this should be a selection or a many2one. Also, you should ensure the user has the proper access right to edit the kanban view. If the kanban edit is false will disable drag and drop. so must ensure the group by is added for dashboard_stage_id.

Here are some references will helps kanban drag and drop.

http://ludwiktrammer.github.io/odoo/odoo-grouping-kanban-view-empty.html

https://www.odoo.com/documentation/8.0/reference/views.html#kanban

http://ludwiktrammer.github.io/odoo/odoo-grouping-kanban-view-empty.html


Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
2
jun. 16
6038
1
jul. 20
5371
4
jul. 16
5202
2
jul. 23
5834
0
feb. 25
2669