Skip to Content
Menu
This question has been flagged
1 Reply
7463 Views

Hello,

I would like to add a button which allow me to run a method from kanban view. This button should have type="object".

What i should do ? Because i have tried to define this button, but i click on it, nothing happened.

Thank you

Avatar
Discard
Best Answer

Hi,

This is a example , in which i have added a href in the kanban view and on clicking on it python function will get called.

In the Xml,

<a href="#" name="booking_active" type="object" string="Active booking">
<div t-if="record.active_booking.raw_value == false">
<div class="o_primary no_of_people">
<field name="number_of_orders"/>
</div>
</div>
</a>

And in the python,

@api.multi
def booking_active(self):
#add the rest of the code here

Thanks

Avatar
Discard
Author

Thank you so much Niyas !

Author

You can't make this href, like button ?