If a view is present multiple times in the same module, the "last
instance" is going to win (by replacing any previous instance's arch
with its own).
Most cases of duplications are probably views which got moved then
either not removed (from the original location) or revived (through a
forward-port), the first instance can just be removed entirely.
For the few which seemed to be more than just trivial mistakes, merge
the two views instead.
closesodoo/odoo#44463
Related: odoo/enterprise#8107
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When simply need to parse a domain, it is easier
Add .strip() on ir.ui.view as ast.literal_eval produces an syntax
error if the node starts with spaces (as done in the xpath of
hr_attendance.view_employee_form_inherit_hr_attendance)
closesodoo/odoo#43831
Related: odoo/enterprise#7894
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit improves overall usability for lost reason wizard in CRM with
following improvements
* prevent deletion of reason if any lead is still referencing it;
* remove obsolete filter 'Include archived' for lost reason;
* add new stat button for lost reason, to see the leads that were lost
due to that particular reason;
* add margin on the reason title to avoid ribbon glitch;
TaskID 2176323
PR #43541
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this task is to change the color of Tags field in tree view in the
same way as it show in form view.
TaskId : 2172123
closesodoo/odoo#43442
Closes: odoo#43442
Related: odoo/enterprise#7769
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Probably coming from a conflict / rebase / forward port. Or several of those
keywords.
LINKS
Task ID 2180521 (add tests for crm wizards)
Task ID 2056759 (remove crm.partner.binding mixin)
Task ID 2088565 (crm onchange -> compute)
Community PR odoo/odoo#43473
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
As crm will soon evolve (onchange -> compute, code improvements, better
management of sales teams) cleaning and improving tests is necessary to avoid
regressions.
SPECIFICATIONS
This wizard has no tests at all. Even if it not really complex it is better
to have some tests ensuring at least marking a lead as lost with a reason
correctly updates it.
LINKS
Task ID 2180521 (add tests for crm wizards)
Task ID 2056759 (remove crm.partner.binding mixin)
Task ID 2088565 (crm onchange -> compute)
Community PR odoo/odoo#43473
PURPOSE
As crm will soon evolve (onchange -> compute, code improvements, better
management of sales teams) cleaning and improving tests is necessary to avoid
regressions.
SPECIFICATIONS
Improve and clean tests about leads and opportunities merge.
Some strange behaviors spotted :
* user_id / team_id interaction is somehow unclear;
* probability is not taken into account in confidence level, which is very
very strange;
LINKS
Task ID 2180521 (add tests for crm wizards)
Task ID 2056759 (remove crm.partner.binding mixin)
Task ID 2088565 (crm onchange -> compute)
Community PR odoo/odoo#43473
PURPOSE
As crm will soon evolve (onchange -> compute, code improvements, better
management of sales teams) cleaning and improving tests is necessary to avoid
regressions.
SPECIFICATIONS
After ff6b35f759 that added some first tests, this commit will add more tests
notably about convert wizards.
Notably
* add tests for crm.lead2opportunity.partner wizard, notably options about
action (do nothing, exist or create partner), as well as some corner cases
like stage update, lost leads, ...
* rewrite and improve tests about crm.lead2opportunity.partner.mass, aka the
mass converted wizard that implements some random behavior on top of the
crm.lead2opportunity.partner wizard;
Some strange behaviors spotted
* partner action works on lost leads, but not the convert;
* user_id / team_id / stage_id coherency is not enforced during convert
as it relies mainly on onchanges that are not called;
LINKS
Task ID 2180521 (add tests for crm wizards)
Task ID 2056759 (remove crm.partner.binding mixin)
Task ID 2088565 (crm onchange -> compute)
Community PR odoo/odoo#43473
1/ When the new database is created without demo data, the admin has a
'silhouette' as a default picture. When a new user is created without
picture given by the current user, the new user will have a 'silhouette'
as a default profile picture.
2/ web: image for fa-user-slash. This image will be used when a record is
unassigned.
3/ web, *: Change placeholder by default when record is unassigned.
We want to have a fa-user-slash icon when a record is unassigned instead
of 'placeholder.png'. A method is created in the BaseModel to have a
generic method to change easily the placeholder for other models.
4/ Adapt kanban test to keep the same behaviour. Attention the behaviour is
a bit different. Because, now the default image is given by the server to
change easily the default image when a record doesn't have an image.
Thus, we don't say if it's the default placeholder, but we can say it's
not the same image of the record (in this test, the record, it's the
partner).
5/ misc: display 'Unassigned' in the hover on kanban cards if record is unassigned
closesodoo/odoo#41356
Taskid: 2060206
Related: odoo/enterprise#7758
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: jdoutreloux <jud@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
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
Try to understand a bit this code with comments. Some unnecessary code is
removed, and some parameters are added to try to understand the various flows,
but main purpose is to understand that mighty spaghetti, not destroy it.
LINKS
Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
Side effect of Task ID 2088565 (crm onchange -> compute)
Community PR #43127
Enterprise PR odoo/enterpreise#7656
Related: odoo/enterprise#7656
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Lead 2 opportunity wizard file actually holds 2 wizards. Let us split files
especially that naming is quite obfuscated.
LINKS
Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
Side effect of Task ID 2088565 (crm onchange -> compute)
Community PR #43127
Enterprise PR odoo/enterprise#7656
PURPOSE
As crm will soon evolve (onchange -> compute, code improvements, addition of
new features) cleaning and improving tests is necessary to help avoid issues.
SPECIFICATIONS
In this commit we add tests for the lead 2 opportunity converters. Indeed
it is strange that such a critical wizard has so few tests. Notably the
use of single-lead / multi-lead mode is more tested, allowing to see that
code is somewhat oldish.
LINKS
Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
Side effect of Task ID 2088565 (crm onchange -> compute)
Community PR #43127
Enterprise PR odoo/enterprise#7656
Crm Lead has a quite complex form view as the same view is used for both
leads and opportunities. There are therefore some duplicated fields, such
as partner_id.
It is therefore complicated to use xpath to locate such fields. Adding a
name on groups containing those lead / opportunity specific fields make
the view easier to inherit using xpath.
closesodoo/odoo#42895
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Add new activity type 'Email with Template' for demo purpose and add a mail
template for it.
task-1887986
closesodoo/odoo#38944
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Currently the 2 CRM calendars (Pipeline and Leads) only display leads
when they have a linked activity. Therefore creating new leads within a
calendar view was confusing since users could not see the new leads
without switching to another view (note that new leads could not have
activities linked to them under current design and expecting users to
know to add an activity to a new lead to immediately view it in the
calendar view is unreasonable.)
This commit makes it so users can no longer add new leads to calendar
views in crm module. Current behavior of being able to edit leads
already in calendar is untouched.
Part of
Task: 2126530
This commit fixes 9ac5f42cd0c381bdddfd196721983057bab7028b by correctly calling the probabilities
computation method. It was a backport of a master fix and methods names are
slightly different.
closesodoo/odoo#42643
X-original-commit: 2e41f129ee39786c8259af792635e3b0f3dbfa3d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to clean a bit crm tests, notably lessening data
created in tests and removing / improving some low level tests. As we are
about to remove onchange / default and replace them by editable computed
fields it is easier to clean some tests and data beforehand.
This commit is a preliminary cleaning coming from task 2088565 about CRM
onchange to compute methods update.
LINKS
Task ID 2088565
Community PR #42344
Enterprise PR odoo/enterprise#7403
Related: odoo/enterprise#7403
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
SPECIFICATIONS
Fixes following issue: when a lead is marked as lost, the probability is
correctly set to 0 but not the automatic one. If one clicks on the "Set to
automatic", the probability is updated, which un-archives it without really
restoring it, meaning we get in a very strange state outside the expected flow
(no Won/Lost buttons, ...).
With this commit the automated probability is set to 0 when setting as lost.
Moreover restoring a lead recomputes its probabilities.
LINKS
Task ID 2092799
Manual backport of PR odoo/odoo#42015 done in master
PR odoo/odoo#42045closesodoo/odoo#42057
X-original-commit: 9ac5f42cd0c381bdddfd196721983057bab7028b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
To reproduce the bug:
1. Install `crm`.
2. Uninstall `iap`.
3. Go to any `res.config.settings` view.
Odoo will crash because the `iap_buy_more_credits` JS widget doesn't
exist (defined in iap).
Moving the widget from `crm` to `crm_iap_lead_enrich`. Since
`crm_iap_lead_enrich` depends on `iap`, this problem will not happen
anymore.
@Tecnativa TT20916
closesodoo/odoo#42258
X-original-commit: ec1be332c984bfcd0db3517db718fa85dbce7414
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Remove the create_edit option when creating a new lost reason to avoid
displaying an unnecessary wizard.
task-2155189
closesodoo/odoo#42120
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In this commit we perform some small code move in order to better understand
the huge crm_lead.py file. Notably
* add some code sections headers (actions, PLS, opp/leads merge);
* move crm.lead.tag and crm.lost.reason in their own file;
* reorganize fields by main category because it is a mess;
* remove some unnecessary help messages on fields;
* merge two _auto_init methods definitions;
No functional change occur with this commit as it contains only some code
move.
It prepares some further technical cleaning in CRM application, notably
onchange -> compute move.
LINKS
Related to Task ID 2092799 (not really spec, spotted while working on it)
PR odoo/odoo#42015
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
CRM still holds code dead since more than 2 years about sales / crm dashboard.
Custom ugly un-onboarding not-wow headers have been removed at ea66192276.
LINKS
Related to Task ID 2092799 (not really spec, spotted while working on it)
PR odoo/odoo#42015
SPECIFICATIONS
Fixes following issue: when a lead is marked as lost, the probability is
correctly set to 0 but not the automatic one. If one clicks on the "Set to
automatic", the probability is updated, which un-archives it without really
restoring it, meaning we get in a very strange state outside the expected flow
(no Won/Lost buttons, ...).
With this commit the automated probability is set to 0 when setting as lost.
Moreover restoring a lead recomputes its probabilities.
LINKS
Related to Task ID 2092799 (not really spec, spotted while working on it)
PR odoo/odoo#42015
Without demo data, for the odoo-master transifex project
closesodoo/odoo#41935
X-original-commit: dab7670b73506fb3a835695ee3bd735e0c5e5c2b
Related: odoo/enterprise#7287
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
PURPOSE
Purpose of this commit is to allow users to look for leads and opportunities
by using the phone/mobile number fields. For example this allows salesmen
working in call centers to quickly retrieve all open opportunities of a
specific caller.
SPECIFICATIONS
Add a phone_search field allowing to implement a search on both phone and
mobile fields.
Allow searching independently from local format used to store the phone number.
Imagine we have leads with phone or mobile number that looks like ``+32 485 11
22 33``. We want to find this lead even when typing ``485112233``.
A custom search method is therefore implemented. It uses only the digits in the
phone or mobile number to perform the search.
A limitation is added on search having to contain at last 3 digits. Indeed
as it returns a domain whose leaf is ``[('id', 'in', ids)]`` it may be huge
for production databases.
LINKS
Task 2122873
PR #40131
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía
closesodoo/odoo#41624
X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When clicking on stat button "Meetings" on a partner, just highlight the
partner meetings as is done for similar stat button instead of having
a domain that hides other event (so when creating meeting, we can take
into account other existing meetings).
A similar change with same reasoning has been done for "Meetings" stat
button of hr.applicant records.
opw-2131494
closes#40812closesodoo/odoo#40900
X-original-commit: 957e7eb77ed18e4a1c14ef4ef55bd54503c56f44
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
-In CRM, click the CREATE button.
-Only enter a title for the new lead and directly click ADD.
-Click on the newly created lead to view its details.
Before this commit:
although a probability could be computed based on the stage of the lead, this
field has a default value and, at creation time, this value doesn't end up in
the list of values from which the `_write_probability` function decide whether
to recompute the probability.
After this commit:
The `_write_probability` function, renamed `_update_probability`, doesn't check
whether it should or not update the probability. It just does it. This function
is directly called in the `create`. `_should_update_probability` is called
before `_update_probability` in the `write`.
Task ID : 2081480
closesodoo/odoo#40411
X-original-commit: 483a94116629e418ebb224bad375747cf9ab3c1d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Prerequisites
- Configure a mail server (incoming)
- Enable leads in CRM app
- Create a sales team with a mail alias (ex: testcrm@odoo.com)
and check "Pipeline" and "Leads"
- Set a partner email with one of yours (ex: bob@odoo.com) /!\
- Send a mail from bob to testcrm
- In the incoming mail server click on "Fetch"
Reproduce the issue:
- Convert the generated lead to an opportunity
- Choose "Existing customer" and set another one than the actual
- The opportunity is created but the customer is the old one
Cause:
The given partner_id is overriden by the old one in the
`handle_partner_assignation` method.
This commit gives the priority to the new partner_id.
OPW-2089404
closesodoo/odoo#40031
X-original-commit: e1833936255839cd34eba5758ca4c3124fd2522c
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Fields (and selection values) were re-labeled in multiple models but
the corresponding import templates were not updated to match, and are
now non-working (can't straight import the templates themselves which
is inconvenient).
Task 2059779
closesodoo/odoo#39834
X-original-commit: 185edc0165e834edd859b3413f03549f1dc71c69
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
closesodoo/odoo#39964
X-original-commit: 59d154dcc1524c8f08c6a1e7aee18c722ab2e0ad
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Purpose
=======
This is the first huge step to improve the test suite in several ways:
- Make them demo data independent, allowing to modify the demo data without having to adapt the tests depending on it. It also allows to have a beautiful + convenient demo dataset to make a demonstration, and to configure complex data in the tests to manage the corner cases.
- Improve the test performances by converting them into SavepointCase. Each test will be rollbacked to it's initial state, after the setUpClass call. That way the different data are not re-created at each test for nothing.
- Introduce several test classes in base/tests/common.py to launch a TransactionCase, HttpCase or SavepointCase test with an available demo user, portal user or a large set of partners.
- This is the first step to tend to a rolling release process, allowing to execute the tests (or a subset of the tests) on a migrated base, for example.
closesodoo/odoo#39868
Taskid: 2075739
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
-By this commit, 'Buy credits' link should only be visible whenever
'Lead Enrichment' feature is enable in settings of CRM.
task-2116040
closesodoo/odoo#39905
X-original-commit: 6a8e5f636be87596012be9ef96792a9b1881ff4a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, the user could not edit the lead phone field
when a customer was assigned. The phone field was related to the
phone of that customer.
Now, the field related to the phone of the customer is removed.
We can edit the phone field of the lead without modifying the customer
one.
task-2083470
closesodoo/odoo#38350
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently, the "Opportunity restored" note appears while changing the tracking
field's value, which is incorrect.
The "Opportunity restored" title should only appear when the modification is
done by clicking on the "Restore" button.
Thus, make a condition proper to display this title "Opportunity restored".
task-2089784
closesodoo/odoo#39447
X-original-commit: 14453bf9dc6677056329b4599c798d6bf5273980
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>