Commit Graph
8357 Commits
Author SHA1 Message Date
Thibault Delavallée d978b9e1c0 [IMP] various: update query counters according to latest runbot run
Base: seems related fields take only 1 extra query instead of 3

Crm: assignment seems to have been slightly improved. Some randomness still
happens.

Hr Holidays: seems it was further improved beyond space frontier

Hr Work Entry Holidays: seems it was further improved

Test mail: those tests were a bit random, seems random is gone (hopefully)

Test mail full: updated local counters

Test mass mailing: seems we gained one query, updated local counters

closes odoo/odoo#70504

X-original-commit: 8c215b3d60929166b3e60e2a4dfb2a6c70439046
Related: odoo/enterprise#18194
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 08:18:04 +00:00
Raphael Collet f934b29a8a [REF] core: speed up the retrieval of fields on models
Fields are no longer retrieved with inspect.getmembers(), which is
time-consuming.  Instead, the classes defining models automatically
collect their own fields (via Field.__set_name__()), and the field
retrieval is done by using those collections.  Also, a field no longer
needs to introspect its model class to find its field definitions.

A class that defines a model automatically determines its '_name',
'_inherit' and '_module' upon creation, and the fields determine their
'name', 'model_name' and '_module' via Field.__set_name__().

Loading a registry with 290 modules from scratch is now 25% faster.
2021-05-03 12:33:29 +00:00
Thibault Delavallée 6c7dd7501a [FIX] crm: do not reset action name in convert wizard each time an option changes
Currently ``name`` field that holds the action type is recomputed each time
duplicated leads are updated. However duplicated leads are often updated
notably each time customer action (create / link / do nothing) and chosen
customer are updated.

As ``name`` compute method is mainly present to replace a default value
its compute method is updated so that it nows compute only when not having
a value. Once having a value user choice is kept.

Task ID-2452777
COM PR odoo/odoo#68618

closes odoo/odoo#70254

X-original-commit: d75905f7acb1e7584d01792b4880fa76e6920d56
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-03 11:51:27 +00:00
Nasreddin (bon) 29398abb4e [FIX] crm: display right partner and action when converting lead
Issue
	- Create a partner with email 'aaa@test.com'
	- In CRM settings, activate 'Leads' feature
	- Go to CRM -> Leads and create a Lead:
	- Set email field to 'aaa@test.com'
	- Click on 'Convert to opportunity'

	Neither the action or partner_id field is set to the right value.

Cause

	Due to missing 'lead_id' field in template, the partner_id field
	is not recomputed since action is not recomputed.

Solution

	Add 'lead_id' field as invisible in form.

opw-2439722
Task ID-2452777
COM PR odoo/odoo#68618

X-original-commit: 6915d17f5f10737c03c820b69eded3a7c0151907
2021-05-03 11:51:26 +00:00
Simon Genin (ges) ecfe85db84 [REF] web: static/src/(img|fonts) => static/(img|fonts) 2021-04-29 07:34:40 +00:00
Thibault Delavallée effebe148f [FW][FIX] mail, various: fix document access link computation
Purpose of this commit is to fix computation of access link. In some cases
msg_vals modification leads to invalid URL computation, notably for frontend
or backend differentiation for target recipients.

Followup of odoo/odoo#63292 .

Task ID-2513724
COM PR odoo/odoo#69607
ENT PR odoo/enterprise#17849

X-original-commit: e618597876692f2d24f8e9308c747b8d1f2d8905
2021-04-23 15:24:58 +00:00
Julien Banken 0bc56aa7a2 [IMP] phone_validation: improve mobile/phone search
PURPOSE

This commit aims to simplify the phone filter of the lead search view
to better manage phone numbers containing letters.

SPECS

The current phone filter will remove all non-digit characters from the
input string. When the user enters an american phone number containing
letters, the filter can sometimes return phone numbers that do not match
exactly with the provided input string.

eg: If the user types "hello123" in the search bar, the filter will
return all phone numbers matching with "%123%". This pattern will indeed
match with "hello123" but it will also match with many other phone numbers
containing only "123".

To fix the issue, the phone filter will no longer trim all non-digit
characters from the input string. The filter will be more standard and
will better manage phone numbers containing letters.

LINKS

Task ID-2424185
COM PR odoo/odoo#64078

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-23 13:15:49 +00:00
Julien Banken 4b8c55697c [IMP] crm: add tests for phone / mobile search
This commit aims to add tests to ensure current behavior of seach on
mobile/phone field. Some unsupported cases are commented to highlight
current feature state.

