Commit Graph
17 Commits
Author SHA1 Message Date
qmo-odooandAurélien Warnon d3fdbe2973 [IMP] calendar,crm: improve mail.activities meetings management
Before this commit, editing a mail.activity with the "meeting" category would
open a modal form for the mail.activity, which did not make much sense.

When editing a mail.activity that is linked to a calendar.event, you will now
jump on the calendar view to edit the related event, which is much more
convenient.

In addition, when scheduling such an activity, the "Edit" button in the chatter
is renamed to "Reschedule", to show the user that he will land on the calendar
view.

Furthermore, trying to delete an activity that is linked to a meeting will now
prompt a confirmation dialog warning the user that the meeting will be deleted
as well.

Finally, we moved the 'phonecall' activity category from the 'voip' module
(enterprise) to the base 'mail' module.
Scheduling a phonecall activity will let the user choose if he wants to:
- Simply save the activity, which will schedule a regular mail.activity
- Open the calendar to create a related calendar.event
  Used typically when you want your colleagues to see that you are busy in your
  calendar during this call.

Task-2486126
ENT PR odoo/enterprise#20431
UPG PR odoo/upgrade#2775

closes odoo/odoo#75530

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2021-09-02 15:36:28 +00:00
Thibault Delavallée 9790d7dcfb [REF][MOV] sales_team, crm: move team membership model to sales_team
GLOBAL PURPOSE

Ability to have salesmen belonging to several sales team is a core requirement
of CRM. It is therefore moved from website_crm_score to crm along with cleaning
and behavior improvement. Automatic lead assignment is also moved and cleaned.

SPECIFICIATIONS

Move sales team membership model from website_crm_score (enterprise) directly
into sales_team. It allows to have the base requirements to correctly handle
mono and multi sales team for salesperson.

Membership is modeled using a decorated many2many relationship. Members of
a sales team are res.users. Subscriptions are crm.team.member linking a team
and an user. It is a rename of team.user model coming from website_crm_score
as well as some other relational fields renaming.

Part of old team.user model is moved directly to sales team, part of it to
crm module (notably assignment limits). Its support will be improved in the
upcoming commits. Assignment related fields will be cleaned and used when
moving assignment directly into CRM.

LINKS

Task ID-2086889 (main task)
Task ID-2357969 (scoring migration task)
Community PR odoo/odoo#48422
Enterprise PR odoo/enterprise#499
Upgrade PR odoo/upgrade#996996
2021-01-21 10:56:19 +00:00
David Beguin b9b65d7962 [FIX] crm: fix pls field config parameter and force depends recompute
The method _compute_probability has a dynamic depends, that depends on the
crm.pls_fields config parameter. When installing the DB, the depends is
evaluated. If the config parameter is modified afterwards, the depends is not
re-evaluated as the registry is not rebuilt.

The result is that when modifying the config parameter, if an optional
pls_field's value is modified on a record, the compute won't be triggered, as
that pls_field is not in the compute's depends.

This commit force to re-setup the registry after a modification (or the
creation) of the crm.pls_fields config parameter, in order to force the
depends of the _compute_probability method to be updated.

Task ID: 2341829

closes odoo/odoo#58165

X-original-commit: e95afbedc18d198454c7f66b523c4cafb19a4066
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: David Beguin <dbeguin@users.noreply.github.com>
2020-09-21 17:58:03 +00:00
Patrick Hoste a54f3852d6 [IMP] crm: add recurring revenues feature
PURPOSE

Allow users to configure contract recurrences and Monthly Recurring Revenues
on Opportunities they're trying to close. One short revenues are not sufficient
to cover real life use cases of CRM revenu analysis.

SPECIFICATIONS

Adds an option in the settings to activate the recurring revenue feature.
This feature is set on an opportunity to indicate a revenue that could be
perceived over time. This time indicator is set by the crm.recurring.plan
model in which the number of months is determined.

By default some plans are added in data. When using plans, revenues are
computed across the plan months.

LINKS

