Commit Graph
5 Commits
Author SHA1 Message Date
Victor FeyensandThibault Delavallée 8194093f80 [IMP] crm(_*): improve compute in batch and remove unnecessary defaults
Purpose of this commit is to clean field definitions by

  * doing compute in batch: especially when the loop can be reduced to a single
    computation / batch assignment (based on groups or config parameter for
    example);
  * remove default when having a compute as computes should completely define
    the field value at any time;

Some side dish code cleaning is performed at the same time: unnecessary
import or dead code removal.

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:02 +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
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
qmo-odoo 66ce1e6302 [IMP] crm: use only one field for leads/opportunities count
Prior to this commit, two fields were used for lead and opportunities
count.

As both of these fields were set with the same values and only existed
for labelling purposes, this commit replaces them by a single field
and handles the the labels in the xml.

LINKS:

TaskID: 2086863
PR: #38707
2020-01-15 10:02:35 +00:00
qmo-odoo f49d83f07d [IMP] utm, crm: add lead/opportunity stats on campaign
PURPOSE

This commit removes the mass_mailing.campaign model. Instead of having a fully
fledged model, we will simply inherit utm.campaign. We will also add relevant
statistics on utm campaign model in order to use it in various applications.

SPECIFICATIONS

This commit adds leads/generated statistics in the kanban and
the form view of the utm campaign.

Kanban and form views will now display the number of leads and
opportunities generated with the campaign

TaskID: 2002029
PR: #34452
2019-08-02 12:33:42 +00:00