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

Hello

I would like to add buttons in kanban view , in order to can click on them directly from the kanban view.

How i can make that ?

Avatar
Discard
Best Answer

Hi zakaria,

you can define like this.

<record id="salon_management_kanban" model="ir.ui.view" >
<field name="name">salon_management_kanban.dashboard</field>
<field name="model">salon.chair</field>
<field name="type">kanban</field>
<field name="arch" type="xml">
<kanban class="oe_background_grey o_kanban_dashboard o_salon_kanban" create="0">
<templates>
<t t-name="kanban-box">
<div>
<button string="Procurement Request" name="%(stock.act_make_procurement)d" type="action" attrs="{'invisible': [('type', '!=', 'product')]}"/>
<div/>
</t>
</templates>
</kanban>
</field>
</record>
 

This is an example of an action button.

Thank you.

Avatar
Discard
Author

Thank you Avinash. Please where i should py my function (Button Action) ?

Author

I have used the following code :

<a type="button">

<button string="Procurement Request" name="message_test" type="action" attrs="{'invisible': [('pin_switch', '==', 0)]}">

<span>Procurement Request</span>

</button>

And the function :

@api.model

def message_test(self):

raise osv.except_osv(('Button test!'), ('Vous avez clicker sur le button'))

But when i click in the button nothing happened; what i should do ?

This is an action button.