Task ID-2283052
odoo/odoo#54194
odoo/enterprise#12423
odoo/upgrade#1463

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-14 12:59:30 +00:00
Rémy Baranx (bar) fd4798195d [IMP] crm, sales: add crm tags on sale orders
As the crm.lead.tags model shall be used in CRM and/or Sales apps,
it has been moved to the sales_team module, which is a depedency
of the CRM and Sales apps.

As these tags becomes more generic than just "lead tags", the model
has been renamed from crm.lead.tags to crm.tags.

Tags on sale orders were already present but not visible. They are
now visible in the "Other Info" section, and optionally in sale order
tree views.

When a quotation is created from an opportunity (CRM app), existing tags
are populated from the opportunity to the sale order (Sales app).

Views and demo data of several modules have been updated accordingly.

Task ID 2191276
2020-03-23 09:08:47 +00:00
Thibault Delavallée 9219944a5a [REF] crm: quickly reorganize crm_lead file
In this commit we perform some small code move in order to better understand
the huge crm_lead.py file. Notably

  * add some code sections headers (actions, PLS, opp/leads merge);
  * move crm.lead.tag and crm.lost.reason in their own file;
  * reorganize fields by main category because it is a mess;
  * remove some unnecessary help messages on fields;
  * merge two _auto_init methods definitions;

No functional change occur with this commit as it contains only some code
move.

It prepares some further technical cleaning in CRM application, notably
onchange -> compute move.

LINKS

Related to Task ID 2092799 (not really spec, spotted while working on it)
PR odoo/odoo#42015

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-17 12:50:46 +00:00
qmo-odoo f49d83f07d [IMP] utm, crm: add lead/opportunity stats on campaign
PURPOSE

This commit removes the mass_mailing.campaign model. Instead of having a fully
fledged model, we will simply inherit utm.campaign. We will also add relevant
statistics on utm campaign model in order to use it in various applications.

SPECIFICATIONS

This commit adds leads/generated statistics in the kanban and
the form view of the utm campaign.

Kanban and form views will now display the number of leads and
opportunities generated with the campaign

TaskID: 2002029
PR: #34452
2019-08-02 12:33:42 +00:00
David Beguin e20cc70d08 [IMP] crm : add and apply Predictive Lead Scoring
This new Predictive Lead Scoring (aka PLS) replaces the stage based probability mechanism.
It uses Naive Bayes probability computation theorem.

The lead probability is now computated automatically based on multiple criteria (= frequency fields).
Some are mandatory and will always be used, some are optional and can be activated
in the settings.
- Mandatory fields :
    - team_id
    - stage_id
    - tag_ids

- Optional fields :
    - email_state (validity of the email_from field: correct / incorrect or empty if email_from is empty)
    - phone_state (validity of the phone field !! not the mobile one !!: correct / incorrect or empty if phone is empty)
    - country_id
    - state_id
    - source_id (UTM Source)

PLS uses a start date to consider only the lead created after that date to generate the frequency table
and to recompute the lead probability. This date is also configurable in the CRM settings.
Default start date is date.todays() (at module install).

The settings for PLS are NOT company related :
PLS Fields = Many2many to a model that store only the fields allowed for PLS computation.
PLS Start Date = Date
As Date and Many2many fields are not allowed for config_parameters,
Char fields are used to store the configuration
and Date and m2m fields are used to ease the configuration by the user in the config panel.
Date and m2m fields are both computed fields based on their corresponding Char fields.
Char field for Date store a strigified date.
char field for Many2many store a comma separated string which is a list of activated fields.

Each mandatory field is used in a specific way
- Team_id : the frequency table is split for every team_id, plus once for leads that don't have a team_id.
Considering Lead A from Team 1 and Lead B from Team 2.
Even if Lead A and Lead B have the exact same attributes (country, phone, email,stage, ...),
their probability will most likely not be the same.
That's because each teams compute their leads' probability based on their own won/lost leads.

- Stage_id : if no optional fields are activated and if there is no tag on the lead,
this will make PLS work quite the same way as it was working with removed stage based probability,
as only the stage will count in the computation.
But here, instead of fixing manually the probability for each stage,
this stage related probability is automatically computed based on past experience (won and lost leads).

- Tag_ids : each tag is considered separatelly, as if the lead had only one tag.
(no link between tag on same lead is made). To avoid that a tag take to much importance if his subset is too
small, we include the tag frequencies in the frequency table only if at least 50 won or lost leads had this tag.

