Commit Graph
129 Commits
Author SHA1 Message Date
std-odoo be996fdc00 [IMP] crm_*: add more fields when we merge multiple leads
Purpose
=======
Add more fields when we merge multiple leads to be sure not lose
valuable information.

Specifications
==============
Those fields are propagated to the destination if the value on the
destination is Falsy
- referred
- color
- recurring_revenue
- recurring_plan
- function
- lang_id
- date_deadline
- reveal_id
- lead_mining_request_id
- reveal_ip
- reveal_iap_credits
- reveal_rule_id
- event_lead_rule_id
- event_id

The "lost_reason" field is propagated to the destination only if it's
lost (otherwise, it makes no sense to have a lost reason on a non-lost
lead).

The field "iap_enrich_done" is set to True if at least one lead has been
enriched.

We also keep the sum of all the lead tags (and remove any potential
duplicates).

The address is taken from the lead with the most non-empty address
fields (sorted by highest rank if multiple lead have the same amount
of non-empty fields).

Task-2447721
PR odoo/odoo#75742
2021-10-19 15:58:58 +00:00
Bruno Boi cc3403ad47 [FIX] web: action context pollution from session storage
Before this commit
An action retrieved from the session storage may not take into account
changes in the user context because the user context is duplicated in
the action context. When the user context changes i.e. through the
switch company menu (allowed_company_ids) and the browser reloads,
the action service will make the action context concatening the new user
context with the context of the action stored in the session storage,
which has still values from the previous user context.

After this commit
The makeContext function can now take an initial evaluation context.
This is then used in the action service in order to make use of the user
context when the action context is generated but without appending
it into the action one.

closes odoo/odoo#78415

X-original-commit: 7354d1686915ec21437fc677f15a6c5409106492
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-14 18:15:13 +00:00
Mathieu Duckerts-Antoine dabfb29301 [FIX] crm: forecast filters
The fix ff28db335fa77dadc did introduce some differences in the way
forecast filters work for a legacy or a new view. For example, let us
assume we have two filters F1 and F2 active in the same group with F2 a
forecast filter. In that situation, a legacy view would load with
domain = F1 domain AND F2 domain, and a new view would load with
domain = F1 domain OR F2 domain.

In the present commit, we harmonize the behaviors of ForecastModelExtension
and ForecastSearchModel as much as possible. We also make ForecastModelExtension
use a state received when it loads for the first time.

We have also taken the opportunity to normalize the states of the
extensions: it was not necessary to memorize forecastField (constant)
and forecastFilter (determined by the rest of the state).

closes odoo/odoo#77159

X-original-commit: 37aeb048c286f2f1a78370213635341c32ea621b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-24 14:00:38 +00:00
nounoubensebiaandAurélien Warnon e2d11fa279 [IMP] [website_]crm: post crm.leads merge message using a full template
Use a template for merge post messages and clean how fields are displayed,
notably by fixing the display format, and the field order.

Indeed, previously posted lead merge message contained all fields in an
alphabetical order, even ones that had empty values, which is not very user
friendly in terms of display.

Now, the displayed fields are determined and ordered by sections, which greatly
improves understanding the various information.
Please note however, that it has the downside of not including all fields
anymore.

The merged leads information are included in a "read more/read less" enabled
block using the "data-o-mail-quote" feature to get a nice rendering and avoid
cluttering the Odoo chatter UI.

Within the sent mail however, the full text is directly visible when viewing
through a mail client.

Task-2451164

closes odoo/odoo#75946

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
2021-09-22 12:22:32 +00:00
Mathieu Duckerts-Antoine 75f8814afd [FIX] crm, web: forecast views
After the conversion of the graph and pivot views done in https://github.com/odoo/odoo/pull/73311,
it was no more possible to open the forecast_graph and forecast_pivot views.
This is due to the fact that the new View component cannot manage a legacy
view: every extension of a converted view must be converted. We thus
convert forecast_graph and forecast_pivot.

closes odoo/odoo#76793

X-original-commit: ff28db335fa77dadc3198e754f1e0649811fba7b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-20 10:54:23 +00:00
Zelong Lin 51ff8b09db [REF] *: convert JS files to ES6 modules
* = hr, hr_holidays, sms, snailmail, website_livechat, account_invoice_extract,
approvals, documents, mail_enterprise, calendar, crm, mrp, note, website_slides,
crm_enterprise, sign, social, voip

task-2510656

closes odoo/odoo#72712

