Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5552 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
giu 16
6023
1
lug 20
5347
4
lug 16
5177
2
lug 23
5803
0
feb 25
2649