Hibou Odoo Suite: Human Resources (HR) Modules: HR Expense Lead
Repository Versions:
Modules:
AGPL-3
Purpose
This documentation outlines the use case and processes associated with Hibou's HR Expense Lead module for Odoo 12.
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 .
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.
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.
Accessing Lead Expenses
Navigate to the CRM app.
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.
This brings you to a graph view of expenses for this lead. Use the list view to see them as line items.
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.