Related: odoo/enterprise#19241
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 14:31:55 +00:00
Xavier Morel 0e552b96da [FIX] *: convert tip contents to t-out
Requires markup every markup-using tip content as Markup. Would be a
nice occasion to migrate everything to a markup-safe markdown I think,
especially if we could migrate the translations so we don't lose them.
2021-07-20 05:40:55 +00:00
abd-msyukyu-odoo 2a48b989c1 [IMP] crm: implement the forecast feature for opportunities
Add a new submenu "Forecast" in "Reporting" for CRM

The Forecast shows 4 views:
  1. Kanban
  2. Graph
  3. Pivot
  4. List

Objective
  Shows the short term forecast for opportunities (crm_lead) based on their
  expected closing (date_deadline) and have an overview of the prorated
  revenues for each period (defaults to month).

Implementation
1. Kanban
- the progressbar is using the prorated_revenue
- the forecast_field is date_deadline
- the default groupby is date_deadline

2.3. Graph, Pivot
- the measure defaults to the prorated_revenue
- the row defaults to date_deadline

4. List
- shows the prorated_revenue

The special filter "Forecast" is defined to be used by the
forecastModelExtension (JS). (define the forecast_filter context key)

The forecast_field context key is defined in the action to be used by the
forecastModelExtension and the forecastService (JS).

The demo data for opportunities is updated to spread date_deadline over 4 months

Enable drag&drop and quickCreate features for the kanban view with the use of
the allow_group_range_value  <field> xml attribute

Add a "Won" flag for the forecast view to better distinguish opportunities that
need to be worked on

Test tour

Task-ID: 2243913
PR odoo/odoo#69380
ENT PR odoo/enterprise#18547
2021-06-30 09:51:42 +00:00
abd-msyukyu-odoo 3df9f5d689 [IMP] crm: add a forecast feature (kanban, pivot, graph, list)
* Currently located in CRM as it is its only use. After Owl-ification of Web
  Client it will probably be added as a core feature.

* Objectives:

  - Kanban view:
    - Kanban groups on a specific date/time field should be contiguous and show
      a short term vision. Empty groups should be shown
      -> FillTemporalService
      -> ForecastKanbanModel
      -> context.forecast_field

    - Add the next period (i.e. month) with one click in the kanban view
      -> ForecastKanbanRenderer
      -> ForecastKanbanController
      -> ForecastColumnQuickCreate

    - Store specific time ranges for each granularity (year, month, ...), so
      that when the user switches back to one his progress will be recovered.
      (reset on page refresh)
      -> FillTemporalService

  - Graph, Kanban, List, Pivot views:
    - Filter out data from the past (previous periods), while keeping every
      records from the current period even if we are in the middle of it
      -> ForecastModelExtension
      -> context.forecast_filter
      -> context.forecast_field

* context key `forecast_field`:

  - Used to set the date/time field name, on which the forecast logic should be
    applied

  - This key will be used by :
      a js model (for a view) / ForecastModelExtension / FillTemporalService

* ForecastModelExtension and context key `forecast_filter`:

  This extension will use a filter, the groupBy value, and the
  context.forecast_field to apply a custom domain constraint.

  This domain constraint can also be applied by default with the
  FillTemporalService, but it was decided to extract it to a filter for the user
  to be able to disable it, to see "old forgotten records" and update them if
  necessary. In other words, this filter enables or disables the first bound of
  the domain for the read group.

  - Filter "Forecast":
    This filter should set the context key `forecast_filter:1`, in order
    to only get future records starting from the start of the period
    containing "now".
    example:
      now:      2021-04-26
      groupBy:  month
      => all records starting from 2021-04-01 match the filter

  - If none of the groupBy values are the forecast_field, filters the records
    on the forecast_field starting from "now"

* FillTemporalService:

  This service will be used to generate or recover `FillTemporalPeriod`.
  Depending on the configuration, it will return an instance handling a
  certain `forecast_field`, with a certain `granularity` (hour, day, week,
  month, quarter, year), for a certain `modelName`. This can be used in
  multiple views to always get the same object, if it concerns the same model,
  the same field and the same granularity.

  The generated `FillTemporalPeriod` object is used to compute the final domain
  and context to be provided to the backend `read_group`.

  The objective was to limit the amount of desired groups regarding a specific
  time period (cycle). Here are the cycles depending on the granularity:
    granularity   -   cycle
    -------------------------------
    hour          -   one day
    day           -   one week
    week          -   one week
    month         -   one year
    quarter       -   one year
    year          -   one year

  In order to get a minimal amount of groups after a read_group, we can provide
  an integer in the configuration : `min_groups`, which will guarantee this
  amount of groups, regardless of the rest of the configuration

  The default maximum amount of groups returned depends on the end of the
  specific cycle reached after guaranteeing `min_groups`

  We can always alter the result by directly modifying the `start` and `end`
  properties of the `FillTemporalPeriod`, using the dedicated methods to do so.

  Configuration of the domain with the keys `force[Start|End]Bound`
  - true:         applies a lower|upper bound for the domain, which means that
                  the subsequent read_group will search for groups [from the
                  start|until the end] of the FillTemporalPeriod
  - false:        no domain constraint applied, which means that at least every
                  groups with records in the database will be returned

  Configuration of the context with the keys `forceFilling[From|To]`
  - true:         set fill_temporal.fill_[from|to], which means that at least
                  every groups [from the start|until the end] of the
                  `FillTemporalPeriod` will be returned as contiguous groups
                  by a read_group
  - false:        does not set fill_temporal.fill_[from|to], which means that
                  read_group will only return groups from|until the first|last
                  one with at least one record

  The `expand` method can be used to add one interval to the end of the
  `FillTemporalPeriod` depending on the granularity (add one group)

