Commit Graph
24 Commits
Author SHA1 Message Date
Fabio Barbero 65bb3a5710 [IMP] crm: set opportunity language to contact's lang
Purpose
=======

When creating an opportunity, set the language of the Lead/Opportunity
to the partner's language if it is set instead of leaving it blank.

Also update tests to correctly test lang propagation.

Update event_crm so that lang of lead from registration is directly set
to False when there is no partner. Indeed we have no clue which lang we
should set and we can skip the field computation that otherwise triggers
some additional queries.

Task-2709436

Part-of: odoo/odoo#81028
2021-12-24 14:57:02 +00:00
Thibault Delavallée db19463f25 [REF] event(_*): clean tests common files
Purpose is to have a common event class for users and useful stuff (customers,
products, ...) but lessen usage of common test data through sub modules.
Indeed having a "global event type" test data updated in various addons is
actually complicated to maintain.

Sub add-ons are updated to use mainly the ``EventCase`` test class holding
users and side data. Data specific to those modules (event type with some
specific configuration notably) is created and used in tests in the given
module only, and not through generic event_type_complex and event_0 test
data anymore.

With this commit tests are more localized to their add-on and modifying data
in a given add-on has less chances to have unwanted side effect in other event
submodules unit tests.

Task-2703285 (Event performance improvements)
Task-2703289 (Event testing and coverage)

Part-of: odoo/odoo#81068
2021-12-16 17:33:47 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
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
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Thibault DelavalléeandVictor Feyens 2f4d582a79 [IMP] event(_*): limit usage of search
Purpose of this commit is to globally improve code performance by limiting
search impact by

  * adding limits when only first found record id used;
  * avoid unnecessary searches when record set can be filtered instead;

Task-2638444
PR odoo/odoo#76005

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
2021-09-08 07:56:03 +00:00
Ravi Thakkar 2e8fa03095 [IMP] event_*: re-arrange stat buttons on the event form view
This commit improves the view inheritance priority and xpaths for
the inherited form views of event to arrange the stat buttons in
logical manner, regardless of installation order of the modules.
The stat button order should always be:

- Attendees
- Leads
- Sales
- Tracks
- Sponsors
- Rooms

Task-2585998
EnterprisePR-https://github.com/odoo/enterprise/pull/20082

closes odoo/odoo#74203

Related: odoo/enterprise#20082
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-03 09:26:01 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Fabien Pinckaers a65f6a5872 [IMP] various: clean most urls to odoo's website
Pages changed on odoo.com so let's update links.

closes odoo/odoo#72707

Related: odoo/enterprise#19239
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 15:14:29 +00:00
Thibault Delavallée c24ccef4fc [IMP] crm: better handle team deletion
PURPOSE

Make crm.team deletion effect explicit on main models (excluding wizards
or reports). Purpose is to ensure deleting a crm team has known side
effets.

SPECIFICATIONS

M2O on crm.team set to CASCADE

  * crm.lead.scoring.frequency: as we remove the team no need to keep the
    PLS data -> change to "cascade";
  * crm.team.member: when removing a team, remove its members as it prevents
    from unlinking the team;

M2O on crm.team set to SET NULL

  * account.move: void team_id field but track it to keep history;
  * crm.lead: void team_id field as it will be taken back into assign
    process (either manual or automatic), and will therefore be managed
    by other sales persons. In case of archived / lost leads setting to
    void has no real issue;
  * crm.stage: void team_id and set stage as shared to avoid loosing stage
    information for existing leads in that stage;
  * res.partner: void team_id taking care of this customer as this field
    is mainly informative anyway;
  * crm.iap.lead.mining.request: void team_id as it only impacts generated
    leads. Those will be created with a void team which is ok;
  * crm.reveal.rule: void team_id as it only impacts generated leads. Those
    will be created with a void team which is ok;
  * event.lead.rule: void lead_sales_team_id as this impact generated leads.
    Those will be created with a void team which is ok;
  * pos.config and pos.oser: void crm_team_id field. It is optional as it is
    not a core field of this model. Pos configurations and orders are still
    valid without team assigned on it;
  * sale.order: void team_id field but track it to keep history;
  * website: void salesteam_id field;

