Hibou Odoo Suite: Human Resources (HR) Modules: HR Expense Lead

Purpose

This documentation outlines the use case and processes associated with Hibou's HR Expense Lead module for Odoo 13.

The HR Expense Lead module allows you to assign Opportunities and Leads to expenses for reporting, allowing you to better calculate the cost of closing a sale.

Getting Started

First thing's first, we want to install the module! Navigate to the Apps application.


Once there, remove the 'Apps' filter, then search for 'HR Expense Lead'. When ready, click Install .

Odoo CMS - a big picture

Good to Know!

This module requires both the HR Expense and CRM applications. However, if you do not already have these applications installed, Odoo will install them for you during this module's installation!

Process

To get started, navigate to the Expenses application.

Odoo - Sample 1 for three columns

Adding an Opportunity/Lead to Expenses

Once there, select an existing Expense and click edit, or add a new one by clicking Create .

You will see a new Lead field below the Employee field. Select an existing Lead from the dropdown menu or create a new one by clicking Create and Edit... Fill in the rest of the fields on the expense, as you normally would.

Odoo CMS - a big picture

When you're ready, click SAVE .

Accessing Lead Expenses

Navigate to the CRM app.

Odoo - Sample 1 for three columns

Once there, remove the 'My Pipeline' filter from the search bar to display all leads. From the kanban board, select the lead you selected for your recent Expense.


You will now see a smart button with the total monetary value of expenses for this lead! Click the  Expenses smart button.

Odoo CMS - a big picture 

 This brings you to a graph view of expenses for this lead. Use the list view to see them as line items.

Odoo CMS - a big picture

Technical

This module adds a new Expenses smart button to the Lead form view that dynamically displays the monetary value of expenses for that lead. The smart button leads to a new view for the corresponding lead's expenses. Additionally, there is a new Lead field `lead_if` on expenses `hr.expense`.

The CRM Lead `crm.lead` model gets two new fields:

  • expense_total_amount` computed Float field, used in the Expenses smart button on the Lead form view

  • `expense_ids` One2many field for expenses with the lead's id

The Expense form view get's the new `lead_id` field and it is also added to the Expense filter view.