Prior to this commit, alert was in the status bar. To maintain
consistency and avoid alert being in a dropdown in mobile, alert should
be below the status bar.
There was also a height issue that created a too high alert in
`mass_mailing_sms`.
This commit fixes these issues.
task-3468540
Part of task-3326263
closesodoo/odoo#132753
X-original-commit: da9d1c5e146fe0370204d3330cf3d876a98f5753
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Scenario:
- edit a mass mailing while in debug mode
- switch to codeview
- do a change
- click on save
Issue:
The body_arch is updated (making it seems like our change are taken into
account), but the body_html is not and the outdated version will be sent.
Solution:
With this change, when we commit the changes and have the codeview
opened, we will first update the wysiwyg editable to the current
codeview value, before updating body_html.
related to opw-3103549
closesodoo/odoo#132129
X-original-commit: 576bee4b7e426f45c7bf418b9762a46407f66549
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :
<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>
task-3292454
closesodoo/odoo#131390
Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
These changes are made as a result of simplifying attrs and 'states' in
views.
Before applying the migration script, it is necessary to fix some views.
These views are erroneous and either work by chance or are simply
untested. We have for example wrong domains, elements used by modifiers
but not present in the view, obsolete domain operators, inherit views
not targeting the right views, xpaths using attributes as target, the
use of %(...)s in views, false attribute value types in python.
Part-of: odoo/odoo#104741
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.
During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').
Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.
Part-of: odoo/odoo#104741
This commit deactivates the conversion of pasted or dropped images into
attachments through a controller within the web_editor module. This
alteration applies to mail and mass_mailing modules, as they have their
own mechanism to handle this process.
task-3457541
opw-3448851
X-original-commit: 291ca7496515701737f6940fa27c917ded205aa6
Part-of: odoo/odoo#131975
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).
Part of task~3443861
Part-of: odoo/odoo#130467
As all the templates are now imported in the owl app, the templates must
comply to owl.
t-key is mandatory when using a t-foreach
Part of task~3443861
Part-of: odoo/odoo#130467
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Since #119325, html2canvas is not used for the toInline process anymore.
Loading the script was still done in the web editor and mass mailing,
which is not needed anymore.
task-3446888
closesodoo/odoo#130862
X-original-commit: e3c9d3c4fb013124faf6d132297171a34854f991
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.
task-3292454
closesodoo/odoo#130865
Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.
closesodoo/odoo#130867
Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In 16.0 and up, when toggling full-screen mode on the mailing editor
the iframe content is not properly made scrollable.
This is due to the toggle method being triggered 4 times
which effectively cancels the effect.
The reason for it being triggered 4 times is that the check that would
prevent multiple event listeners from being set on the button compares
an existing jquery object to a new one on the same element.
As these are two different references to the same element
they are still different objects and thus the listener will be added
even if they reference the same iframe.
The fix is simply to compare the html elements directly, if they exist.
We also add the expected state of 'full screen' to the class toggle
as it may avoid other inconsistencies from blindly toggling.
task-3446768
closesodoo/odoo#130853
X-original-commit: 30f27563868af4b247c96c24135c1003aa191cef
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit restores the sheet layout in mass_mailing for consistency
reasons.
The chatter was extracted from the tab it was in and moved back on
the right side.
This commit also fixes an alignment problem when an alert is displayed
and the alert was vertically bigger that the buttons of the status bar
task-3355071
closesodoo/odoo#130616
Forward-port-of: https://github.com/odoo/odoo/pull/126646
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit removes the legacy implementations of Domain, Context
and the pyjs library. All of them exist in the new codebase, and
the few pieces of code that were still using the legacy ones have
been adapted.
Part of task~3439226
closesodoo/odoo#130647
Related: odoo/enterprise#45129
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.
task 3410198
[1]: 19ea1ac08043e22a811630968e44715cc3bfc495
Part-of: odoo/odoo#125716
This commit aims to minimize a very annoying issue that comes up
frequently: it is often necessary to go in debug mode to configure odoo
for a demo. Then, if we don't explicitely remove debug mode, it will
persist (because it is stored in the session). As a result, technical
tooltips will be visible during the demo, which may be distracting and
give a bad impression, because these tooltips are designed to provide a
lot of technical information.
It is not clear how we could solve the problem. Many questions arise
when discussing the issue:
- splitting technical and debug mode
- removing debug mode from the session
- but still making sure tests works
- what information should be displayed in ui?
- if debug mode is not persistant, find a way to make it temporarily
active
There are a lot of different opinions and needs that are not easily
solved. This commit does not pretend to solve them, it is just a quick
way to reduce the issue mentioned above, by changing the JS code to only
use debug mode if it is explicitely set from the url.
Concretely, it means that the "js" specific debug features are
configured only with the debug parameter in the url:
- technical tooltips
- owl props validation
- displaying the debug menu
The rest will keep working as before:
- debug=assets
- debug=tests
- additional menu items/fields
Again, this commit is just a quick fix, until someone can find a spec
that get enough traction.
closes odoo/odoo#130060
Taskid: #3255925
X-original-commit: 59f49d6a8c856a5d8ca28dcfd7840baaa1c7672f
Related: odoo/enterprise#44783
Signed-off-by: Géry Debongnie <ged@odoo.com>
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().
task-3292454
closesodoo/odoo#130179
Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Before this commit:
when new snippet is drop in mass_mailing after first delete everything and
exiting from codeview a traceback occurs.
After this commit:
Now, a new snippet can be dropped in empty mass_mailing.
Task-3178818
closesodoo/odoo#129865
X-original-commit: 8e93f3c65ada549c51b841d1f39a3422be6f3e27
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Improve low-level checks of recipients in mail asserts. Sometimes 'email_to'
cannot be easily deduced from given input (partners, records customers, ...)
when some record -> email transformations are involved e.g. when dealing
with multiple emails input, double encapsulation, ...
Those tools are about to be used in upcoming tests and fixes.
Task-3438381 (TestMail: backport tools)
Prepares Task-2612945 (Mail: Defensive email formatting)
X-original-commit: bdbe846329ed51e4c5e3b75740e8f594edf7b138
Part-of: odoo/odoo#129839
PURPOSE
Purpose of this commit is to backport some improvements done in mail testing
tools done in newer versions. Some of them are required for incoming tests
to be added, other just to try to ease writing tests across versions.
SPECIFICATIONS
Partial backport of odoo/odoo@94208cb8b4
Improve finding outgoing mails and emails when batch methods (mass mailing)
create similar emails, that can be distinguished notably by the subject
in addition to from / to.
Partial backport of odoo/odoo@c98f259736
Add a method to check MailMail, based on a given record. When having duplicates
to differentiate in a given mailing, having just recipients is not sufficient
as multiple emails may match a given recipients list. Checking model / res_id
is another method for finding emails.
Partial backport of odoo/odoo@a3e404e17e
Add some information and values propagation in some custom asserts in mail
test tooling.
Partial backport of odoo/odoo@b915617569
Allow to return <mail.mail> records and found outgoing emails when using
asserts. It eases doing checks in some specific tests e.g. checking
notification layout usage in emails. Indeed this is quite low level and
does not really deserves its own assert tooling methods.
Partial backport of odoo/odoo@bbf4783ac6
Improve checks and asserts done when asserting content of produced
mailing content (mails, traces, ...).
Task-3438381 (TestMail: backport tools)
Prepares Task-2612945 (Mail: Defensive email formatting)
X-original-commit: 2bc28c804a92f206133c352c046dcdd4971fd4a6
Part-of: odoo/odoo#129839
Base64 img src were converted to inline images but background images
were omitted. This commit fixes that.
opw-3374767
closesodoo/odoo#129645
X-original-commit: a10d1d305696f7ece38e7d3446c067338c411ea2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.
Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”
The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.
closesodoo/odoo#129468
X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.
Main changes that were requested are:
- record datapoints no longer always have an "id" key in their
data (they still do if the id field is in the view), so we use
record.resId instead
- the new model is based on fined-grained reactivity, so several
components that previously relied on onWillUpdateProps to update
their internal state no longer worked. Typically, using the hook
"observeRecord" is the way to go now.
- specialdata are no longer handled in the model, so the components
needing specialData can use the hook "useSpecialData"
- more generally, all overrides of models (RelationalModel or
KanbanModel) needed to be reworked.
Part of task~3179751
Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.
task-3370463
closesodoo/odoo#127469
Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
This commit allows the domain field to become foldable such that it will
display its domain in the form of facets (similar to the search bar's
ones) when it is folded. Also applies this functionality directly to the
mass_mailing form view.
task-3339512
closesodoo/odoo#126789
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
Better tag selection
====================
The block was originally hooked onto the `external` tag under the
assumption that this was the tag used to allow external requests.
It's not, it's the tag for the "external" test suite, which is only
one of the test suites allowed to perform external calls. Hook again
onto `standard`, this might have some false positives (allow requests
which we'd rather block), but it should have a lot less false
negatives (block requests we want to allow).
Make Overrides Easier
=====================
Currently `_request_handler` raises a regular `ConnectionError`, this
is an issue because it passes some requests through, which could
themselves trigger genuine `ConnectionError`.
When overriding `_request_handler` to implement fallbacks for bespoke
URL mocks, these two cases need to be distinguishable as overrides
likely want to handle blocked requests, not actual failures.
Therefore `_request_handler` should a dedicated exception. This
exception should be a subclass of `ConnectionError`, so that blocked
requests are treated as regular connection failures by normal Odoo
code.
Class-scope
===========
Originally `_request_handler` was scoped on the instance with the idea
that it'd be a `mock` object, which individual tests could
`configure_mock`. This turned out not to work correctly, because
`Mock.side_effect` does not receive a `self`, hence the `Session` was
inaccessible and it was not possible to passthrough local requests.
While I moved to a regular `lambda` (because a direct method didn't
work either), I forgot to remove the `request_mock` attribute, and
didn't think that the block could now be lifted up to the class
scope. Doing this, requests performed during a "standard" test case's
`setUpClass` are now also blocked, which they very much should be.
closesodoo/odoo#128977
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.
In this commit,
the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.
Example :
registry.category("web_tour.tours").add("example", {
test: true,
steps: () => [
{...},
{...},
],
});
task-3292454
closesodoo/odoo#124157
Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
The goal of this commit is to remove all dependency to legacy in the
wysiwyg because the wysiwyg has to be loaded on a lot of form view
(through the html_field).
To remove the dependencies, all the legacy widget that the wysiwyg
uses had to be converted to owl. In order to finish the PR faster,
only a partial conversion of the widgets is done, changing only the
part of the code that was necessary for it to work instead of
rewriting the whole widget from scratch. Another pass should be done
to convert all those widgets to fully embrace the owl paradigm.
task-3175256
Part-of: odoo/odoo#118966
In order to match the filename with the only classname of that file,
this commit rename `wysiwyg.js` to `MassMailingWysiwyg.js`.
task-3175256
Part-of: odoo/odoo#118966
Before this commit
- When we were creating an alternative version in the SMS app for A/B
testing, we were not able to see different options like select
winner, compare version, etc in it because of ab_testing_mailings_count
was counting only records with type equal to mail, in method
_compute_mailing_mail_count. So, count will never increase
and those buttons will never be visible.
- We were not able to sent the mail manually in auto mode.
- We were able to see the 'Send winner Now' and 'Send this as Winner'
buttons even if no a/b test mail were send.
So, with this commit
- We have added the ab_testing_sms_count compute field in utm.campaign
and ab_testing_sms_count related field in mailing.mailing to deal
with the above problem.
- The auto mode can now send a winner manually.
- We introduce a new compute field is_ab_test_sent for computing
whether the any sibling mails of a/b testing are sent or not,
depending on that we hide / show buttons.
TaskId-2713198
Part-of: odoo/odoo#88997
- Add an alert message for A/B testing when no mail is sent in the
form view with the chatter.
- Add the final suffix in the name of the final mailing send for an
A/B testing campaign source.
task-2713198
Part-of: odoo/odoo#88997
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.
task-3391739
closesodoo/odoo#127406
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
PURPOSE
Settings allow to change colors used in emails (primary and secondary colors).
Those are used for headers and buttons. They are currently shared with colors
used for base documents and reports layout: changing email colors change
documents colors, which is not expected nor clearly indicated.
SPECIFICATIONS
Split configuration: colors used in documents may differ from colors used in
emails. Duplicate color fields (primary and secondary). To ease setup when
updating documents colors, update mail colors accordingly. Inverse is not
true as we consider documents being the main configuration, and emails a
more fine-grain configuration.
Task-3346388
Part-of: odoo/odoo#123678
This commit changes the behavior of the "Search More..." option in
Many2XAutocomplete and analytic distribution by making it available
as long as there's at least one record in the search results and by
renaming it to "View all".
task-3258625
closesodoo/odoo#126041
Related: odoo/enterprise#43660
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
The buttons on the Mailing Lists page were under the content and felt
weirdly placed. These have been moved up on smaller devices to be next
to the Total Contacts column, making the visual result more balanced.
Note that these buttons are only visible on tablet and desktop, not
mobile.
The buttons' spacings have been fixed so as to not touch one another.
This commit also fixes the padding on either side of the ungrouped
Kanban card to be aligned with the control panel.
task-3378519
part of task-3326263
closesodoo/odoo#127613
X-original-commit: 8c4dbaa37cccda6a5af5e9c5be216e69ecd4227d
Related: odoo/enterprise#43762
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).
Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.
closesodoo/odoo#122085
Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
Rationale
=========
Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).
To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)
Changes
=======
- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).
Part-of: odoo/odoo#122085
Before this commit:
The font-family style of buttons and links could not be changed.
After this commit:
The fonts of a buttons and links can be changed.
Task - 2841732
closesodoo/odoo#121926
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Before this commit:
The mass mailing footer had no padding top.
After this commit:
Added 1rem / 16px of padding top to the footer.
Task - 3323881
closesodoo/odoo#125989
X-original-commit: 2085057a17409f4e1c33728b709cedbf23146b2b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When picking a mailing template, the size of the contents of the iframe
changes but we failed to signal it so the iframe could resize as well.
closesodoo/odoo#125820
X-original-commit: 387c4fb815a802e6138671a22864dac97a490365
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>