Prevent unlink when having more than 5 SO not canceled. If more than 5 active
SOs in the team, we consider this team to be actively used. 5 is some random
guess based on "user testing", aka more than testing CRM feature and less
than use it in real life use cases.

LINKS

Task ID-2507750
COM PR odoo/odoo#70645
ENT PR odoo/enterprise#18266
2021-06-23 08:36:18 +00:00
dht-odoo 586ae4bcc4 [IMP] crm: improves description field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) crm.lead -> description
2) event.event -> note

Task Id: 2499504

X-original-commit: 524e2f089a611d897b98d86001bda5d17263db66
2021-06-07 05:24:08 +00:00
Anjali a99d882c02 [IMP] crm,*_crm: better merge leads side documents
Purpose of this commit is to ensure side documents are redirected to the
master opportunity when merging leads. Those side documents include

  * communication history (mail.message);
  * attachments (ir.attachment);
  * visitors (website.visitor);

However some documents are currently not specifically handled :

  * meetings (calendar.event);
  * activities (mail.activity);
  * sale orders (sale.order);
  * attendees (event.registration);

In this commit we ensure all are attached to the final master opportunity.
That way we prevent loosing access to those documents and ensure we keep
the complete history of all merged leads.

Also tests are added to ensure the merging of leads and its contents.

A new field is added to have the o2m field between leads and calendar events.
In order to clarify naming, ``meeting_count`` is renamed to
``calendar_event_count`` to match naming.

Task Id-2457941
COM PR odoo/odoo#68884
UPG PR odoo/odoo#2494

Related: odoo/upgrade#2494
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-28 12:12:51 +00:00
Thibault Francois 3f232cb6e9 [FIX] event_crm: fix False - False lead creation
Use Case
--------
Have two (or more) rules with mutually exclusive domain for that can be
apply on the same event with lead_creation_basis = order

Create a registration that match one of the rule

Problem
-------
The lead for this rule is created properly but there is also
another lead with the name False - False that is created for the second
rule for which the registration does not match the filter

Solution
--------

Create a lead only when there is a non empty record set in the
registration group

closes odoo/odoo#70590

X-original-commit: 43fc8dac5e21a9aecf7b2950a6c3c77d8142ee45
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-10 10:37:40 +00:00
std-odoo e0c2a8a2cc [IMP] event_*: clean ACL and add a new group "Registration Desk"
Purpose
=======

Clean the ACLs related to the Event application.

Add a new group to manage the registration in the entrance of an event. This
group should not be able to modify or remove records in Event but should be
able to create and manage the registrations.

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

Now, there are 3 event groups

  * ``Registration Desk User``, who can manage the registrations and
    read all event-related information;
  * ``Event User`` who can create event, sponsor, ticket... His role is
    to globally handle events on a day-to-day basis;
  * ``Event Administrator`` who can create event type, sponsor type,
    ticket type... His role is to manage the way events are managed withint
    its company:

Each group implies all previous groups.

Compared to previous event users gain a lot of rules, allowing to update
records like tickets, registrations, ... Low-end event users should now
use the registration desk group.

Links
=====

Task ID-2204364
COM odoo/odoo#57022
ENT odoo/enterprise#13984
UPG odoo/upgrade#1897
2021-04-02 13:40:50 +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
nie 3e1cea4373 [FIX] event_crm: prevent access rights issues on leads
Steps:
- Login as an admin user
- On a fresh branch install event_crm
- Give a "test" user access rights of "Own Document only" in the "Sales"
  app, nothing in "Events"
- Assign any lead to "test" user
- Login as "test" user and try to access your own leads

Bug:
Error: While parsing modifiers for button: for modifier "invisible":
Unknown field registration_count in domain

Explanation:
The button `event_registration_action_from_lead` tries to access event
registrations even if the user doesn't have access to events.

opw:2462127

closes odoo/odoo#66599

