Commit Graph
8535 Commits
Author SHA1 Message Date
Thibault Delavallée 75f23a6a89 [REF] phone_validation, various: remove phone.validation.mixin and inline it
PURPOSE

Remove complex or technical code adding few value.

RATIONALE

phone.validation.mixin is used in two models: crm.lead and res.partner. It only
add a phone_format method used in onchange. We can inline this code in those
two models and remove the whole mixin itself. It lessens inherit and class
complexity.

SPECIFICATIONS

Remove phone.validation.mixin. Inline code in crm.lead (CRM application)
and res.partner (phone validation module). Make phone_format private as
it is now some internal tool method on those two models.

Everything should behave as before this commit. No functional change is
intended.

LINKS

Task ID-2416789
COM PR odoo/odoo#63333
ENT PR odoo/enterprise#15296
UPG PR odoo/upgrade#2025

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-15 08:14:01 +00:00
Martin Trigaux ade40f9028 [I18n] *: export saas-14.1 source terms
closes odoo/odoo#64393

X-original-commit: eaf7ec38b2f13b044768ccb457c5523cd24753f6
Related: odoo/enterprise#15693
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 10:38:54 +00:00
Aurélien Warnon 1f73a652be [IMP] crm[_sms]: align crm list view with "My Activities" view
Some of the feature of the "My Activities" list view of the crm app were not
available on the regular crm tree view.

This commit aligns the 2 views by sharing these features, notably:
- You can "snooze" your next activity if there is one
- You can contact the lead by email with a direct button on the row/list header
- You can contact the lead by sms with a direct button on the row/list header

The "team_id" column is now optional="hide" since not required most of the time
when you go to check your own leads (and can be activated in a few clicks if
needed).

Finally, the "Email" action at the end of the tree row is now in "single" mode
to allow adding contacts on the fly. This implied re-introducing an action that
was recently removed in 8c65d7c5f7
Further demonstrating that R&D is just an eternal loop.

UPG PR odoo/upgrade#2064
Task-2390500

closes odoo/odoo#62289

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-08 10:10:27 +00:00
Achraf (abz)andThibault Delavallée f5adb5b25d [FIX] mail: send notification mail with right access link when using mail.thread
PURPOSE

Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.

HOW TO REPRODUCE

Issue

    - Install "Approvals"
    - Submit new approval with you as "Request Owner"
    - Click on "View Approval Request" in your mailbox

    The link redirects to a 505 error

Cause

    The model is not the correct one and the res_id is undefined

Solution

    Specify the model and the res_id to _notify_get_action_link
    when creating the link with kwargs

SPECIFICATIONS

Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.

Also limit values given as URL parameters to some white listed values.

LINKS

opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545
Closes odoo/odoo#63292
Closes odoo/enterprise#15585

closes odoo/odoo#64229

X-original-commit: 58bac5d242d6548d54f0163328fa64b319852e40
Related: odoo/enterprise#15634
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Achraf Ben Azzouz <abz@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2021-01-07 17:44:37 +00:00
Thibault Delavallée fff19019de [IMP] crm: make some internal methods private
PURPOSE

Prepare sales team membership and lead assignment improvements by
reorganizing and cleaning some code bits.

SPECIFICATIONS

Tools methods should be private by default to indicate those are not part of
official convert or merge API for leads. In this commit we make convert and
merge tool methods private, keeping only main API methods public.

LINKS

Task ID-2428882
Prepares Task ID-2086889
COM PR odoo/odoo#64196
ENT PT odoo/enterprise#15610
2021-01-07 11:16:28 +00:00
Thibault Delavallée 4819df905e [MOV] crm: reorganize convert / merge tool methods
PURPOSE

Prepare sales team membership and lead assignment improvements by
reorganizing and cleaning some code bits.

SPECIFICATIONS

Separate business methods from tool methods. It eases their discovering and
their re-use through various other methods and models. Moreover it helps
reading business oriented methods without being disturbed by tools.

LINKS

Task ID-2428882
Prepares Task ID-2086889
COM PR odoo/odoo#64196
ENT PT odoo/enterprise#15610
2021-01-07 11:15:47 +00:00
mir-odoo fc348de003 [IMP] various: Do not allow create/open on country_id
Purpose of the task, is to prevent users from inadvertently
creation/opening countries from country_id fields.
Countries should be managed from their dedicated menu item.

so in this commit, we have set both no_open and no_create to True
so user should not update and create a country from the many2X fields.

closes odoo/odoo#63773

