We create 3 modules to implement the feature "All in one approval":
1. Odoo Approval
2. Odoo Approval: HR Extension
3. Odoo Approval: All in One
It's a base module, support configuring approval flow for new model only: Stationary, payment, business trip,..
Dependencies: Discuss, Product & Pricelist
You can set the approver as a coach, or a manager, or a manager of department of an employee
Dependencies: Odoo Approval, Employees
All in One
You can setup the approval flow for all models, even when they are defined in another modules: Sales, Purchase, MRP,..
Dependencies: Odoo Approval
Groups and Record Rules
We create 2 groups to let the user access the approval application, and create 4 record rules in order to protect the privacy.
2 access groups
They are in the application "Approval"
Settings: can create / edit the approval type
User: can create / approve the approval request
Grant one of them to the user
4 record rules
They protect user's privacy:
An employee can only see their requests.
A manager can review and approve employee's request (of his department only).
Admin can see all.
Approval types is displayed from the menu Approval | Dashboard by the Kanban view. Click on the button Create to add a new type, its form looks like below:
Name: it could be a title, or a short summary of your approval type.
Description: you can write a long description to help your employee know which kind of request should be added to this type.
Fields: there are many fields to choose for your approval type. Some are required, some are optional, and some are no need.
Approvers: you can choose a person who can review and approve the request. if his decision is important, set "Type of Approval" is Required. Otherwise, set it as "Optional".
Could be created by 2 ways: from the approval dashboard, or from the menu Approval | Approvals | My Requests
On approval dashboard
you click on the button "Create New Request" of the block of the approval type you want create request.
From menu My Requests
This menu will shown all requests created by you. You could click on the button "Create" to add a new record as usual.
The form view of the request will look like this
Meaning of fields:
Title: a short summary about your request
Request by: track a person who create the request
Request Date: track a date you create the request
Type: it's approval type. After choosing it, these fields may be shown (or not, depending on your setting in approval type): Contact, Period, Date, Item, Quantity, Payment, Amount, Location, Reference.
Description: write detail of your request here. It could help your manager make a decision more quickly !
When your request looks good, click on the button "Submit" to send it to your manager (or a person who's in charge ). its state changes from Draft to Submitted. And a new tab "Approver (s)" is shown.
Review a request
Login as Financial Manager, you will see 2 new buttons appear: Approve and Refuse.
If you refuse, a new popup will show out to ask for the refused reason.
All activities related to this request will be tracked in a log chatter. It helps you manage the history.
Approval HR Extension
This extension module allows you to set approver as a special person: a coach, line manager or department manager
New option in approval type
Coach, Line Manager, and Department are set on employee form view.
If they are missed, approver will be re-assigned to a person who is set in column "User"
Approval All in One
This module allows you to set a approval flow for model which defined in another modules. There a new option in Approval Type "Apply for model?". Tick it, a new option "Model Setting" will be displayed
From above picture, a purchase order which has a total amount > 5,000$, must be approved by purchase manager. I set up like below:
Model: I choose Purchase Order, it links to ir.model.
Domain: It means that, when an order changes its state to to_approve: if its total amount > 5000, it must be approved by Purchase Manager.
Hide Buttons from Model View?: tick this option to hide all buttons on Purchase form view when an order is waiting for approval, only 2 button Approve and Refuse are displayed .
Approved Action: it's technical field - python code, when an order is approved, the function record.button_approve() will be executed automatically.
Refused Action: It's technical field too, but is call when an order is refused.
I log in as a purchaser, and create a new purchase order to buy 5 large desk, the total amount is 8,977.40 $.
I will confirm it by clicking on button "Confirm Order"
You can see its state changed to "To Approve" and a new button "Request Approval" as well as a new message, are shown.
Now, i will click on "Request Approval", and a new popup displayed:
All data are filled automatically, you could update them. Then, click on button "Submit Request". A new request is created and shown as below:
I cannot see 2 button: Approve, and, Refuse. Because i'm login as a purchaser. Let's come back to Purchase form view:
I can only see a button "View Approval" ( because the option "Hide buttons from Model View?" of Approval type is on ), this button will open a request form view.
Now, let me log out and log in again as Purchase Manager. Check menu Approvals | Approvals | To Review
You can see that, i have 1 request to review. Open it:
Now, purchase manager can see 2 button: Approve, and, Refuse. Let me approve this request. Come back to purchase form view, you can see like this:
Its state change from "To Approve" to "Purchase order", and many buttons are displayed.
1. Odoo Approval: a base module, support configuring approval flow for new model only
2. Odoo Approval HR Extension: allow you to set the approver as a coach, or a manager, or a manager of department of an employee
3. Odoo Approval All in One: support configuring for all models