X-original-commit: 29be97615554337591f0b31ba34942c2d728cbef
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-22 12:17:07 +00:00
std-odoo d1125288e2 [REF] event_*: clean the ACLs files to be consistent in all sub-modules
Purpose
=======
In event, many files have different naming format. We want to clean
them, to group the lines by models before changing and adding a new
event group.

Task 2204364
PR odoo/odoo/pull/65867
Migration odoo/upgrade/pull/2150
2021-02-10 14:07:46 +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
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
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
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Thibault Delavallée baa4a73be0 [IMP] event_crm: avoid running rules in import mode
Purpose of this commit is to avoid running lead creation rules when importing
registration data. Indeed import is used to bootstrap databases and/or to
update records in batch. As those are not necessarily "new" customer
information creating leads on this information adds more noise than real
utility. Moreover import can run on huge batch of records and lead creation
imply some computation that would slowdown import process.

LINKS

Task ID 2166679
PR #52334
Upgrade PR odoo/upgrade#1292
2020-06-10 16:10:28 +00:00
Jérémy HennecartandThibault Delavallée 76129e3b44 [ADD] event_crm: create leads from attendees
PURPOSE

Introduce an automated tool to create leads from event registrations. Events
are a powerful source of leads as they attract attention. This leads to leads
with good quality as they mark interest while gathering contact information
which allows to follow-up.

This merge aims at automating this process by automatically creating leads
based on user-defined rules.

SPECIFICATIONS

Add a new module event_crm. It allows to create leads automatically based on
event registrations. This is done based on rules defined in a new model
event_lead_rule.

Add a new menu "Lead Generation" in the configuration tab of an event. It
allows to create generation rules. Those are a set of conditions to generate
a lead with some pre-filled values as the type of lead, tags or salesperson.

SPECIFICATIONS: CREATION TYPE

There are two types of lead creation:

  * per attendee: create a lead for each registration;
  * per order: create a lead for a group of registrations;

The last one is only available through interface if it is possible to register
a group of attendees in one action (when event_sale or website_event are
installed). Behavior itself is implemented directly in event_crm.

Basically a group is either a list of registrations belonging to the same
event and created in batch (website_event flow). With event_sale this
definition will be improved to be based on sale_order.

SPECIFICATIONS: CREATION TRIGGERS

There are three options to trigger lead creation. We consider basically that
lead quality increases if attendees confirmed or went to the event. Triggers
allow therefore to run rules:

  * at attendee creation;
  * at attendee confirmation;
  * at attendee venue;

This trigger defines when the rule will run.

SPECIFICATIONS: FILTERING REGISTRATIONS

When a batch of registrations matches the rule trigger we filter them based
on conditions and rules defines on event_lead_rule model. Heuristic is the
following:

  * the rule is active;
  * if a filter is set: filter registrations based on this filter. This is
    done like a search, and filter is a domain;
  * if a company is set on the rule, it must match event's company. Note
    that multi-company rules apply on event_lead_rule;
  * if an event category is set, it must match;
  * if an event is set, it must match;
  * if both event and category are set, one of them must match (OR). If none
    of those are set, it is considered as passing;

If conditions are met, leads are created with pre-filled informations defined
on the rule (type, user_id, team_id). Contact information coming from the
registrations are computed (customer, name, email, phone, mobile, contact_name).

SPECIFICATIONS: OTHER POINTS

Note that all rules matching their conditions are applied. This means more
than one lead can be created depending on the configuration. This is
intended in order to give more freedom to the user using the automatic
lead generation.

Once a lead is created for an event registration, a stat button on the event
is available to show the number of leads generated for this event and to
be able to find them in one click.

Additionally on the lead form, a stat button will be display to show the
registrations linked to this lead. On registrations a stat button is also
displayed to find the leads created from it or from its group.

Most of code has been written to run in batch, in case multiples rules have
to run on a set of new registrations. Tests are added to ensure behavior.

LINKS

Task ID 2166679
PR #52334
Upgrade PR odoo/upgrade#1292

Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-06-10 16:10:28 +00:00