LINKS

Task ID-2424185
COM PR odoo/odoo#64078
2021-04-23 13:13:47 +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
Sunil Shrimali 612845686c [IMP] crm: add probability on lead tree view
Currently, in crm probability field is not displaying
in lead tree view. with the removal of lead scores,
the probability is now the tool we want users to see
as their "quality indicator" for their leads.

With this commit, we now display probability field
(optional="hide") in lead tree view, also probabilty
label changes to "Probability (%)" in Leads and Pipeline
Tree view.

closes odoo/odoo#68680

Taskid: 2496347
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-12 14:07:52 +00:00
Noe Antoine 335701b35e [IMP] crm : develop a smart calendar view from crm opportunity
Before, when the user clicked on a crm opportunity "meetings" smart button,
the calendar view was centered on the present day, and with default mode
(week, month,...) as a scale. This behavior leads to calendar views that
were possibly not including those meetings.

This smart calendar improves this by computing the target date and the scale
to make sure that the user is taken to the useful time period when using the
smart button from crm opportunity. The meetings considered are only the
relevant one, that is only the ones not finished yet, if there are some, and
all (finished) meetings otherwise. The calendar works as follows :

 -If no meetings: show current week
 -If one: show that week
 -If more than one and same week : show that week
 -If more than one and same month : show that month
 -If more than one month, show month of the first meeting.

This is done according to user language week_start and timezone. This way
the user always see what is the most relevant.

Also added python tests in class TestCRMLeadSmartCalendar.

Task ID-2431245

closes odoo/odoo#64807

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-01 18:59:48 +00:00
Thibault Delavallée 389d74fab3 [IMP] crm: allow team members to opt-out from assign
Purpose is to allow members to quickly opt-out / opt-in from assign
process. For example if for some reason (leaves, too much leads, temporarily
working on something else) a salesperson cannot handle more leads he may
opt-out from assign process.

When member is opt-out, hide assign details from both kanban and form
views. It allows notably to see at a glance who is out and who is in.

Task ID-2494749
COM PR odoo/odoo#68476
UPG PR odoo/upgrade#2318

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-30 14:41:16 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
nounoubensebia 6c81ee556f [REF] [crm_]mail_client_extension, base_setup, crm[_iap_lead_enrich], iap: split mail specific and crm specific code
- split the mail_client_extension module onto two modules:
  1) module mail_client_extension having mail/contact specific code,
  depends on iap and contacts only
  2) module crm_mail_client_extension having crm specific code,
  depends on CRM and mail_client_extension.

  Purpose is to allow the user to use the mail_client_extension
  without needing to install CRM, this will also allow
  the usage of the mail connector in other modules without
  the need for CRM.

- add the module_mail_client_extension field to the
  res_config_settings model of the base_setup module
  in order to enable the user to install the
  mail_client_extension module directly from the settings

- move the crm_lead model from the mail_client_extension_module
  to the newly created crm_mail_client_extension_module, as this
  model is no longer needed by the mail_client_extension module
  because it no longer not implemants CRM functionality

- move the iap_enrich_api model from the crm_iap_lead_enrich
  module onto the iap module as it is only related to contacts
  and not to CRM, this way it can be used in other modules such
  as the mail_client_extension module without the need for CRM
  module

Task-2382870
UPG-PR: https://github.com/odoo/upgrade/pull/2156
COM-PR: https://github.com/odoo/odoo/pull/66139
2021-03-29 11:59:11 +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
Ipsita Borisagar 7e5ee53035 [FIX] crm: avoid to display false in case of void subject
Before this commit:

If there is no subject for message, it effectively displays "False" in case of
void subject.

After this commit:

If there is no subject for message, it will not display "False" in case of void
subject.

Tasks-2156170

closes odoo/odoo#68243

X-original-commit: 4b2f0ddcbe859ec8453e537aec9d5b0685876eca
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-23 13:52:19 +00:00
Munaf Khan 8f88307c18 [FX][FIX] crm: prevent email_from propagation if only formatting differs
Before this commit when we update the email_from field on lead with only
formatting differing from partner a warning ribbon was displayed. It
considered email had changed and had to be propagated. Moreover unnecessary
update on partner was done to propagate the new email onto the customer.