The frequency table is a table where all won and lost leads are aggregated by fields
(mandatory or optional if activated). For each team_id / field couple, we store the number of
won and lost leads that has that fields values.
For example: Lead A is assigned to team 1 and client comes from France and has been won.
If we consider only this lead A, the frequency table will looks like :
   id   |  variable   | value | won_count | lost_count | team_id
--------+-------------+-------+-----------+------------+---------
    1     country_id     FR         1           0            1

To computed the probability of a lead, we get all the records for the frequency table
that match all fields (per team_id) and we compute a won score and a lost score.
The probability is computed and normalized based on those scores
- P = S(Won) / (S(Won) + S(Lost))

Considering two variables A and B :
- S(Won) ∝ P(A∩B | Won)*P(Won) = P(A|Won) * P(B|Won) * P(Won)
- S(Lost) ∝ P(A∩B | Lost)*P(Lost) = P(A|Lost) * P(B|Lost) * P(Lost)

To overcome the 'zero frequency problem',
we do not start at 0 for the won or lost count for each variable / value combination.
It suggested to start at 1, but to avoid that a small subset take to much weight compared to
a larger one, we start at 0.1.

For example :
If we start at 1 : If team 1 has few records from France,
it can get high probability to win even if every lead where lost.

  variable   | value | won_count | lost_count | team_id | Probability
-------------+-------+-----------+------------+---------+-------------
 country_id     FR         1           7            1         0.125
 country_id     FR        198         7306          2         0.0263

If we start at 0.1 :

  variable   | value | won_count | lost_count | team_id | Probability
-------------+-------+-----------+------------+---------+-------------
 country_id     FR         0.1         6.1          1         0.0161
 country_id     FR        197.1       7305.1        2         0.0263

The more we have records for each couple, the more the computation become precise.

The allow the user to decide himself which probability should be set on the lead,
a manual probabiltiy system has been implemented using 2 stored fields + 1 computed field :
- probability (stored): Probability set on the lead, can be set manually in the lead form.
- automated_probability (stored): Probability computed by PLS.
- is_automated_probability (computed): If both previous fields are equal, the probability is considered
as automatic. and each time the automated_probability is updated, the probability is aligned.
If both are not equal, the probability is considered as manual. The automated_probability is still
updated but the probability is not aligned. The user can reset the probability in automatic mode
by clicking on the estimated probability displayed in edit mode in the lead form.

probability and automated_probability are not computed fields as they are manually computed at write and create.
The computation is triggered if one of the activated frequency fields is modified or set.
To trigger also the computation when modifying the lead values on the lead views (form and kanban),
_onchange methods have been added for each frequency field.

Also, a cron has been added to run every day to rebuild the frequency table and to recompute all active
and pending leads (not won nor lost) probability.

Task ID : 1925439
PR #33589

remove rerun cron on action lost and won
2019-06-11 07:04:33 +00:00
Mitali Patel 707bd1bfb4 [IMP] crm: implement digest KPIs / tips
Purpose of this commit is send lead / opportunity creation as well as
won opportunities KPIs in digest emails. Those are added in the default
digest template.

A tip to remind to use the mailgateway is also integrated.

This commit is linked to task ID 30655 and PR #18318.
2018-07-19 11:26:46 +02:00
Yannick Tivisse 7ed9a7fabe [REM] web_planner: Remove the module
Purpose
=======

User tests have been made by the Product Owners team. It showed that the planners are not used by new users on Odoo due to several reasons (They are too static, too heavy to use,...)

Specification
=============

Remove the module and its different applications. The onboarding on the business flow will be improvement in the weeks to come.
2017-10-26 16:14:21 +02:00
Yannick Tivisse 781a03b2bc [IMP] res_config: Update file names, xmlids, class names according to guidelines
Now that we only have one model (res.config.settings). Uniformize everything according to the guidelines.
2017-09-01 13:03:18 +02:00
Haresh Shyara ea66192276 [REF] crm,sale: Split the applications into 2 separate apps
Purpose
=======