* any "forecast" view :
  - should define a `forecast_field` in the context
  - should use the `forecast_model_extension` with the searchModel to be able to
    filter "future" records correctly
  - could make use of the `FillTemporalService` to maintain a consistent domain
    and context when grouping by the desired date field. The domain and
    context are to be applied on __load and __reload calls in the MODEL, on the
    provided domain and context, to further filter the groups returned by a
    read_group.

* forecast views: graph, kanban, list, pivot

  * kanban
    uses: forecast_model_extension, fill_temporal_service

    has a custom `column_quick_create` limited to the forecast_field which
    allows to add the next group (period depends on granularity)

    works with the sample_server even thought the domain and the context are
    modified during the __load/__reload processes.

  * graph, pivot, list
    use: forecast_model_extension

Task-ID: 2243913
PR odoo/odoo#69380
2021-06-30 09:51:42 +00:00
Qiuyu (QHO) bd67479316 [REF] mail, mail_bot, im_livechat, *: convert JS files to ES6 modules
task id: 2487514

closes odoo/odoo#69376

Related: odoo/enterprise#17749
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-04-19 13:33:35 +00:00
Aurélien Warnon 2bf049fd50 [FIX] crm: reposition tooltip to avoid resize flicker
The tour bubble "animation" that makes it to bounce up and down can cause
issues when its position is at the edge of the bottom of the screen.

In the CRM tour, this would make the window constantly resize to show a
scrollbar and then resize to hide the scrollbar, creating quite a sickening
effect visually.

While waiting for a more "robust" solution on the framework side, we solve this
occurrence of the issue by simply moving the tooltip position on top of the
button instead of below it.

Task-2476595

closes odoo/odoo#68470

X-original-commit: cdb7a8ad7647649ad8f595454aa9dc0464117568
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-29 13:16:41 +00:00
Aurélien Warnon cd117b15d4 [IMP] crm: improve crm.lead kanban ribbon display
Since e86f892a7b

We have the possibility to display a "lost" and a "won" ribbon on the crm.lead
kanban view.

In this commit, we change things around a bit:
- The "WON" ribbon was removed.
  Since it was redundant with the stage anyway and not very useful.
- The "LOST" ribbon is now always displayed in the kanban view.
  And not only when coming from "duplicate leads".

In addition, leads displayed when coming from the stat button on the
res.partner form view now also shows lost leads (active_test=False).
This can be helpful for the end user because he wants to know "all the deals
that are in progress/lost/won with this specific contact".

Task-2349526

closes odoo/odoo#67693

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-12 09:38:35 +00:00
Julien Banken e86f892a7b [IMP] crm: Duplicate leads on lead form view
PURPOSE

Duplicate lead records are an issue for CRM users
To prevent sales representatives from contacting a prospect that:

- Already refused an offer from another sales
- Already accepted an offer from another sales
- Is already discussing with another sales

The purpose of this task is to inform the CRM user that there are
some possible duplicates for one lead and let the user decide how
to handle the case.

SPECIFICATION

- Add a computed field to count the number of potential duplicates.
- Add a stat button on the form view of a lead to display the number
of potential duplicates. When the user clicks on it, the leads
considered as duplicate will be displayed in a kanban view.
- Add a lost ribbon on the kanban view to quickly visualize the lead
state since the duplicates can be lost leads.

LINKS

Task ID : 2151017

closes odoo/odoo#61834

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-10 14:29:50 +00:00
ijas ahammed c9a71fbfb4 [FIX] crm: reposition tour bubble to allow scheduling an activity
In the crm tour, we have a step where we want the user to drag and drop the
card. But the bubble for this step is just besides the icon to schedule the
activity. So if user tries to schedule the activity and hovers on the tour
bubble, the tour help overlaps the drop-down of activities and prevents
user from scheduling one.