In this commit we propagate email only if normalized versions are different.
It means that if lead email_from is "Hermes Conrad <email@example.com>" and
partner email is "Jonathan Conrad <email@example.com"> no update from lead
to partner is performed. Indeed normalized versions are the same.

Task ID-2461308
PR odoo/odoo#66890

X-Original-Commit odoo/odoo@3dd972c35b

closes odoo/odoo#67859

Related: odoo/enterprise#17191
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-22 07:52:19 +00:00
Thibault Delavallée 700929d1a4 [FW][IMP] crm: improve phone / email tests for lead / partner sync
Purpose of this commit is to improve phone, email and mobile synchronization
tests for lead / partner. Notably

  * mobile is not synchronized: only a void mobile is set to partner's mobile
    when changing partner. It is not synchronized back onto partner;
  * email / phone are correctly synchronized;
  * phone_sanitized is computed on both lead and partner based first on mobile
    then on phone. It means records having the same phone numbers could have
    different phone_sanitized values if mobile numbers differ;

Task ID-2461308
PR odoo/odoo#66890

X-Original-Commit odoo/odoo@0adecd9a6e
2021-03-22 07:44:05 +00:00
Thibault Delavallée 7991118bfe [REF] mail, various: remove support of channels from message_subscribe API
RATIONALE

Channel model is a mail.thread enabled model behaving strangely with followers,
notifications and discuss. Its code should however be simplified to be more
self contained and avoid unwanted side effects on other models.

SPECIFICATIONS

Remove ``channel_ids`` argument and support from ``message_subscribe`` and
``message_unsubscribe`` API. Indeed we do not support adding channel-based
followers anymore. Only partners should be added or removed from followers.
It also allows to simplify API and understanding of both methods.

Various addons are updated to match the simplified (un)subscribe API. Some
enterprise addons may also be impacted.

LINKS

Task ID-2070632 (main task)
Task ID-2419762 (followup task)
COM PR odoo/odoo#62859
ENT PR odoo/enterprise#15172
UPG PR odoo/upgrade#2005
2021-03-17 18:16:11 +00:00
Noe Antoine 374134a04c [IMP] crm: inline email and phone sync warnings on crm lead
Reduce eye catchiness of warning message when warning the user that
his changes on email and phone will also update customer.

Before, used a ribbon (ribbon_message). It is removed from crm lead model
and also of crm lead form view.

Now, only displays an orange alert sign at the end of the fields when a change
would update the customer profile. Hovering on the alert sign displays
the appropriate message. The warning icon is added on crm lead view for
both lead and opportunity types.

Python compute method of ribbon field is split in two compute methods,
one per boolean field partner_email/phone_update.

Also updates ribbon_message tests accordingly.

TaskId 2456105
COM PR odoo/odoo#66909
UPG PR odoo/upgrade#2258

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-15 16:16:59 +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
Nasreddin (bon) 84d5099ac0 [FIX] crm: allow any users to see event with privacy="Everyone"
Issue

	- Create a database with 2 users
	- Open the calendar application and create a meeting for you and the other user
	- In the option:
	  set Privacy to 'Everyone'
	  set Show times as 'Free'
	- Send the invitation to the other user

	Access Error (rule: Hide Private Meetings)

Cause

	The 'calendar_event_global' ir.rule is deprecated and related ir.rules
	are now in calendar module (crm.meeting -> calendar.event).

Solution

	Remove rule since deprecated.

opw-2469433

closes odoo/odoo#67706

X-original-commit: c2a3fdbc42e042440695c8a3fc3e657d910d2d5c
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-03-11 16:15:03 +00:00
Thibault Delavallée 8690bd6add [IMP] crm: make query counter tests informative
Those are not launched anymore by default. Indeed framework and code followup
is not ready for that level of details.

Task ID-2480727

closes odoo/odoo#67678

X-original-commit: f950399e6e4aaaf88b743abfeb37a2de4c99fa5c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-11 12:20:53 +00:00
Thibault Delavallée 8f812583cc [FIX] crm: bump query counters
According to last runbot state. Should probably be removed someday as actually
there is not much gain with those tests.

X-original-commit: dc05f873571ca60b7fbbb701a86760f13a6d3172
2021-03-11 12:20:53 +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
Nicolas Seinlet 35c0bad900 [IMP] crm: assign faster by commiting less
commit at each lead makes the system spend 80% of the time recomputing
bayesian probabilities. Avoid to commit too often speed up the process
while not altering final result.

