Use the email_normalized from mail.address.mixin if available to get always
a normalized email address in the unsubscribe link. That allows to simplify
the search on email address in the controllers -> Check blacklist,
send feedback, etc..
Task ID 1896677
Apply the mail.address.mixin on blacklist mixin. So that every model
inheriting the blacklist.mixin will also inherit the address.mixin.
That simplify also the comparaison to - and the searches on - the
blacklist.
Task ID 1896677
This Mixin can be used to store a normalized version of the primary
email address of the parent model. The email_normalized field can
than be used on that model to search quickly on emails (by simple
comparison and not using time consuming regex anymore)
This commit will be usefull to simplify the email address comparison
in the blacklist mixin but also for any models storing non normalized
email address.
Task ID : 1896677
Rev. 7c3d5dc0 recently added new helpers to use in the tests, and
moved some existing helpers to testUtils sub groups (like .dom or
.mock).
This rev. adds a compatibility layer to ease forwardports.
closesodoo/odoo#28824
During the refactoring of the js test suite, in abf32b8b, the
click_everywhere test was inadvertently updated to use the helpers.
Some missing semi-colons were fixed too.
closesodoo/odoo#28820
This module only adds an action allowing to send some invitations to surveys to
leads. It is safer to go through the survey module especially that its use is
about to be improved.
Commit linked to task ID 1910982.
closesodoo/odoo#28801
Purpose : this commit improve various elements of the mass mailing interface :
- make recipients field in mass mailing form required and add "mass mailing contact" in selection
- new "Archive" button and color picker in dropdown menus of mailing lists and mailings
kanban views.
- various little improvements in labels
closesodoo/odoo#28497
After the Odoo package is built, the package.py script uses a Docker
image to test the package. After that python3-qrcode was added as a
dependency for the package in 2ff49c5f , it revealed some issues.
A missing cli parameter and a forgotten '&&' in the Dockerfile prevented
the installation of the depending packages.
Also, the script shebang was wrong by launching python2.
Finally, the fact that python3-xlwt is missing in Debian stretch was
highlighted. With this commit, the python3-xlwt is explicitly removed
from the dependencies and the documentation is updated accordingly.
closesodoo/odoo#28807
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.
All the helpers are exposed though testUtils.js.
There are 2 kinds of helpers:
1. Assertions
-------------
* assert.containsNone, containsN, containsOnce check that the DOM
(or a specific part of the DOM) contains a `selector`. It
generates a correct error message automatically.
ex: assert.notOk(form.$('button').hasClass('btn-primary'));
-> assert.doesNotHaveClass(form.$('button'), 'btn-primary');
* assert.isVisible, isNotVisible check that the DOM has an element
visible or not. They also check that the element is actually in
the DOM (before most tests didn't verify this).
* assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
properties of a DOM element, and also validate that it is
applied on a single existing DOM element (before most tests
didn't verify this).
2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.
Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
ex: form.$('button').click();
-> testUtils.dom.click(form.$('button'));
New Form utilities: (testUtils.form.*)
clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
the control panel buttons of the form.
`reload` reloads the form data.
New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).
New fields utils: (testUtils.fields.*)
* editInput, editSelect: allow to change the value of a field,
using a selector to identify it. They validate that the input
exists and trigger the change event automatically.
* editAndTrigger: allow to modify a field and trigger specific
events after the value change
* many2one (testUtils.fields.many2one.*)
clickOpenDropdown, clickHighlightedItem, clickItem,
searchAndClickItem: use a field name instead of a selector and
do all the complex mechanism to open, filter and highlight
many2one fields.
Joint work with aab, dam, ged, mge, svs and vsc.
closesodoo/odoo#28784
This commit simply move code into the right file.
The goal is here to fit the guidelines and prepare
the module for some changes. This will ease the
reading of module code.
Task-1851286
closesodoo/odoo#28795
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.
All the helpers are exposed though testUtils.js.
There are 2 kinds of helpers:
1. Assertions
-------------
* assert.containsNone, containsN, containsOnce check that the DOM
(or a specific part of the DOM) contains a `selector`. It
generates a correct error message automatically.
ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
-> assert.containsOnce(form, '.o_form_editable');
* assert.isVisible, isNotVisible check that the DOM has an element
visible or not. They also check that the element is actually in
the DOM (before most tests didn't verify this).
* assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
properties of a DOM element, and also validate that it is
applied on a single existing DOM element (before most tests
didn't verify this).
ex: assert.notOk(form.$('button').hasClass('btn-primary'));
-> assert.doesNotHaveClass(form.$('button'), 'btn-primary');
2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.
Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
ex: form.$('button').click();
-> testUtils.dom.click(form.$('button'));
New Form utilities: (testUtils.form.*)
clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
the control panel buttons of the form.
`reload` reloads the form data.
New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).
New fields utils: (testUtils.fields.*)
* editInput, editSelect: allow to change the value of a field,
using a selector to identify it. They validate that the input
exists and trigger the change event automatically.
* editAndTrigger: allow to modify a field and trigger specific
events after the value change
* many2one (testUtils.fields.many2one.*)
clickOpenDropdown, clickHighlightedItem, clickItem,
searchAndClickItem: use a field name instead of a selector and
do all the complex mechanism to open, filter and highlight
many2one fields.
Joint work with aab, dam, ged, mge, svs and vsc.
Before this rev., the mobile js tests suite was run on a desktop
like chrome-headless (1366x768). This can be a problem for this
suite which tests mobile behaviors and thus clicks on parts of the
interface that are only visible on small devices (thanks to scss
media queries).
This wasn't really a problem until now, because the test framework
allowed to click on invisible elements. But it's no longer the
case since the introduction of click helpers.
Purpose of this merge is to polish a bit this module before turning
it into "courses" (see task #1902304 for more details on this)
Contains
* split python model into separate main files to ease models understanding;
* split views into separate main files to ease views finding;
* rename files according to guidelines;
* merge templates in the same file to have all available at hand;
* move assets in their own file in order to remove noise from templates;
* Split javascript widgets into their own separate files
No functional behavior change should occur with this commit. Only move
has been performed.
Note that we might lose part of the history as splitting files creates a new
history for new files.
Task: #1909281Closes: #28679
Purpose : Ease navigation in default screens of Sales app to better onboard new
users and fix various issues in the views.
- onboarding tour : fix "quotations" filter and tooltip appearance
- config bar :
-remove "Default incoterm" field in "company info" form and move it in
"invoicing" settings.
- improve "document layout" form design, set "paper format" as required
field and add a "preview" button
- rename FieldReportLayout "Preview" link and put standard report layout (the default one in odoo) as first image
- fix small design issue in widget
- "done" button design
- customer form :
- improve address type tooltip
- various changes in "accounting" and "sales & purchases" tabs (stat button, fields reorganizing)
- product form : fix "re-invoice policy" field hazardous hiding behavior and improve field appearance
- customer portal :
- reorganize fields in "customer details" view
- minor changes in "quotation" view
- Correct "sales order" model description
This merge is related to task ID 1892500 .
closesodoo/odoo#28254
When using the HttpCase browser_js method, the window size is fixed to
1366x768.
With this commit, the default window size is still '1366x768' but a test
class that inherits from HttpCase may change it to test mobile layout
by changing the browser_size class attribute.
The browser is instanciated once per test class, for that reason the
window size cannot be changed in the class methods.
To use different sizes in tests, the tests have to be splitted in
classes.
closesodoo/odoo#28760
This merge fixes a crash in discuss, in addition to re-introduce some _quality of life_
features that have been mistakenly removed from the chatter and from chat windows:
### 1. No crash when searching messages
This was caused by the addition of moderated channels. In short, fetching twice
the same message was performing a re-render of the thread due to a mis-consideration
of a moderation status change. When the fetch reaches the fetch limit, the re-render is
considered as a "load more" fetch, which only works when there is at least one message
registered for the current search.
This is fixed by re-render when there is a change of moderation status only.
Task-ID 1910180
### 2. Easily mention followers and employees in chatter
When mentioning a user from the chatter in a document, it was always
fetching all partners in a arbitrary order. As a result, it was hard to mention
followers and employees.
This is fixed by re-introducing the previous behaviour on mentions, which
groups them by followers, then employees, then all partners.
Task-ID 1910111
### 3. Show message document link in chat window
When a message is linked to a document, it usually shows a
link next to the message. This still works in the Discuss app,
but not in chat windows.
This erroneous regression was caused by a refactoring.
This is fixed by re-introduced document links on messages in chat
windows.
Task-ID 1910119
closesodoo/odoo#28744
Revision on https://github.com/odoo/odoo/commit/299ebb2cdf63de2e3967da0d2f3e7effd239812b
The commit above added the notion of moderation, which
requires re-rendering the thread when a message has its
moderation changed (i.e. the message is deleted on reject
or is no longer marked as 'pending moderation').
However, this condition was triggered even when the
moderation status on the message has not changed.
This introduced a crash when using the search in discuss:
- Access a channel with more than 30 messages, so that
not all messages have been fetched.
- Search messages in this thread so that it displays more
than 30 messages, and the last message of those has already
been fetched.
> It crashes with "Cannot read property 'getID' of undefined".
The bug comes from re-fetching messages: it behaves as a
"load more" fetch, although no message has been stored yet.
A "load more" fetch requires at least one message in order to
determine the minimum message ID to fetch, thus the crash due
to having no message to get such an ID.
Here's the explanation why it fetches with load more:
when performing the search and fetching the same last message,
it will detect that it has already been fetched. Its moderation
status is 'accepted', and it will assume a change of moderation
status. This will trigger a fetch and render of the thread.
At this moment, if the search exceeds the fetch limit, not all
messages will be fetched, so that this fetch is considered as a
"load more" fetch.
This commit fixes the issue by only re-rendering the thread
when there is a change of the moderation status on an already
fetched message. Since changes of the moderation status are
handled by means of the longpolling, it should be rare to run
into the case of having a change of moderation status on a
message while using the search on a thread.
Task-ID 1910180
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c
The commit above consisted of refactoring the JS mail module.
A small regression was introduced on messages linked to a document
from a chat window: it was no longer displaying the link to redirect
to the document that this message originates from. This issue was
only isolated to chat windows: it was working fine in the Discuss app.
This commit re-introduces the displaying of the document link on
messages from chat windows.
Task-ID 1910119
Revision on https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c
Resulting of the mail JS refactoring, the list of prefetched suggestions
has been changed as follow:
- before: list of list of mention suggestions `{Array<Object[]>}`
- after: list of mention suggestions `{Object[]}`
The change resulted in wrongly thinking that wrapping the list of
suggestions in a list was pointless, thus simplifying it as a simple
list of mention suggestions.
However, because of this change, it has become much harder to
mention employees and followers of documents from the chatter:
it now always fetches all partner suggestions at all time, whereas
before it was suggesting followers, then employees, and finally all
partners based on the input of the user.
In fact, there was a purpose of using a list of list of prefetched
mention suggestions, which is to group suggestions by "priority":
followers first, then employees, and all partners as a last resort.
This commit re-introduces prefetched mention suggestions as a list
of list of partners, so that it re-becomes easier to mention
followers and partners of a document from the chatter.
Task-ID 1910111
- This commit prevent to send notifications to inactive users.
- This fixes a bug where two partners have been merged and one of its
users is archived.
If one of the two users is inactive the code might use its `notification
type` preferences instead of the active user's one.
closesodoo/odoo#28730
The query was computing the count for all mailing lists, not just the
one being requested. This prevents optimizing the SELECT with indexes.
In addition, using a subselect for the blacklist forced a full table
scan on the contacts - switching to a LEFT JOIN avoids that.
With a blacklist of a few hundred thousand entries, and a table of
mailing list contacts in the same order of magnitude, this brings the
SELECT from 3+ seconds down to 3 milliseconds - with the same result.
Bonus: no need to perform the regexp extraction of emails to test for
NULL values -> substring(x) is NULL iff x is NULL.
When a bounce is received, we look for matching partners in order to
increment the bounce counter. However by using [`ilike','email`] we carry
the risk of matching emails that contain the bounce email:
['email', 'ilike', 'john@hitmail.com´]
will also match 'random.john@hitmail.com' for example.
Using strict equality is safer, and the worst that can happen is that
we fail to count one bounce.
Improve various design elements in sales onboarding and config bar :
Onboarding :
- tooltip and done button
Company info:
- Move the incoterm field from company view to account settings.
Document layout:
- layout widget relabelling and reorganizing
- paper format as required
- added a Preview button
Payment methods and sample quotation :
- Style and relabelling
Before this commit, when enabling a generic view from a specific website
context and that view already had a specific view for this website, the
view was duplicated again instead of writing on the already existing
specific one.
This is because we did not consider inactive views when checking if a
view that is being written already has a website-specific view.
closesodoo/odoo#28743
Various ux improvements in the product and contact form views :
Contact :
- hide/reveal fields according to customer/supplier status and
reorganize
- fields moved to stat buttons
- addresses : tooltip and relabelling
Product:
- Fix re-expense policy (dis-)appearance and fields style
- Change API provider to prevent invalid API calls
- Move geo_find methods into base.geocoder object to ease inheritance
- Add system parameter to allow use of another provider
fixes #x26924
fixes #x6929
When using the media dialog, when uploading an image, the image list
refreshes itself properly. This was not the case for documents as it
was... refreshing the image list too instead of the document list. Also,
when uploading a document, it is supposed to be added in the page
directly and the media dialog is supposed to close. This feature was
broken for the same reason: the iframe system of both tabs which were
using the same name.
Bug introduced with https://github.com/odoo/odoo/commit/abde8bddf8ec45cf12aab59e95c330321158cfba
(even though is was technically wrong for the same reason before).
Closes https://github.com/odoo/odoo/pull/28722
This PR fixes some miscellaneous issues:
- performance issue in read_progress_bar
- performance issue in activity view
- crash in ungrouped kanban view with progress bar
closesodoo/odoo#28715
The progressbar widget is not supposed to be displayed in non grouped
mode. Before this commit, this situation resulted in a traceback. For
example, if the user has an activity on the subscription model, and
tries to open it, it will open an ungrouped kanban view.
With this commit, we check first that the kanban view is in grouped
mode, before loading the progress bar data.
Fun fact: for the subscription model in odoo production database, the
get_activity_data rpc takes 36s, and transfer 420mb (non gzipped) of
data (when looking at all subscriptions).
The main reason for that is that the get_activity_data method create a
domain with all the res_ids (so, if you have 20k subscriptions, the
domain will look like (res_id, in, [...20k ids]). This domain is given
to read group, and the resulting groups (each with a domain key which
includes those res_ids) will be sent back to the web client.
As far as I can tell, the domain key is not used by the web client, so
we send (number of groups)*(number of records) of useless data.
This commit improves the situation in two different ways:
- we only generate the domain if there is a domain at the beginning.
This should greatly improve the performance when there is no current
domain
- we do not transfer the data to the web client
The tests have been detroyed while merging a refactoring for 12.0.
This commit reintroduces unit tests to checks each business cases from
"The Flow" into python tests.
closesodoo/odoo#28323