This commit fixes the issue by moving the bubble for this step at the right
side of kanban card so that tour does not prevent user from scheduling the
activity.

closes odoo/odoo#66136

Task-id: 2449223
X-original-commit: e9b5a0522f019adb7ae17164e314206a61c71cc6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-15 08:24:52 +00:00
Mohammed Shekha 706929e118 [FIX] *: update tour sequence
with this commit we are updating sequence of onboarding tours

task-2444153

closes odoo/odoo#65244

X-original-commit: a928beccb09f4db4234356e5e4f7bdf090ecc964
Related: odoo/enterprise#16026
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-29 09:03:08 +00:00
Mohammed Shekha 78ab4bde80 [FIX] *: various tour fixes
with this commit we fixes various tour steps, remove steps from crm and sale
tour and improve step selector in project tour.

task-2444272

closes odoo/odoo#65073

X-original-commit: f6c05693f857acfb0f74bb76c4bd72f83d9fb335
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-26 15:51:04 +00:00
Thibault Delavallée e1355dae7a [REF] sales_team: improve crm.team.member model and data
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.

SPECIFICATIONS: MODEL CLEANING

In this commit we improve team member model to make it more usable and
aligned with current Odoo views and usability.

This commit contains notably
  * add some related fields on the user: phone, mobile, company, email;
  * rename "team_user_domain" to "assignment_domain";
  * rename "maximum_user_leads" to "assignment_max";
  * improve member views globally;

We also introduce dynamic domain computation for users and teams when seeing
team members. This allows to limit selection of users or teams depending
on already existing configuration. Purpose is to avoid having people trying
to create wrong configuration (duplicates, ...) and receiving error messages.

Also
  * clean some data and demo about teams and members;
  * fix some views glitches;
  * improve views: add some fields in search views, improve wording of
    fields or actions, ... globally improve usability and US as well as
    feedback given to users;
  * group sales team members by team by default as it help getting an
    overview of team members distribution;
  * update tests to create team members instead of writing directly on m2m
    towards users;

SPECIFICATIONS: SALE_TEAM_ID FIELD ON RES.USERS

In this commit we also rewrite sale_team_id field of res.users. Previously in
crm it was simply a many2one field linking to a crm.team. It was used to compute
team membership as a standard many2one / one2many relationship. In enterprise
module ``website_crm_score`` this field was set as a related on first user
teams. Indeed scoring changed relationship between users and teams to a
many2many.

This field is now directly a computed many2one field that links to the
"main" team of the user even in multi memberships mode. As memberships can
now be de-activated we changed this field to a computed stored field. It is
based on oldest active membership of user. That way default team of documents
will be the user's oldest team considered as its "main team".

SPECIFICATIONS: LEAD_ALL_ASSIGNED_MONTH_COUNT

Improve crm_team ``lead_all_assigned_month_count`` field computation. It is
now simply the sum of assigned leads of team members. Differences may
happen if a lead in teamA is assigned to an user working in teamB. This should
not happen if team / user is correctly set at lead level which is generally
the case. However if that happens, old field counted it. New field will not
count it as it is not directly linked to a team's member.

SPECIFICATIONS: DEMO DATA

Make crm.lead demo data coherent with user_id / team_id . As demo data should
be using a mono-membership behavior for users and teams, we have to ensure
user_id and team_id effectively matches. It allows to have coherent reporting
and assignment demo flows.

Also avoid having Odoobot responsible of leads. Instead of undefined user_id
and team_id leading to Odoobot being responsible of some leads, force it
to be False. Those demo data allow to test automatic assignment of lead

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#996
2021-01-21 10:56:37 +00:00
Aurélien Warnon 6316dd76d4 [FIX] crm: fix rainbowman message display conditions
This commit fixes the display of the rainbowman message when leads go through
the "won" stage.

Currently, some flows don't show the message when they are supposed to or show
the message when they are NOT supposed to.
This is because the case when the form is saved through the regular "Save"
button is not handled at all.

The CRM form controller extension was completed with the missing use case and
fixed.
An additional QUnit test ensures the correct behavior.

Task-2418294

closes odoo/odoo#63599

X-original-commit: c5cbb9975897935e9ed4e1bce80335207758fa24
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-18 16:52:14 +00:00
Aurélien Warnon 9a7cc10467 [FW][FIX] crm: change the position of a tour step tip 'bubble'
This commit slightly changes the crm tour by changing the position of a tip
bubble.

During the quick creation (kanban) of a record, the tip text was placed on top
of the m2o selection proposals, making them hard to read / click.
We simply moved the tip text to the top of the selection instead.