Task ID-2475352

closes odoo/odoo#67275

X-original-commit: 34f6e38e68208b9509a429cdb09f8316a7ef566f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-04 15:49:53 +00:00
Damien Abeloos 7498f6b87b [IMP] crm: change the search order for a won stage
* The "Mark As Won" button should first look for "won stages" that
  have a higher sequence than the one the opportunity currently is.
  If none is found, then it's "ok" to go to a stage with a lower sequence.

* In Fine, we would like to prevent a "not won" stage to have a higher
  sequence than any "is won" stage. But while this is not the case, searching
  for the "is won" stage while alterning the sequence order will correctly
  handle the following case :
    - stage sequence :
        [x] [x is won] [y] [y is won] [z] [z is won]
    - scenario :
        an opportunity in [y] and marked as "won" should go to [y is won].
        (not in [x is won] nor [z is won])

Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
2021-03-03 12:43:30 +00:00
Damien Abeloos b0134452c0 [IMP] crm: add a reschedule action for activities
* Replace the "Snooze 7d" action for lead-related activities linked to
  a calendar event by a "Reschedule" action, which will redirect the user
  to the calendar view with the focus on the next event related to the
  opportunity
    - The "Snooze 7d" action only impacted the activity and not the meeting,
      and snoozing a meeting is not very logical anyway. The "Reschedule" fits
      better in this use case.

* It was discussed to show only a modal allowing to reschedule the next
  calendar event, but that could lead to inconsistent states (out of order
  sequence of scheduled events, if the first is rescheduled after the
  second).

* The reschedule option will be shown next to any activity related to a
  calendar_event regardless of its activity type. There are some edge cases
  that we may want to change in the future :
    - When changing the activity type of a 'meeting' activity associated to
      a calendar event to any other activity type, but without removing the
      calendar event, the reschedule action is still showing (since the event
      is still ongoing and was not deleted from the calendar).
    - Conversely, with a meeting which is not (yet?) related to a calendar event,
      the reschedule action will not be available.

* Add a new field to MailActivityMixin in the calendar module context. This
  field is the event linked to the next activity, if there is one such event.
  It is used to check whether the reschedule action should be available to the user.

* Add a test for this new field to validate the expected behavior.

* Add the priority widget to the priority field in the opportunity tree view

Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
2021-03-03 12:43:22 +00:00
ijas ahammed 79476eb349 [IMP] sales_team, crm{_iap}*: improve action helpers and usability
This commit improves the action helpers for the actions bound to below listed
menus for better usability:

  * My Activities
  * Leads
  * Leads Analysis

Along with that, this commit also improves the following:

  * while generating leads, make 'Industries' field required on the modal so
    that results obtained are actionable instead of random leads;
  * after trying to generate leads, if no result is found, the same pop-up
    opens again with same criteria and displays a waring in the pop-up. It
    informs users that leads are not found and no credits are spent for their
    last search;
  * improve the warning message for unsuccessful enrichment due to invalid
    email;

COM PR odoo/odoo#64075
ENT PR odoo/enterprise#15561
Task ID-2393253
2021-03-03 15:56:23 +00:00
Nikunj Ladava af1b3df986 [IMP] crm: add sales person and team on partner created from lead form view
When we create a partner on lead form view, the user and team are
propagated to the created partner, while they do not when we do the
same from lead kanban using quick create.

With this commit, user (salesperson) and team are propagated to the
partner created through lead kanban (quick create) as well.

Task ID-2446969
PR #65846

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-03 08:30:50 +00:00
Nikunj Ladava ee30ecef0d [IMP] crm: propagate partner's company_name to lead partner_name
When setting a partner on a lead if we select the individual customer that
is not a company with company_name being set, propagate it to partner_name
on lead.

Task ID-2446969
PR #65846
2021-03-03 08:30:47 +00:00
Munaf Khan f56205f85a [FIX] crm: prevent crash due to invalid system parameter
Right now, if someone changes the `crm.pls_start_date` system parameter
to something that is not valid, opening a settings gives you traceback.

This commit improves the behavior by making sure that the compute field on
settings page `predictive_lead_scoring_start_date` always contains a valid
date. For doing so, if the system parameter is not a valid date(or not set
or deleted), we set the above field to the date 8 days prior to current
date, and thus, when saving the settings, the system parameter is again
set with a valid date.

