تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
6798 أدوات العرض

i'm newbie in odoo and i just have created a kanban view for a ticket system, i want to know how to execute a python function on the click of a kanban box

here is my xml code:

<?xml version="1.0" encoding="UTF-8" ?><odoo>    <record id="kanban_tickets_task" model="ir.ui.view">        <field name="model">service.queue</field>        <field name="arch" type="xml">            <kanban create="false">              <field name="name"/>              <field name="code"/>              <field name="last_ticket"/>              <templates>                <t t-name="kanban-box">                  <div class="oe_module_vignette oe_kanban_global_click">                    <div class="oe_module_desc" >                      <h4 class="o_kanban_record_title"><field name="name"/></h4>                      <p class="oe_module_name">                         <field name="code"/><br/>                          <field name="last_ticket"/>                      </p>                    </div>                  </div>                </t>              </templates>            </kanban>        </field>    </record>    <record model="ir.actions.act_window" id="tickets_kanban_window">      <field name="name">Tickets Dashboard</field>      <field name="res_model">service.queue</field>     <field name="view_mode">kanban</field>    </record>    <menuitem id="kanban_tickets_menu"  name="tickets dashboard" action="tickets_kanban_window"/></odoo>

الصورة الرمزية
إهمال

What you want to do when you click on kanban box?

أفضل إجابة

Hi,

On clicking the kanban view, most probably the form view will get opened.  So what you can easily do is that, write an onchange function for a field in the form view, so that the python function will get worked.


If you don't want above method write on onclick function in js for the kanban card and call the python function from it.

Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
مارس 25
1301
1
يناير 25
1650
4
أبريل 24
174112
0
ديسمبر 23
2072
5
يوليو 25
227710