Commit Graph
12 Commits
Author SHA1 Message Date
b415533dca [REF] crm(_iap_lead): use read_group instead of computing len of one2many fields
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

No functional change, only technical performance improvements.

Purpose is to improve lead_count performance. Some people claim to gain a lot
of queries: from 90 to 30 SQL queries to read 39 partners. Hard to reproduce.

LINKS

Task ID 2196182
PR odoo/odoo#44662

Co-Authored-By: Fabien Pinckaers <fp@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2020-04-21 12:28:52 +00:00
Thibault Delavallée 623567eba0 [LNT] crm: lint calendar file
Just passing by.

Task ID 2196182
PR #44662
2020-04-21 12:28:52 +00:00
Lucas Lefèvre f2b6918649 [REF] calendar, crm: Create events in batch
Task 2126717
PR #42031
PR Enterprise odoo/enterprise#8006
2020-04-09 10:59:33 +02:00
jvm-odoo e5adee2e7d [FIX] crm: fix lead/opportunity meeting scheduling
Reproduce the issue:
 - In the CRM app, create a lead/opportunity.
 - Schedule a meeting for this opportunity via
   the chatter and click on create.
 - Go back, the "Meeting" stat button is now at 1
 - Schedule a meeting for this opportunity via
   the chatter and click on edit then create.
 - Go back, the "Meeting" stat button is still at 1

Cause:
When we click directly on create, the opportunity ID is in the defaults
option but when we click on edit, there is no opportunity ID.

So, this commit use the context to retrieve the concerned opportunity
and set it if it is not already set.

I splitted the solution into a private method for a better readability.

OPW-2092920

closes odoo/odoo#39964

X-original-commit: 59d154dcc1524c8f08c6a1e7aee18c722ab2e0ad
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-07 13:05:34 +00:00
Jérome Maes 013fbb109a [FIX] crm: avoid crash when creating activity
When creating an acitivity generating a calendar event, if
the model is not crm.lead (ex: sale.order), the default_get
will crash since no value for res_model_id is given.
2017-09-29 13:03:27 +02:00
Thibault Delavallée a7b5d2819d [FIX] crm: fix dict access
Ensure key is present before taking its value in the defaults dict.
2017-09-29 10:59:59 +02:00
Thibault Delavallée 3ce680ac19 [FIX] crm, hr_recruitment: better compute default values for calendar event
* fix issue with ref not using module as xml id left part;
 * improve computation of applicant_id / res_model + res_id in hr_recruitment;
2017-09-08 10:14:23 +02:00
Akash Bhavsar 9568b1525b [IMP] mail, calendar: integrate meeting activities with calendar
This commit improves the use of mail activities by allowing their
integration with the calendar. Activity types now have a category
field that can be used to trigger some specific behavior. First
specific behavior is to have activity types of meeting category.
Creating activities of this type trigger a jump to the calendar to
schedule the meeting. Meeting activities and calender events are
linked to be able to easily navigate through the document, its activities
and its meetings.

Configuration is done using a category on activity types instead of some
hardcoded "meeting" activity to avoid issues with master data and to be
able to choose which activity type should trigger this behavior.
2017-09-07 17:55:57 +02:00
Akash Bhavsar be23a75c0e [IMP] calendar: add generic res_id and res_model_id to link documents and events
Linking calendar.event to documents is a good idea to allow searching and
filtering meetings. It also allow to have a link to the document from a
meeting and ease navigation.

There are currently some specific links (opportunity_id for crm.lead and
applicant_id for hr.applicant) but this commit allows some generic
document linking through a res_model_id / res_id fields pair.
2017-09-07 17:55:57 +02:00
Rohan Patel 9807547688 [IMP] calendar: add highlighting in dependant modules
Now, calendar event relative to a document (ex:
crm.lead, hr.applicant) are highlighted when
comming from there form view. The mecanism consist
in override the method of the computed field
'is_highlighted'.
2016-11-07 16:08:24 +01:00
Ravi Gohil aa44700dcc [MIG] crm : migration to new API
Also adapt code in crm_partner_assign according to migration of crm.lead
2016-07-04 17:28:04 +02:00
Jérome Maes fa7fdc525a [MOV] crm : reoganize module directory and files 2016-07-04 17:28:03 +02:00