Task 2373095

X-original-commit: 878bffce2582a3abbc9285631af947be78086e19
2020-11-19 14:51:42 +00:00
Kamesh Patel c8ba009c6c [FIX] crm,mail: clear breadcrumb when redirecting to activities from systray
Before this commit:

When accessing activities from the systray, any existing breadcrumb-item should
be clearer.

After this commit:

Clear breadcrumb-item when access activities from the systray.

Task-2342246

closes odoo/odoo#60018

X-original-commit: a9b32448c4a6227ef8e729436cb793ea9c24c289
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 15:12:42 +00:00
Dharmraj Jhala 34f05c2218 [FIX] crm: fix randomly broken crm tour
While running 'crm_tour' in test mode and quick creating record on
crm kanban, adding a partner and moving to another field from
tour opens a confirmation dialog asking whther or not you want to
create a new record. This dialog remains open sometimes, breaking
the further flow of tour.

This commit fixes the issue by selecting or creating the record from
drop-down after adding a partner (and before going to further steps),
thus avoiding the confirmation dialog.

Note:
- Because we create/select the partner, the 'name' field is auto filled
  and we don't have to set anything in there. So this step is not needed
  anymore in the tour.

TaskID - 2323196

closes odoo/odoo#58823

X-original-commit: a592ba14f82028487cee0b060a86881f0175aeda
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-09-29 14:08:33 +00:00
Ankit Sathvara 0fb77cf0d5 [FIX] crm: sequence CRM tour
This commit adds sequence to CRM tour so that it can be prioritized over other
apps.

Task ID-2302572

closes odoo/odoo#58799

X-original-commit: 7372d9995aaad2fd8a259cbdea6e176bac6017b0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-09-29 11:44:20 +00:00
Julien MougenotandAaron Bohy ef731cc1c9 [IMP] crm,web_tour: Improve CRM tour keynav
Two things have been introduced in this commit:

The first is a change in the way the tour tip widgets are updated when
a DOM mutation is triggered: before this commit, each active tip would
evaluate its current anchor to elements matching its "trigger" selector.
If the element was not the anchor, it was set as the new anchor and
would be bound to the tip event handlers. Now, the unbinding/rebinding
of event handlers is done regardless of the new element.
This is helpful when the anchor is on a field monetary for example,
which keeps the same input element while internally unbinding and
rebinding the widget event listeners to it on each rendering. This
process does not include external event listeners such as those of the
tip and they were lost until now, breaking the tour step.

The second change is a modification of the CRM tour: the "Expected
revenue" field being an input, the according step trigger has been set
to target the input element instead of its parent. This means that the
step will await an "input" event instead of a click to be consumed,
making the tour step feasible with a keyboard.

Task: 2314864

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-08-18 13:49:02 +00:00
Jérémy Hennecart a895cfcded [IMP] crm: harmonize won triggers with rainbowman
PURPOSE

Make sure the Rainbowman animation is rightly triggered whichever way the user
marks the opportunity as won. Especially relevant for the onboarding as we want
to show the first rainbowman to users completing the tour.

SPECIFICATIONS

Now the rainbowman and its finely-tuned message are displayed to the user when
he uses the statusbar, mark lead as won using action buttons or drag and drop
a lead in the won stage in kanban view.

LINKS

Task ID-2287758
PR #54553
2020-08-17 06:42:28 +00:00
Patrick Hoste 8066ab4348 [REF] crm: update revenue fields names
PURPOSE

Link field name with their content.

SPECIFICATIONS

This commit changes the field name "expected_revenue" into "prorated_revenue"
and the field name "planned_revenue" into "expected_revenue".

Indeed content of those fields evolved since their first naming. Their content
is not what the field name indicates. Better rename those fields to understand
code flow inside CRM.

LINKS

Task ID-2283052
odoo/odoo#54194
odoo/enterprise#12423
odoo/upgrade#1463
2020-08-14 12:59:27 +00:00
Anousone Phaysomphot ac00b8030f [IMP] crm: add new digest tips
PURPOSE

Review the tips and digest layout design to make sure they have a WOW effect
and increase trial conversion/retention.

SPECIFICATIONS

“Did you know Odoo has built-in lead mining?”
“Opportunity win rate is predicted with AI”
“Manage your pipeline”
“Do not waste time recording user's data”
“Turn a selection of opportunities into a map”

See code for specifications.

LINKS

Task ID-2274264
COM PR: odoo/odoo#53580
ENT PR: odoo/enterprise#1139

X-original-commit: 93c7aa19397ae7a25e88e760f44d24a0b4f0dd9a
2020-08-12 12:22:59 +00:00
Fabien Pinckaers f130bb90aa [IMP] crm: improve first steps onboarding copy writing
PURPOSE