closes odoo/odoo#66988

Taskid: 2448248
X-original-commit: 19577c40f8f2878286ef63da5d30b341d7ab5cbf
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-01 10:26:42 +00:00
Thibault Francois 9b4c101484 [IMP] crm|mail: Use flanker to check email correctness
Context
-------
Lead assignement is now based on PLS probability.
We want to avoid giving the same score to real email addresses
and email addresses that are just well formed

Flanker try to acheive that be checking specific
criteria according to the domain, check the dns and mx record

Improvement
-----------
Define a mail_validate function seach as phone_validate.
If flanker is installed, use flanker for validation of
email addresses else use email_normalize.
It should help the PLS to give a bad score to well formed addresses
that flanker suspect to be wrong.

Setup
-----
NB: flanker is not available as debian package, we make it optional

To install flanker
```
pip install flanker
pip install redis
pip install dnsq
```

If you have installed it as root you may need to run
```py
from flanker.addresslib import address
```
as root for the first initialisation

closes odoo/odoo#66429

X-original-commit: f540976c8751e2bf402fed8db830ec0fbf98f654
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-18 09:15:35 +00:00
Arnaud Joset 2f4a91c0ce [IMP] calendar,calendar_sms,crm,google_calendar: Improve calendars
This commit improves multiple small details in the calendar application.
UI, UX mostly:
  * some labels were confusing
  * the invisible attribute were not set in popover view
  * the sample data were missing
  * ...

taskid: 2342252
2021-02-25 08:25:51 +00:00
Martin Trigaux 9741ef5ee6 [I18N] *: export saas-14.2 source terms
For odoo-master Transifex project, no demo data

closes odoo/odoo#66500

X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 08:02:58 +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
Anjali f661924f62 [IMP] crm: display tag colors in lead kanban
This display colors of the tags on leads' kanban view,
same as opportunity.

Task-id : 2453047

closes odoo/odoo#65677

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-11 05:18:29 +00:00
Thibault Delavallée 8b67fe0b2b [FIX] crm: still fixing some peak runbot counters in assign tests
closes odoo/odoo#65861

X-original-commit: e199f22eb07debe34de375cbefbae638075e6c0a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-10 11:12:25 +00:00
ijas ahammed 0c90469efa [IMP] crm: for first won lead, display rainbowman regardless of revenue
Right now, if the expected revenue is not set on the opportunity, the
rainbowman is not displayed and it does make sense to ask for a revenue
so that we can measure if this is a record or not. However, revnue is not
necessary to congratulate the user for his first win.

With this commit, for the first won lead of a user, we congratulate user
with rainbowman, even if there is no exptected revenue set.

closes odoo/odoo#65378

Task-id: 2410443
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 10:11:26 +00:00
Thibault Delavallée abeb7f907a [FIX] crm: update query counters
Probably linked to merge and forward of odoo/odoo#65688 that split some
computed fields. This may have an impact on some fields computation and
therefore queries.

Task ID-2455236

closes odoo/odoo#65748

X-original-commit: b1520ad39c7abd18f8af1c3b23e6e3e897916004
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-08 16:34:44 +00:00
ijas ahammed bd830b35a7 [IMP] {sale_}crm: tone down action buttons on lead/opp form view
Primary action buttons should suggest the next logical flow to the user.
On contrary, the opportunity form view is having too many primary
buttons, losing their actual meaning.

In this case we consider that next logical steps should be:
 - the creation of a new commercial document (Sale / Rental) if
   any / all of those apps are installed;
 - the winning of the deal (as losing would stop the flow);

With this commit, we make following changes to achieve that:
 - rename the 'Mark Lost' and 'Mark as Lost' buttons to simply 'Lost'
   and make them secondary buttons;
 - rename the 'Mark Won' button to simply 'Won', and keep it primary;
 - once the 'sale_crm' is installed, make the 'Won' button secondary;

closes odoo/odoo#64834

Task-id: 2247355
Related: odoo/enterprise#15977
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-28 11:45:53 +00:00
Thibault Delavallée c146e63779 [FW][FIX] crm: split computed fields linked to partner
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_partner_id_values`` compute method so that partner related
fields are independent :

  * have a method for address fields as those are computed in group. Indeed
    either we take all from partner either none. Otherwise it would create mixed
    addresses that make no sense;
  * have a specific computation for partner_name and contact_name coming
    from ``_prepare_partner_values``;
  * have other fields separated (function, title, ...) acting like related on partner
    if not set by user;

