Difference between ir.actions.act_window and ir.actions.server.

ir.actions.act_window

Used to open views (form, tree, kanban) in the UI.


ir.actions.server

Used to execute backend logic (Python code, automation).


✅ ​ir.actions.act_window Example

return {

    'type': 'ir.actions.act_window',

    'name': 'Sale Orders',

    'res_model': 'sale.order',

    'view_mode': 'tree,form',

}


✔️ Opens a view

✔️ Used in buttons & menus


✅ ​ir.actions.server Example

action = self.env['ir.actions.server'].create({

    'name': 'Confirm Orders',

    'model_id': self.env.ref('sale.model_sale_order').id,

    'state': 'code',

    'code': """

for record in records:

    record.action_confirm()

"""

})



✔️ Executes logic

✔️ Used in automation rules, scheduled actions



🛡  Key Difference


 Feature                                  act_window          server

Opens UI                                              ✅                            ❌

Runs backend logic                         ❌                            ✅

Used in automation                        ❌                            ✅