Improve user experience by improving copy writing of tour steps and first
encountered screens.

SPECIFIFCATIONS

Improve Pipeline empty list help to be more catchy and help users doing their
first opportunity related steps.

Improve tour copy writing.

LINKS

Task ID-2316699
PR #55604
2020-08-10 08:20:17 +00:00
Pierre Collinet (pic) af7b23f4ae [IMP] crm: Redirect to activity view from systray
Purpose: Redirect to lead activity view when clicking
on activity systray for leads. The idea is to give the
user a quick overview of his "To Do List" activities.

Specification: The path from the systray (opportunity/leads)
should redirect to the view with the buttons instead of the
one from the pipeline.

On top of the existing filters/domain, it adds the time-based
filter : Today, Late, Future Activities, ...

Task ID-2281254
Community PR odoo#55383

closes odoo/odoo#55413

X-original-commit: 0cee7f48ce44cea6aa31fcace40206eaed5315ca
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-04 15:09:20 +00:00
Pierre Collinet (pic) f844b47757 [IMP] crm: Allow CRM users to easily see and process their To-Do list
General Purpose : Introduce a new "My Activities" view so that CRM
users can easily overview and process their To-Do list

- new button in "My Activities" tree view : Send Email
Purpose: allow users to send email in one click to the client

- new button in "My Activities" tree view : Send SMS
Purpose: allow user to send sms in one click to the client

- new button in "My Activities" tree view : Snooze
Purpose: easily Snoozes the activity for 7 days
--> today + 7d if deadline < today
--> deadline + 7d if deadline >= today

- New view crm_case_tree_view_my_activities to show "My Activities"
Purpose: Use this view so that CRM users can have a "To Do List"
Domain of this action is : crm.lead, type = opportunity
Filter is : My Activities (at least an activity assigned to me)

- Rename filter "assigned_to_me" to  "My Activities"

- Change crm_case_tree_view_oppor to be clearer for the user.
Purpose: allow the user to have an good idea of what he has to do in
a view.
Remove all decorations set on the CRM tree views
Add the widget remaining_days to the field activity_date_deadline
Add the field activity_ids with the widget list_activity

- New menu item and corresponding act_window to display the new views

Task ID 2243124
Community PR odoo#51537

closes odoo/odoo#53376

X-original-commit: 2382c01956feda617b7d207d1bc4d69de1e8b6b3
Related: odoo/enterprise#11314
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-06-22 07:33:44 +00:00
Pierre Collinet (pic) f1c99a60fa [IMP] crm: improve onboarding tour of module CRM
Add an autocomplete for opportunity name. If no name is set when a customer is
selected set the name partner_id.name's Opportunity

Change help title and subtitle to be more explicit. Change title from "Create
an opportunity in your pipeline" to "Create opportunities to keep an eye on
all your ongoing sales talks." Concerning subtitle, if a valid
and active email alias is found : Emails sent to ALIAS@address automatically
create opportunities.

Improve crm onboarding tour text messages and display.

Change menuitem from Teams to Team Pipelines to be more explicit. Update
the corresponding act_window name in the sales_team module.

Make the "schedule an activity" button bigger (100% of the div) and highlight
the entire Schedule button box.

Update test tours accordingly. Since quick create opportunity form is updated
the tests were failing. Reason is a trigger on input:first trying to detect
the field "name". This is not the case after this commit's changes.

Task ID 2226563
Community PR #51587
2020-06-11 12:26:45 +00:00
Elisabeth DickinsonandThibault Delavallée 2503a66c42 [IMP] crm: make tips bioutifoul, and add moar tips
PURPOSE

Make digest email and tips more appealing. The goals of these tips are

  * to encourage the adoption of other apps (Did you know ?);
  * to make Odoo look more fun (Fun tips and tricks, young and dynamic style);
  * to show social proof and increase trust (emphasis on already existing
    projects / customers to);

SPECIFICATIONS

Improve existing tips to be more inlined with new digest styling.

Add new tips, notably

  * use lead enrichment;
  * use lead mining;

LINKS

Task ID 2197417
PR odoo/odoo#51619

Co-Authored-By: Elisabeth Dickinson <edi@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-06-04 15:20:14 +00:00
Sébastien Mottet (oms) debeec1201 [IMP] mail, crm: add view types for crm.lead model when coming from activity menu
Purpose of this commit is to allow customization of view types available when
using the activity menu. By default only kanban, list and form are available
as before.

Calendar, pivot, graph and activity have been added for leads, allowing
better user experience in their use of activities.

