Search Here

Odoo Server Action

Server action is a great feature of Odoo. You can use server action to sending emails on confirmation of any event like (sale, purchase etc). But in this tutorial I am going to show you how to filter
records on list view or tree view that relates to active/login user on the click of menu. For example for admin user I want to show all records, but for employee I want to show selective records that are related to that employee.


Odoo Server Action

Server Action in Odoo (ir.actions.server)

To use server action on the click of menu follow below steps.

1- Create server action and call that action from your menu.


2- After that create a method or function under your model, and from that model after using your logic return action window.


Don,t forgot to share, keep sharing keep learning

Post a Comment

2 Comments

  1. ValueError: : "name 'self' is not defined" while evaluating
    "action=self.get_filtered_record(cr, uid, context.get('active_ids', []), context=context)"

    on odoo12 complains that it cannot find 'self'
    ideas what may be wrong?

    ReplyDelete
  2. should be model instead of self, I guess, see: https://www.odoo.com/documentation/12.0/reference/actions.html

    ReplyDelete