Taskid: 2241677
Related: odoo/enterprise#15464
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-24 12:51:04 +00:00
Thibault Delavallée 1d86be9baa [FIX] crm: correctly handle won lost at create
Fix typo preventing a correct management of won/lost when creating
multiple leads in a row.

closes odoo/odoo#64149

X-original-commit: 0024b592b2d589138f34e27c724b8d471d213a4d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-06 12:24:37 +00:00
Thibault Delavallée 94de6b501b [IMP] crm: always hide alias left part when domain is not configured
When alias domain is not configured always display "Configure a custom
domain" link instead of an email having only a left-part or "Inactive
alias" if left part is void. This is already the case in edit mode but
not in read mode.

New specification is
  * domain is not configured: display link in both read and edit mode;
  * domain is configured and left part is set: display alias;
  * domain is configured and left part is not set: display "Inactive alias"
    in read and display alias name for edition in edit;

LINKS

Task ID-2414079
COM PR odoo/odoo#63160
UPG PR odoo/upgrade#2017
2021-01-05 11:15:28 +00:00
Thibault Delavallée 17aa8679a0 [IMP] crm: do not set environment user as responsible of leads created through gateway
PURPOSE

Remove the alias setting option because it is a weird and hackish way to
proceed. We would prefer users to configure their alias through sales teams.
Improve alias configuration on teams.

SPECIFICATIONS

We do not want to explicitly set an user as responsible when an incoming email
creates a lead or an opportunity. We prefer that assignment is done either
automatically (scoring) or manually.

Using environment user would lead to set either root (gateway user - already
prevented) either alias owner (through alias_user_id) either user sending
email if email_from matches. Doing it also allows to exclude portal / public
users that would send an email to the mailgateway.

LINKS

Task ID-2414079
COM PR odoo/odoo#63160
UPG PR odoo/upgrade#2017
2021-01-05 11:15:28 +00:00
Thibault Delavallée ebbece6d55 [IMP] crm: synchronize teams use_lead and alias with setting
PURPOSE

Remove the alias setting option because it is a weird and hackish way to
proceed. We would prefer users to configure their alias through sales teams.
Improve alias configuration on teams.

SPECIFICATIONS

When changing "use leads" from CRM settings automatically regenerate apply this
option to all sales teams using opportunities. When de-activating it no team
should have this option activated as menus and options are hidden. When
activating it we consider that all teams should be upgraded by default.

LINKS

Task ID-2414079
COM PR odoo/odoo#63160
UPG PR odoo/upgrade#2017
2021-01-05 11:15:27 +00:00
Thibault Delavallée 1ee68e6119 [REF] crm: remove global lead alias
PURPOSE

Remove the alias setting option because it is a weird and hackish way to
proceed. We would prefer users to configure their alias through sales teams.
Improve alias configuration on teams.

RATIONALE

"​Incoming Emails" option has many flaws

  * it creates collision when you try to set an alias that is already used
    and it is not easy to find them back;
  * it has no default value (no sales team, no type, ...) and works through the
    'owner' field. This is set with the admin on activation of the feature
    which is not correct.  The admin is potentially not a salesperson. If you
    set the field to blank, you get leads without team and without assigned
    responsible.
  * this alias is not team-bound which thus asks the question: in which team
    should the lead ever go? To the first team? Why?

All this make it seem way healthier to handle this through the Sales Team.
=> By default, we'll already have one working with an alias.

If users really want a global lead alias it can be setup manually through
alias menu in configuration. Shortcut and default alias in crm are removed
but feature is still doable if requested.

SPECIFICATIONS

Remove the s "Incoming emails" setting that allows to setup a global alias for
leads / opportunities with a default value being 'contact'. Also remove related
alias data as it has no use anymore.

LINKS

Task ID-2414079
Sort of follow-up of Task ID-2373095.
COM PR odoo/odoo#63160
UPG PR odoo/upgrade#2017
2021-01-05 11:15:27 +00:00
Anjali ecad945ef8 [FIX] crm: add missing default values for partner during quick create
This commit adds few missing default values for some of the partner
fields while we create partner on the fly with quick create kanban
card of lead. Below are the fields that we added

 * name
 * is_company
 * company_name
 * phone
 * email

Task ID-2409462

closes odoo/odoo#63622