Task ID: 2228451
Community PR odoo/odoo#50042
Enterprise PR odoo/enterprise#10145

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-30 11:34:36 +00:00
Romeo Fragomeli ab2e3fdb7d [REF] *: add tour steps utils
This commit moves some step utils in a dedicated file and add new ones.
These steps will be very useful for the Main Flow Tour to avoid
duplicated code.

To do this, we also had to transform it into functions to allow
utils to call each other. Existing one are converted for
standardization purpose.

Note that 'WEBSITE_NEW_PAGE' wasn't considered as an util.
This is a very simple step only used twice.
2020-03-11 10:10:16 +00:00
Siddarth Gajjar 6a56b6c47b [IMP] crm: remove custom css on form view
Purpose of this commit is to get rid of custom css code and file and use
standard bootstrap classes.

TaskID 2182610
Closes #45472

closes odoo/odoo#46948

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-03-05 10:42:43 +00:00
Hiral Bhavsar e28d3aa4d3 [IMP] crm: merge lead and opportunity form views
When redirecting to record, the wrong 'form' view will sometimes be
loaded. A 'hack' has been done in crm_lead.py to redirect the user to
the relevant 'form' view based on the value of the 'type' field.

However, this solution is not clean as it does not solve all cases
(multiple crm.lead records loaded from the activity systray, reloading
the page after redirection, etc.)

Goal of this task is to solve those issues by merging crm.lead.form.lead and
crm.lead.form.opportunity form views. That way multi records actions will
always display the relevant information according to record type.

Note: Here some fields used as a twice in the form view just to stay
close to the current design. Still few things which are not possible
here for 'lead' and 'opportunity', that is
* A dynamic 'placeholder' on 'name' field.
* A 'domain' on 'partner_id' field.
* A 'widget' on 'probability' field.

Task 47118

closes odoo/odoo#32248

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-20 08:38:52 +00:00
aca 78565b1dc9 [REM] web_settings_dashboard: Merge module into base_setup
Purpose
=======

Currently, when we click on “Settings” on the Home Dashboard, we arrive
on a new Dashboard with several pieces of information like Installed Apps,
invite new users, or translations. Some informations are reachable in
several ways, which is not necessary.

We would like to remove this page and replace it with the General Settings
page directly. That makes more sense to the user who click on “Settings”. The
present informations will be dispatched in the menu or in the general settings
for a better usability.

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

This commit move code from web_settings_dashboard in order to put the features
in settings directly. To do so, we choose to move code to base_setup, and create
widget on the settings form view to keep features. Concerned features are: invite
users, dev tools, odoo edition number and IAP account link.

TaskID: 2006910

closes odoo/odoo#34290

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-26 09:53:46 +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
Romain Derie fdbf11643f [IMP] *: move test and tour files to new folder hierarchy and asset
As we now have a new debug mode 'tests' which load a new asset bundle
containing tour-test files, we moved those files to a new folder hierarchy.
That will clean the .js files trees.
Also, those files should be included in the new asset.

Basically, the .js tour files (not test) should be inside /static/src/js/tours
while .js tour test files (test=true) should be inside /static/tests/tours next
to QUnit tests, inside a tours folder.

+ test_new_api: don't run the test in debug assets

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
Geoffroy Larue 87ab98832e [IMP] crm: usability improvements
Purpose : Various relabelling and design improvements in crm:
- opportunity, lost reason, lead, team, tag forms
- hide "convert to opportunity" button for inactive/lost
leads (actually nothing happened when clicked anyway)
- Checkbox in crm.team to hide all alias related fields
- New many2one field appearing in crm.team form to select the user to
whom lead created by alias will be assigned.
- Set the admin as leader of the initial crm.team

closes odoo/odoo#28851
2018-12-03 14:12:43 +00:00
Alexandre Kühn 38c7ed3c73 [FIX] *: adapt tours for the new community navbar
*: crm,
   hr_expense,
   hr_recruitment,
   point_of_sale,
   project,
   sale,
   stock,
   web_tour,
   test_main_flows,
   test_new_api

To sum up:
- Click on "Apps Menu" then the app item.
  (previously: click on '+' then the app item).
- Click on navbar section menu item.
  (previously: click on sidebar section menu item).
2018-09-17 16:46:53 +02:00
qsm-odoo 66289d639c [REF] *: BS4, review breadcrumb structure
Now, the 'breadcrumb-item' class has to be put explicitely on
breadcrumb items.
2018-07-27 12:36:54 +02:00
qsm-odoo 2c966909e2 [FIX] *: fix some side-effects of https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548
- JS Modals were not correctly built anymore, their .modal-body element
  was duplicated and many without-effect JS lines were introduced (as a
  side effect, the form view design was broken when inside modals)

