Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
5486 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 16
5945
1
jul 20
5262
4
jul 16
5110
2
jul 23
5705
0
feb 25
2594