X-original-commit: 5b3290b0869e3954ff1606ad0ca0a35cfd948698
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-21 09:45:36 +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
ijas ahammedandThibault Delavallée 0b6a2ee5fb [FIX] crm: do not propagate lead phone to partner if formatting differs
With a recent commit[1], we fixed the issue of false warning while changing
the partner on lead. But that fix ignored the fact that the lead has an
automatic formatting that may lead to false warning.

Right way to detect a phone number change is
  * lead phone is different from partner phone;
  * lead formatted phone is different from partner formatted phone;

If those two conditions are met we are quite sure numbers are different and
not only differs in their formatting.

In this commit we also fix inverse of phone number. When updating lead phone
value we have to use the same heuristic to update partner phone value. That
was we avoid unnecessary partner update when only formatting differs.

Tests are added to ensure new behavior and that ribbon message is effectively
trig erred with correct content.

LINKS

Task ID-2390287

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

closes odoo/odoo#63521

X-original-commit: 5154f40544e7913f7bcd0ff73f034d111700f580
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Ijas Ahammed <ija@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-12-17 11:32:52 +00:00
Aurélien Warnon dd06e081b1 [FIX] web, crm: fix rainbowman when lead is marked as "won"
When you mark an crm.lead as "won" using the "mark as won" button, the user
will be shown a rainbowman under certain conditions. This happens notably
when you win your first lead.