- Tests were changed to make bugs go unnoticed. For example, the media
  dialog functionnality was entirely broken because the .modal-dialog
  element was not receiving the correct class anymore.

- The JS translation function is _t, not _

- Do not use the <title/> tag as a regular DOM element, it is meant to
  be unique, in the <head/> section

- CSS rules were added to the utils.scss file, which is meant to contain
  functions and mixins, otherwise, the rule is duplicated in every asset

- Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56

- Tests were changed to use [role="dialog"]/footer/header in their
  selectors without any reason, this commit restores some of that to
  avoid rebase conflicts with the BS4 work.

- ...

Note: other elements should still be discussed, like the direct use of
the 'o_form_label' class in views definition... but those do not cause
direct problems.
2018-07-09 11:59:30 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
Fabien Pinckaers 361070a45e [IMP] web, crm: minor copywriting in Kanban and CRM flow 2018-05-30 20:42:17 +02:00
Mitali Patel 9f392372e2 [IMP] crm: Improve tour labels
Task Id: 1827293
2018-04-23 17:14:27 +02:00
Jigar PatelandAaron Bohy 89050f61b7 [IMP] web_settings_dashboard,*: improve UX
*crm,project: css selector adapted in tours

This rev. improves the UX of the 'Invite users' and 'Pending
invitations' part of the Settings dashboard.

Task 32804
Closes #19531

Co-authored-by: Aaron Bohy <aab@odoo.com>
2018-03-15 08:32:43 +01:00
Aaron Bohy 7ed3bd40a7 [FIX] crm,test_main_flows: adapt tours to flow changes
The 'crm_tour' and 'main_flow_tour' tours both create a 'crm.lead'
record from the Kanban view at some point. Since last commit, this
doesn't open a form view in a dialog anymore, but instead opens a
form view in the QuickCreate widget. Some steps of those tours had
to be adapted accordingly.
2018-01-26 19:26:03 +01:00
Alexandre Kühn a87d761fdb [IMP] core: menu tip ux/ui improvement
We would like to make the "no item found" screens more appealing.

Before this commit, it shows a small help tip in the top-left
corner of the screen, just below the "Create" button.

With this commit, these help tips have been replaced by onboarding
screens, which consist of a picture and some text below, both of which
are horizontally centered.

The texts have been slightly changed, so that they are shorter and clearer.

Considered modules:

(A)
    account,
    account_asset,
    account_budget,
    account_test,
    account_voucher,
    analytic
(B)
    barcodes,
    base,
    base_automation,
    board
(C)
    calendar,
    contacts,
    crm
(D)
    delivery
(E)
    event
(F)
    fleet
(G)
    gamification,
    google_drive
(H)
    hr,
    hr_attendance,
    hr_contract,
    hr_expense,
    hr_gamification,
    hr_holidays,
    hr_payroll,
    hr_recruitment,
    hr_timesheet
(I)
    im_livechat
(L)
    l10n_fr_sale_closing,
    link_tracker,
    lunch
(M)
    mail,
    maintenance,
    mass_mailing,
    membership,
    mrp
(N)
    note
(P)
    payment,
    point_of_sale,
    post_mercury,
    pos_restaurant,
    product,
    project,
    purchase,
    purchase_requisition
(R)
    rating,
    repair,
    resource
(S)
    sale,
    sale_timesheet,
    sales_team,
    stock,
    stock_account,
    stock_landed_costs,
    stock_picking_batch,
    survey
(U)
    utm
(W)
    web,
    website,
    website_blog,
    website_customer,
    website_event_track,
    website_forum,
    website_quote,
    website_sale,
    website_sale_digital,
    website_slides
2018-01-18 21:43:29 +01:00
RomainLibert 1734b8f8de [IMP] crm: onboarding
- Add missing tour stage in crm creating opportunity and minor fixes
- Label, Placeholder and Tip IMP
- Restrict Create new sales channel
- No Content Help Improvements
- Schedule Activity Button Layout Change
- Chatter Log IMP
2018-01-15 10:23:13 +01:00
dip-odoo 8eea65b61d [IMP] mail: add a 'Done & Schedule Next' button in activity wizard
Purpose
=======

Users often log an activity and want to schedule another one immediatly.

We should limit the number of clicks

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

- Mark as done should be a secondary button
- Add a new secondary button : DONE AND SCHEDULE NEXT
- It should mark the activity as done and close the modal
- It should open a new activity modal

Behavior and available options are now the same in the Chatter modal and
the wizard itself. It implies correcting the crm_tour flow
2017-12-06 12:40:41 +01:00