LINKS

COM PR odoo/odoo#65381
Task ID-2451339

X-original-commit odoo/odoo@78eb46352e

closes odoo/odoo#65658

X-original-commit: bb13421d3a7f04ede9350b3b28c1650c3d9890f8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-05 17:51:33 +00:00
Thibault Delavallée fa20c36a63 [FW][IMP] crm: add tests about lead / partner synchronization and computed fields
Add tests related to lead / partner contact fields synchronization. Add tests
with user input and/or partner synchronization to ensure editable stored fields
work as expected on lead model.

Warning: those tests are failing. Next commit will split computed fields into
several methods in order to fix computation.

LINKS

COM PR odoo/odoo#65381
Task ID-2451339

X-original-commit odoo/odoo@18cd93ded8

X-original-commit: 94d618ff3ff8ee13d23f893836d00a5a71981938
2021-02-05 17:51:32 +00:00
dht-odoo 66b0fede39 [IMP] crm: improve update of probabilities from settings
Right now there is a button in the CRM settings called 'Update Probabilities'.
When clicking on it probabilities of leads created after certain date
are updated. Problem with this flow is that user can click on the button by
mistake and there is no going back.

Moreover this does not trigger a save on settings and changes done by user
are not saved. This is standard behavior of config settings.

This commit improves the behavior by opening a wizard on click of the button
instead of directmy updating the probabilities. It allows users to change
fields used in PLS, change start date, or even cancel the update process.

Task ID-2355562

closes odoo/odoo#60733

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-02 16:19:41 +00:00
Michael Mattiello (mcm) 785b304876 [IMP] *: reduce shift in form views (xml)
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
  delivery, digest, event, event_crm, fleet, gamification, hr,
  hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
  mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
  purchase, purchase_requisition, sale_management, sales_team, sms,
  stock, stock_landed_costs, survey, website_crm_partner_assign,
  website_event_exhibitor, website_event_track, website_forum,
  website_slides, base

This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.

task 2330101
2021-02-02 12:40:22 +00:00
Sunil Shrimali d790b7e6a2 [IMP] crm*: allow sales user to access reporting for own documents
Right now, the 'CRM > Reporting' menu is accessible only to the sales
managers. However, we should let users of all access right levels to
see their reporting while making sure it does not give them access to
data that does not match their rights.

This commit thus changes group applied on 'CRM > Reporting' menu from
'sales_team.group_sale_manager' to 'sales_team.group_sale_salesman' so
that from sales person to manager, everyone is able to the reporting
based on their rights.

For the below sub-menus, record rules already exist, preventing data breach:
 - Dashboard (crm_enterprise)
 - Leads (crm)
 - Pipelines (crm)
 - Activities (crm)

However, for data under 'Partnership'(website_crm_partner_assign) and
'Lead Generation Views' sub-menus(crm_iap_lead_website), we introduced
the needed access rights / record rules to ensure basic users can only
see the data they have rights for.

TaskId - 2357311

closes odoo/odoo#64202

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-02 04:51:37 +00:00
Jérémy Hennecart 095e59c8b7 [IMP] crm: add tracking on recurring_revenue field
Add tracking on the recurring_revenue field like the expected
revenue.

odoo/odoo#61999
odoo/upgrade#2060
task-2387268
2021-02-01 16:18:36 +00:00
Thibault Delavallée 511a031db6 [UPD] crm: update counters to runbot peak
Some tests sometimes require some more queries to be finished.

Task ID-2444908

closes odoo/odoo#65379

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-02 07:54:48 +00:00
Munaf Khan dd3b58e2f3 [FIX] crm: add filter for overdue opportunities
With commit[1], we introduced a feature that from the sales team, we can
see the overdue opportunities for a particual teams. However, the filter
that we use for related action which is supposed to show overdue opportunities
is not not added, and the filtration is not working as expected, showing us
all the opportunites for a team.

This commit fixes the issue by adding the invisible filter with proper
domain set within opportunities' search view and thus enables us to
filter overdue opportunites.

commit[1] - https://github.com/odoo/odoo/commit/1da63f0ab0fb4212bee46f960c6bbe8ca9251cac

TaskID : 2323612

closes odoo/odoo#65258

X-original-commit: 68577d32c7fe0cb18ba4fb788cee65ec8b54b65b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-29 10:56:02 +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