This commit fixes the 'ir.actions.act_window_close' model to allow the
'effect' key within its readable fields (even if it's not a real field) which
is in turn picked up by the web client to display the infamous rainbowman.

At the same time, we add the tour that is testing the rainbowman of the crm app
in the test suite, since it was missing and never actually executed by the CI.
Some fixes were also necessary to make the test run properly.

Task ID-2394745

closes odoo/odoo#63259

X-original-commit: 47079f67f586adf45da15fc98dbc81571f7a9100
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-12-11 15:47:33 +00:00
Thibault Delavallée 36c78e3e3a [FIX] crm: keep order of lead ids when mass converting
Purpose of this commit is to avoid the use of sets in convert wizard. This set
is used to compute ids of leads to merge and to convert. Using a set make order
impossible to predict. Using lists allows to have reproducible tests notably.

Spotted when working on task ID-2086889
2020-12-01 11:17:34 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Thibault Delavallée 8c65d7c5f7 [IMP] crm: remove default blank template used in contextual actions
Crm holds a blank template that adds no real value. Its purpose was to
give a base for salesmen to perform a mass mailing on leads. Using a template
and its action menu entry it was possible to launch a mail composer in
mass mail mode on leads.

However template itself is not necessary. Same goal can be achieved with
a standard action. As template was blank and creating noise we can remove
it and simplify available templates.

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:09 +00:00
Thibault Delavallée 80e1987869 [MOV][IMP] crm(_partner_assign): reorganize qweb / jinja templates used for mailing
PURPOSE

Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.

SPECIFICATIONS

  * move those templates in their own file to ease their discovering and
    maintenance;
  * put them into data (as those are not views even if it contains qweb)
  * guidelines are now :

    -> Qweb templates should be in data/mail_templates.xml;
    -> mail.template records should be in data/mail_template_data.xml;

  * put their declaration in no update when not done if template has no
    technical code or complex dependency on underlying code;
  * move found mail data (mail.message.subtype or mail.activity.type) records
    in a mail_data file that should contain only "core" records linked to mail;

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:14 +00:00
Aurélien Warnon dd7b327eb5 [FW][FIX] crm: change default 'crm_alias_prefix' to 'contact'
This commit changes the default crm alias prefix from 'info' to 'contact'.

As the alias of the default sales team is configured to 'info', also having
'info' for the "crm_alias_prefix" setting was leading to an alias collision.

This change allows an easier configuration by the end user and avoids confusion
when first playing with your CRM settings.

Task 2373095

closes odoo/odoo#62025

X-original-commit: 31497e17e2369147fa40ab8b3f82cb2602ec9012
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-11-19 14:51:49 +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
Nicolas Lempereur 35809389a6 [FIX] crm: show newly created meetings in calendar
When clicking on the stat button "Meetings" on a contact:

- before dac91bc18 (November 2019): only meetings with participant
  matching contact name are shown

- after dac91bc18 (November 2019): all meetings are shown => this was
  because the view was used to create new meeting, so it makes sense to
  see other meetings and not have a conflict.

- after 16206d72 (August 2020): only meeting of the contact are shown

- after 7449c8a6 and d11fb611 (November 2020): more complicated logic
  that will also show partner events, and child partner events.

Since August 2020, when you create a new event, since we are showing a
list of IDs at the time the button was clicked, the new event will not
appear unless you go back to the contact, then click on "Meetings" anew.

With this changeset, we still show a list of IDs, but add an alternative
to also show the events of the current partner (that should be in the
list of IDs, but will match new events).

opw-2374021
closes #61490

closes odoo/odoo#61690

X-original-commit: eb6e03908bfb6ed8bbe231da2a4422ec2e149834
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-11-12 17:41:06 +00:00
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
mir-odoo e9638fd3ae [IMP] crm,purchase: Improve the reporting menu
Pupose of the task is, to set up a dedicated 'dashboard' reporting menu
item, and make the graph view the default the other 'leads' and
'opportunities' reporting menus.

So in this commit, change the default view graph in normal report
(except dashbaord menu) and each menu should be submenu of reporting
menu Also apply default filter for lead reporting menu

TaskID: 2311392
Related Enterprise: https://github.com/odoo/enterprise/pull/12419

closes odoo/odoo#55598

Closes: #55598
Related: odoo/enterprise#12419
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-05 11:00:27 +00:00
std-odoo 5680d52ff8 [IMP] mail: make the "activity_state" field searchable
Purpose
=======
Make the "activity_state" searchable on the "mail.activity" mixin.
This field is not stored as it depends on the current time.

Technical
=========
To make the search, we perform a SQL query.

The "activity_state" depends on the state of each activities on the
record. And this state also depends on the timezone of the user of
the activity. That's what made things tricky and we need to make the
conversion in SQL for performance purpose (we can not fetch all records
and compute them in python).

There's a special case, where there's less than 24 hours between the
deadline and the current time but one day of difference. In that case
the state should be "planned" and not "today". This case is handle by
the function "DATE_TRUNC" (e.g. 23h 01/01/2020 & 1h 02/02/2020).

Also for performance purpose, we compute the delay only once and we use
the function "SIGN" so we can use a switch/case instead of duplicating
3 times the expressions.

Task 2354754

closes odoo/odoo#60074

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-06 07:31:12 +00:00
Jérémy Hennecart 054fb95d73 [IMP] crm: remove default PLS fields
The purpose is to ease the onboarding for the default CRM settings.
Now, we do not include any field by default and tags become an option
in the choice of fields apply to the computation.

task-2196200

closes odoo/odoo#48124

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-05 11:07:11 +00:00
Pedro (pno) a0ebb46098 [FIX] {base, coupon, crm, event, mass_mailing, product, project, sales_team, utm, web}: prevent long texts from overflowing
Previously, in multiple modules, long names would result in an overflow of text.
With this commit long texts should appear like this: [aaaaa...] instead of
going out of their boxes.

Various views are updated, depending on which fields we wanted to prevent
from overflowing and the probability they do so.

Task ID-2325219
PR odoo/odoo#57713
PR odoo/enterprise#13226

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-04 07:32:27 +00:00
Jérémy Hennecart 16908e9eac [FIX] crm: correctly recompute dynamic depends when emptying crm.pls_fields config parameter
When we clear the configuration parameter crm.pls_fields unlink method is
called. In order to have a correct dynamic compute based on this parameter
we need to re-evaluate the depends. This is done by overriding unlink of
ir.config_parameter, like already done at create and write.

Task-2196200

closes odoo/odoo#61293

X-original-commit: d04cc4df4ec28816aeb6d1d7c7fc0e547fd13fa5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-11-03 16:43:37 +00:00
IEL 3c7694b409 [FIX] *: fix image parsing error on saving res config
WHAT: apply 93a7695f65baf00d1f82481d6a2a97e6c11940a8 for all res.config.settings
menus

WHY: the same reason as in 93a7695f65baf00d1f82481d6a2a97e6c11940a8:

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

it may lead to image dissapearing or "Incorrect padding" error

HOW:

    find . -iname "*.xml"|xargs grep "\"context\".*'module'" -l | xargs sed -i "s/\(\"context\".*'module'.*\)\}/\1, 'bin_size': False}/"
    git checkout  -- addons/base_setup/views/res_config_settings_views.xml

---

PR for General Settings: https://github.com/odoo/odoo/pull/47297

opw-2346644

closes odoo/odoo#61215

X-original-commit: 7c55efa88b72bd1f3f0f32f7f738e2fda5aa4abd
Related: odoo/enterprise#14547
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 18:25:20 +00:00
Goffin Simon 16d9ca17fc [FIX] crm: Opportunity Smart Button Incorrect Value
Steps to reproduce the bug:

- Let's consider a company contact C with two children CH1 and CH2
- Create an opportunity for CH1 and a subscription for CH2

Bug:

The count of opportunities in C was displaying 0 instead of 2

opw:237344

X-original-commit: d11fb611fed3a8541d03b7d3e49973ae7c16a768
2020-11-02 14:04:25 +00:00
Goffin Simonandnim-odoo 8ffac3464c [FIX] crm: Smart button for meetings not working
Steps to reproduce the bug:

- Let's consider a company contact C with two children CH1 and CH2
- Create a meeting for CH1 and a meeting for CH2

Bug:

The count of meetings in C was displaying 0 instead of 2

PS: set() is used to avoid to count several times the same event for a partner.

If for example CH1 and CH2 attend to the same event, only one event must be counted for the
parent C

opw:2360155

X-original-commit: 7449c8a6643477742616bf236f2f2c90aec68581
Co-authored-by: nim-odoo <nim@odoo.com>
2020-11-02 14:04:25 +00:00
Nicolas Martinelli e4cd2e45ca [FIX] crm: mark as lost
The 'Mark as lost' server action raises an AccessError when executed by
a non administrator.

Due to de4213b771

opw-2371490

closes odoo/odoo#60866

X-original-commit: b80e44bac5de3ccffad42917307bb5f049a7bec6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-27 18:42:46 +00:00
Dharmraj Jhala 6d757f5a69 [IMP] crm : re-organize crm settings
PURPOSE

Improve ui in CRM settings to ease user understanding and using settings.

SPECIFICATIONS

This commit re-organizes some crm related settings groups for better
usability by interchanging their positions and by putting related
groups together.

Crm PLS warning improvement: https://tinyurl.com/y67ug3fr
  * Reword PLS explanation and button (followup of 9a57a7edfb)

Settings cleanup: https://tinyurl.com/y5lwqwe6
  * Move "Leads" option on the right, next to Recurring revenues;
  * Move "Incoming Emails" below "Leads";
  * Switch "Visits to Leads" and "Outlook CRM Extension";

LINKS

TaskID - 2351582

closes odoo/odoo#60264

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-27 10:50:38 +00:00
Dharmraj Jhala 9a57a7edfb [IMP] crm : improve crm settings usability
This commit fixes few of the strings / layout for the settings related
to CRM and makes it less technical and thus more understandable and
also updates the required translation strings.

TaskID - 2351582

closes odoo/odoo#60790

X-original-commit: 55b05ed5e2cf083ac1e6d807d59e5533f4fb94b6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-27 08:48:01 +00:00
Swapnesh Shah b07f2d31d2 [FIX] *: update document links
Before this commit, links to the documentation were referenced the
previous version, 13.0, instead of the current one, 14.0.

Eventhough there is a redirection done by NGINX of a "versionless" URL
to the latest one (e.g. /documentation/user/general/auth/google.html
-> /documentation/user/14.0/general/auth/google.html as of today), the
goal is to keep links owrking for users that will still be using the
14.0 in three years (and should not endup on the 17.0 doc).

closes odoo/odoo#60228

X-original-commit: 7ac08486d91d0ff0151abeeda057ffa6beda72e8
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-19 07:03:01 +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 aaa1f6c237 [FIX] crm: update 'Default Values' on alias while updating sales team
Whenever when change the 'Leads' of 'Pipeline' boolean field on sales team,
it should also update the linked alias. Mainly, if 'Lead' is checked, the
'Default Values' on the alias should also be updated.

It used to work before a recent refactoring (see commit [1] and [2] for more
information).

This commit adapts the changes done in refacotring and updates the alias values
while updating the sales team.

[1] - https://github.com/odoo/odoo/commit/7cfd364db54e88970ef51c798df3bd4df44222b3
[2] - https://github.com/odoo/odoo/commit/186cfb5ebd35d572d0f635cd7975de7cff0d1055

TaskId - 2357573

closes odoo/odoo#60008

X-original-commit: 0669ee36e195e8e0f98131219b59fcc5cba4cea7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 14:26:57 +00:00
Thibault Francois 6ce289606f [FIX] crm: don't bypass access right to find partner:
Problem
-------

Sales people can have restriction on partner they can see
Private addresses, multi company, ....

When they convert a lead to opportunity, it's currently possible
that the wizard will find and link a partner that the current user
cannot see.

Solution
--------
Field that are now computed store field, that were previously
normal field with onchange, should not be computed as sudo
to respect the record rule

closes odoo/odoo#59957

X-original-commit: 182fa38d7f28a92e7171c4ee3a42c8f73217b765
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 09:47:12 +00:00
Thibault Delavallée bb2cd89f00 [FIX] crm: fix query counters due to some runbot errors
To investigate a bit. Sometimes a few extra queries are generated.

Task ID-2359847

closes odoo/odoo#59869

X-original-commit: 36bb56a5e9704c76e84960ec84588524b52406f8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 13:59:03 +00:00
Aurélien Warnon 7287f36a1f [FIX] crm: fix mail extension module documentation URL
The URL to the mail extension module documentation in the settings view is
currently wrong.
It only works temporarily because of a redirect we setup on our website.

This commit updates the URL to the proper location of the documentation.

When we later support Gmail, the view will have to be updated to contain two
documentation links: one to Outlook and one to Gmail.

Task 2356910

closes odoo/odoo#59503

X-original-commit: 3968cfebfabcf34f800203d880c4a719c0f1174c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-08 11:46:42 +00:00
Thibault Delavallée c5a7b1f8a6 [IMP] crm: improve handle_salesmen_assignment performances
Handle salesmen allows to assign responsible to leads using a round robin like
algorithm. Currently a write on each lead is done to update its team and
responsible, even if number of leads is far greater than number of available
users to assign.

Current implementation can be simplified by doing one write per sales person
to assign on its batch of leads, or a single write if no salesmen has to be
assigned.

Performance counter on a mass convert wizard on 50 leads show that we gain
about 9% of queries (125 on 1471) with this simple optimization.

Task ID-2351604
PR #59084

closes odoo/odoo#59324

X-original-commit: 973a2998666813ca4fbe90f1b486c1b18091c4e7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-06 17:38:01 +00:00
Thibault Delavallée 9a22e636f9 [IMP] crm: move and add some test for lead user assign
Purpose of this commit is to

  * move tests about mass management of leads (mass assignment + mass convert
    wizards) in its own file to ease writing of tests;
  * add some performance tests :

   * performance for assignment;
   * performance for convert wizard in mass mode;

Task ID-2351604
PR #59084

X-original-commit: 950dd491bc4b680e0bcfab83815313e909a3c282
2020-10-06 17:38:00 +00:00
Thibault Delavallée 624f9f1a77 [FIX] crm: fix checking duplicates on dummy emails
Currently when trying to find duplicates of a lead with an email that
cannot be normalized and without partner, a crash appears as there is
no domain part to form a valid domain.

Fix it by returning a void set if no valid email and no valid partner
is set on the lead as we cannot determine any duplicate based on void
information.

closes odoo/odoo#59147

X-original-commit: 291db77cf09c6ee76373fd168f575fda28270467
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-05 16:25:08 +00:00
Martin Trigaux e79531c136 [I18N] *: export 14.0 source terms
Including demo data this time

closes odoo/odoo#58862

X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-29 17:52:02 +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
asa-odooandD J 9e647230a3 [IMP] crm: display avatar for user_id
This commit improves the salesperson(user_id) field with many2one_avatar_user
widget that will display avatar before user name.

Task Id : 2302572
PR #565013

closes odoo/odoo#58781

X-original-commit: ec05118e85d7e3d4611c5688f3c4a572c86d0afa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: D J <dja@odoo.com>
2020-09-29 10:28:18 +00:00
Jérémy Hennecart 24fddf6e9f [FIX] crm: fix redundancy of action menu
Fix the redundancy of "Send email" menu on the crm.lead model. We now correctly
have a form action in comment mode, and a list action in mass mail mode.

We also update the use of those actions according to the business flow: form
based from a single record, mass mail from a batch of records.

Task ID-2310462

Somehow forward-port of X-Original-Commit: odoo/odoo@9ded57d87f

closes odoo/odoo#58774

X-original-commit: ad7d28ab1abe484102cd3ec18ee6ce9c9ac7b5bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-09-29 09:40:32 +00:00
Aurélien (avd) db76ed28cd [FIX] crm: correctly set default_partner_id when creating opportunities from contact form view
This commit fixes a missing default_partner_id in context of 'Opportunities'
stat button on contact form. It allows to immediately link a new opportunity
to the contact we came from.

Task ID-2343221

closes odoo/odoo#58722

X-original-commit: 77d4ba222630fa0f97351186782d09d2ec59a42a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-09-28 16:45:14 +00:00