You install CRM but you don't see CRM icon (except in English, as long as sales is not installed) -> confusing
The dashboard with salesteam is not obvious & not useful for simple users: what are those channel boxes about? why don't I see all my activities?, etc.

Specifications
==============

Split CRM & Sales + land in business views straight away

Default Entry Views
~~~~~~~~~~~~~~~~~~~

- New default view for CRM: Pipeline kanban
- New default view for Sales: Quotation list

Dashboards
~~~~~~~~~~

- Move sales teams dashboard to Reporting: Sales Channels.
- Remove the upper part of the sales team dashboard

Menuitems Structure
~~~~~~~~~~~~~~~~~~~

- CRM menu

Pipeline:
	- Leads (optional)
	- Pipeline (default menu, default filter "My Pipeline")
	- Next Activities -> to remove (now there is an icon in top bar for next activities)
	- Quotations (If sale_management installed)
Customers
Phone Calls (if voip, if not yet removed because there is a BE task to use next activities instead)
Leads Management:
	- Scoring Rules
	- Leads Assignation
	- Team Assignation
Reporting:
	- Leads
	- Scoring page views
	- Opp. Assignement
	- Patnerships
	- Pipeline
	- Activities
	- Phonecalls
	- Sales Channels
Configuration:
	- Settings
	- Sales Channels
	- Activity Types
	- Leads & Opportunities:
		- Lead Tags
		- Lost Reasons
	- Resellers
		- Partner Level
		- Partner Activations
- Sales menu:

Orders:
	- Quotations
	- Orders
	- Customers
Invoicing:
	- Orders to Invoice
	- Orders to Upsell
Catalog:
	- Products
	- Promotion Programs
	- Coupon Programs
Reporting:
	- Sales
	- Sales Channels
	- All channels sales orders
Configuration:
	- Settings
	- Sales Channels
	- Sales Orders:
		- Quotation templates
		- Payment acquirers
		- Delivery Methods

Settings
~~~~~~~~

- Split settings form
- Remove recommended apps section
- Remove Timesheets section
- Remove Inventory Management and move shipping connectors to Shipping section
- Remove Integrations section
	- Move Docsaway option to "Quotations & Orders", right after proforma
	- Autocomplete and asterix: move to CRM section
- Restructure and rename sections this way:
	- Product Catalog
	- Pricing
	- Quotations & Orders
	- Shipping
	- Invoicing
	- eBay (if installed)
- Remove all the "Save this page and come back here" when checking a box that installs a new module

- restructure a bit the CRM settings, with 3 sections:

Pipeline
	- Leads
Contacts
	- Phone Validation
	- Customer Autocomplete
Integrations
	- Google Calendar / Synchronize your calendar with Google Calendar (copy from general settings but don't show message "Save this page and come back here...".
	- Asterisk (VOIP)
2017-08-09 10:03:08 +02:00
Yannick Tivisse a38a3e93c2 [MOV] *: Reorganize configuration files according to guidelines 2017-06-19 17:37:38 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Ravi Gadhia 87e457158e [IMP] crm, website_crm: replace support of activities
crm.lead model now supports activities. Filters have been added to ease
their management. Mail activities replace the old crm.activity model. All code
related to crm.activity is then removed, including views and custom widget.
Standard activities feature is now used widely in Odoo addons and replace
those custom activities.

A small update is required in website_crm_partner_assign. Now the portal user
can only update or create its own activities aka assigned to him. If he has
an activity assigned to him it is displayed in the opportunity website view.
If not editing the opportunity will create a new activity assigned to him.
2016-12-21 10:58:49 +01:00
Jérome Maes fa7fdc525a [MOV] crm : reoganize module directory and files 2016-07-04 17:28:03 +02:00
Jay Patel ff2b14d4c3 [IMP][ADD] crm: add the concept of activities, allowing
to define custom light workflows on opportunities.

Activities are linked to mail.message.subtype through inheritance.
This means that the follow mechanism works for activities. When
an activity is done, a message with the matching subtype is posted
on the opportunity.

Activities are internal by default. They are only visible by
employees.

A shortcut in the 'log a note' chatter option allows to post a
note linked to an activity (subtype).
2015-07-08 17:15:22 +02:00