Some web_editor test was in "test_website" when it could
have simply been in web_editor.
It is moved there and modified to reuse existing imports and pass standard
web linting rules.
task-3741858
closesodoo/odoo#155704
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When using the `/image` command in the composer, or otherwise uploading a file
the editor should add the attachment to the composer if it is the current model
During a change in js relational models [1] the code was not adapted properly.
This lead to a traceback when using the command inside the composer.
[1]: 218ad8456a
task-3741858
Part-of: odoo/odoo#155704
A new message type was added in stable. This is usually safe,
however in cases where there are related fields on that same selection
fetching them will raise an exception as the ORM has to fetch the translations
for the selection in DB.
We add a hack on mail.mail to update the selections in DB when fetching
the message_type field for the first time.
task-3773301
closesodoo/odoo#156235
X-original-commit: 19683173708a2b029acb4e744871772b6c248715
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
`_message_auto_subscribe` relies on `_get_subscription_data` to know who
is subscribed to what. This method uses a raw SQL query but doesn't flush
the relevant records beforehand.
This is not an issue in most normal cases, but if followers are edited manually
for example in order to merge existing records. It may cause issues when
assigning a user to the record after merging, as the this will attempt to add
them to the list of followers automatically, when they already were on it.
task-3713472
original issue in opw-3634410
closesodoo/odoo#155139
X-original-commit: d1b0e46f7d3034c400ba3c60f343c21c68aa011e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
Currently an empty section is not considered empty text.
As the web editor sometimes uses them, it is relevant to consider
them when asking whether some html will appear empty.
Currently, even completely removing the website description of an
exhibitor in website_event_exhibitor from the backend does not make
the 'missing description' tooltip appear in the front-end
task-3607615
closesodoo/odoo#154097
X-original-commit: 7dc376d4d2d2b4000de0da7573c30e4508f32318
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
The utm parameters i.e. utm_source, utm_campaign, utm_medium, are only set
when a sale order is attached to an event registration. If no sale order is
generated the event registration won't have any source despite it being
accessed via a campaign.
Reproduction steps:
1. Create an event and copy its website link.
2. Go to link tracker and create a tracked link with utm values filled.
3. Use this tracked link in incognito preferably to register for the event.
4. Check the attendees of the event and check the marketing utm values.
The registration has no campaign. When it should have one.
This is because event.registration mistakenly does not inherit from
the utm mixin. The fix is to call the default_get of the mixin
as it is independant from any field defined in the mixin.
OPW-3222179
task-3458877
closesodoo/odoo#151047
X-original-commit: 06803bc12115ccb2afb7ea7b8dd101e3a75bfb67
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
Before this commit, attempting to do
`self.env['calendar.event'].write({'partner_ids': [0, 1, 2]})`
would give a traceback as the method that updates attendees
only supports parsing commands, not ids.
This is a problem as that method is called from 'write' and other methods
with the assumption that partner_ids can only contain commands.
This will not be the case when using a gantt view and grouping
by partner_ids for example, and cannot be worked around.
task-3452277
closesodoo/odoo#146446
X-original-commit: 88e191132bf40a4e3090077f1fd0077e649eb7fb
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
In the recent redesign of the `website_event` module(s)
[1] a field was used in the templates of event_track
that only exists if event_track_live is installed.
The `t-att-class` argument is now overriden in `event_track_live`.
task-3597612
1: 94c5bc3d152c80fdbb6798d9b4d28bf62740856b
closesodoo/odoo#142215
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
It is sometimes desirable to completely remove a field
from the automated tracking message
when setting a custom message that already covers the change being made.
Add a filtering method on threads to allow models to selectively
hide tracking values from emails and messages.
task-2974500
closesodoo/odoo#109606
Related: odoo/enterprise#31795
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When ReferenceField uses an M2O field. The model is not updated along
with the props when the model field is updated.
Because of this, the onWillUpdateProps hook will keep trying to update
its value. This results in an infinite render loop.
task-3248500
closesodoo/odoo#139954
X-original-commit: f8f6aaa5e32967d6c7cd888fbe574acdc6f79dc6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
Only duplicate emails used to be checked when sending a mass mail.
However it is possible (e.g. using templates) to send a mass mail
to the same person containing different information.
The existing functions to allow models to specify emails
processed in the past by some other means are kept.
A new check is added in the processing that checks the full contents
of the message, subject and attachment ids.
The strings are not hashed as most situations are:
- Sending the exact same mail to everyone
-> Only need to check against one message
-> Same complexity as hashing
- Sending all different emails
-> Checking inequality of str is usually very fast
For attachments, as we cannot compare them easily.
They are ignored for the purpose of equating emails
whenever there are the same number of attachments
in the email values as there are on the composer.
This is because each email should receive its own copy
of the composer attachments. If they have a different
number of attachments, they were generated dynamically
through reports and we assume they are all different.
We can thus remove the 'document based' information
as it is implicitly infered from this check.
-------------------------
Test utils are also updated for two purposes:
1. Add optional body and attachment_name discriminents
assertMailMail assumed all emails could at least be
differentiated by subject. Our test breaks that
assumption, so we use body and attachment to find the
best-fitting email based on the data passed in.
2. Check email_formatted on recipients
When using assertMailMailWEmails, we first find the
email using the non-formatted email of the recipient.
This does not match assertSentMail which checks against
the raw email_to value, which would often be formatted.
Task-2826811
closesodoo/odoo#99541
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
'unmounting' key was not passed in when cleaning up the voice recorder
for an unmount.
In whatsapp this made the composer difficult to use as the voice
recoder is unmounted each time a message is sent.
The missing key made it impossible to send multiple messages as the
composer would be in the 'recording message' state, disabling the send
button.
Task-2377154
Part-of: odoo/odoo#134377
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>
[1] introduces an issue when a response is sent to an aliased email.
In that case, it is intended that the message should be created
by the owner of the alias by [2]
Which breaks the assumption of made in the first commit, as the message
is being passively processed by fetchmail.
This causes the owner of the alias to never be notified on reponses
in cases where the message could be an alias update.
i.e. on any model where the alias applies.
Because the responses are assumed to have been authored by the owner.
As we do not actually care who creates the message records
and deciding the alias owner 'created the message' does not
actually make sense.
We make sure messages are created by odoobot even
if the message was sent to an alias address.
[1]: c676ed3ea906e99d27a6116cd77218c5ec95b416
[2]: af80c68ae5
task-3383275
X-original-commit: 96fe37d37c94c3d6f4642bd6c28d13fcd87075b7
Part-of: odoo/odoo#130798
Before this change aliases were assigned to the user creating them
The purpose was originally to reduce the number of records created by
odoobot however this leads to unexpected
behavior for the users who just wanted to create an alias without fuss
We make remove the default user such that any automated record
modification/creation will be applied by root instead of some
arbitrary user.
task-3383275
X-original-commit: 3edf18168b92545fc29e078a155494f2781adff6
Part-of: odoo/odoo#130798
Before [1] we used to consider '0' as False.
As this was not transfered in the refactoring, registering for
an event that does not have any ticket would give a traceback
saying the ticket is invalid.
This adds back the fallback to `False` for falsy values after they
have been converted from string to integer
as '0' is not Falsy in python.
[1]: 6b8daa880c
task-3381943
closesodoo/odoo#126783
X-original-commit: 5d61bc66b9e147d22175d15c8d39fc594f45b546
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
In odoo/odoo#118494 we made it possible to set a loss reason on a lead
from the list view action.
However this did not update the behavior of the form view button.
As we remove the 'set reason' suggestion in this PR (odoo/odoo#124103)
It makes sense to update the form action to behave
the same way as the list view one.
task-3356095
closesodoo/odoo#124437
X-original-commit: 4a2534c8eda1b005e1a09a389fc77dcf7b3547fa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
To set the lost reason you currently need to toggle a field
in the wizard if you are marking a lead as lost.
As the loss reason isn't technically necessary, we can just let users
choose whether to input anything or not without having to click anything
We also introduce groups so field strings are displayed.
As the first field cannot easily be implied
to be the loss reason anymore.
task-3356095
X-original-commit: b5181ea609f798e09e2032fe182e01fd07d1c10e
Part-of: odoo/odoo#124437
The "readonly iframe" mode of html_editor does not do
the processing required to ensure all links target a new tab when
the setup is called more than once.
As this happens often, links effectively did not redirect to a new tab.
Additionally sandboxedIframe did not allow new tabs to open.
We add `allow-popups` and `allow-popups-to-escape-sandbox`
to the sandbox attributes.
This is safe as the popup will not have access to the odoo window.
Which should mean it's as safe as opening a link without the sandbox.
opw-3337670
closesodoo/odoo#124395
X-original-commit: 61b6b6bf6181fe703cd3d455dba9004e1fad7135
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
As it holds full HTML documents, mail.mail often encounters issues with
the html editor.
We piggy-back off the intoduction of the switching
behavior between code-view and readonly-view behavior introduced in
a5c0085ce91570c6c961e3293dfe50f4faba6043
The 'sandboxed preview' mode can now be enabled with an option
and will ensure all content can only be viewed in a sandboxed iframe
or in the code editor.
This re-introduces editing, which was mistakenly fully disabled in the
usability fix that introduced body_content here:
5055b374c3bac0126f441dad61afd7e0b68b1370
Some tests are added to ensure the key points of this commit remain
the same. Tests are re-ordered alphabetically to match the order
of execution, making debugging easier.
task-3255777
closesodoo/odoo#121976
X-original-commit: 062569ef042f3b01044c5e4cdbd8b71e96bfd39d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
It can be useful to search the body_content field
to find specific text while not including HTML tags
and attributes in the search.
task-3255777
X-original-commit: 1c60ffa13ca0d383480cae562379a7cde387a2df
Part-of: odoo/odoo#121976
In 2389f77c25f3c4dcfd609a8674dc673703cac6a1
containsComplexHTML was added to allow editing of html content
that would otherwise break when inserted as-is in a DOM
For this we added a rule to always display the code view toggle button.
This should not be the case when the field is marked as readonly.
Switching to the code view in readonly mode will cause a traceback.
task-3255777
X-original-commit: 243b7879ecad229aaefed3cdf0c64e7ae434d8ec
Part-of: odoo/odoo#121976
Currently the summary and description in event ics file generation
are set directly, with a condition in case the event is an appointment.
We make these two ics 'fields' use a getter so that it can be
overriden inside appointment instead.
In addition we remove the special formater for 'online events'
as it is only used for appointments, which does not use it anymore
as of this task
task-3232952
closesodoo/odoo#116211
Related: odoo/enterprise#38570
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This cancels the changes added to f91782279a
for minor version 16.3 as the server action is completely removed
instead of being fixed in this.
The action is not removed in the upgrade as it is still technically
working. Though it should be considered deprecated.
------------------------------------
We remove the action that was used to conditionally call a window action
The action was not called consistently and added confusing indirection.
To maintain the current behaviour of only suggesting adding a loss
reason for opportunities.
We make the reason fields toggleable in the wizard, and hide them by
default for leads.
This leaves the user with the option to add a reason anyway, and serves
as a confirmation wizard if they don't want to.
-------------------
task-3272955
closesodoo/odoo#118494
Related: odoo/upgrade#4640
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Prior to this we used the context active_ids directly to determine
which leads to mark as lost in the lost reason wizard.
We now use a m2m field to store that value to make the behavior more
obvious and predictable, and to ease debugging.
task-3272955
Part-of: odoo/odoo#118494
Currently some auto_reply templates are internal as a means to prevent
notifying users everytime we send a reply to somebody.
This raises the issue that since responses to internal notifications
are themselves internal notifications, often nobody will be notified of
responses to these automated messages.
We fix this by marking these messages as auto_comments, which will
ensure responses to these messages are
considered non-internal (and thus 'discussions', by default).
task-2834304
closesodoo/odoo#94018
Related: odoo/enterprise#35466
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
If a tracked value sent a mail template on creation of a record,
the template was displayed before the original message in the chatter.
We fix this by using precommit hooks similar to those already used for
tracking.
We also update the query count for a couple of tests. This is required
because in those tests the test user is not in the cache when we execute
the precommit hook, which we use to fetch a fallback language early in
the precommit.
Task-2834304
Part-of: odoo/odoo#94018
Prior to this notification actions are shown as such:
MODEL RECORD_NAME won | lost | settings
After they will be shown as such:
MODEL won lost settings RECORD_NAME
with the action links colored to match the company color.
The aim is to streamline the layout of e-mails and make actions
clearer.
task-3067315
closesodoo/odoo#106307
Related: odoo/enterprise#34284
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Many templates use the company logo that is set by default on
database creation. As that logo is clearly a placeholder and the user
isn't necesserely prompted to update it. It's possible for a user to
inadvertently start sending emails with "your logo" placeholders
plastered all over.
This removes the default logo of the company and removes it from
templates conditionally.
The logo isn't simply replaced with a transparent PNG as the templates
set a fixed height for the logo, which would look weird.
task-3067315
Part-of: odoo/odoo#106307
The way the live HTML editor for html_field works means the header
(and other nodes that should only appear once) are removed
and the content inserted inside the body.
This results in values being edited without the user being aware.
For emails, this results in any email using 'style' in the header
to break on GMail and other clients that do not support 'style'
outside of the header.
When an html_field is passed a value containing a header
the html_field appears readonly and the user is able to toggle
the code view. Which enables them to edit the 'raw' HTML and see changes
while preventing the presentation view from affecting the database value
task - 3035163
closesodoo/odoo#118920
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
Templates could previously be created for abstract models.
The methods are not written with that in mind and most useful ones will
raise an exception when calling them on that template.
task-3162320
X-original-commit: 0d4b473ee54d2376f4f71efd864aa0e16822d4ba
Part-of: odoo/odoo#118710
Prior to this change the convert tool did could mangle
the value of html fields when importing static data.
This is because html does not support 'self-closing'
except for HTML5 where it is allowed on void elements (such as img).
Browsers will assume that they are opening tags, left unclosed.
<span/> becomes <span>
They will then try to repair them with variying degrees of success.
Example where it fails:
`<t><t/></t><t><t/></t>`
should become
`<t><t></t></t><t><t></t></t>`
but it becomes
`<t><t></t><t><t></t></t>`
i.e. instead of closing the 'self-closing' tag immediately,
it puts everything inside a single t node
More concretely:
```
<t t-if>
<t t-out />
</t>
<t t-else>
<t t-out/>
</t>
```
becomes
```
<t t-if>
<t t-out></t>
<t t-else>
<t t-out></t>
</t>
</t>
```
which is invalid
-------------------------
The fix is simply to tell lxml that we want to print the xml nodes
as HTML nodes. This will make sure the output is compliant with
the standard and keep the semantic clear for the browser.
The issue does not appear before 16.2, as jquery used to fix it
for us until an update here 9c41ee5091ac06ac3ca71aeac607195c70061e4a
task-3162320
X-original-commit: 8ff2e1018264972107f19755ecda352d78dfa829
Part-of: odoo/odoo#118710
Before this, the resource_ref field is computed once in the default_get.
This means if the cache is invalidated, its value is unrecoverable.
Notably, the cache is invalidated when an attachment is generated
(triggering a commit).
So calling _generate_template could invalidate resource_ref,
which we use as a key to retrieve its result.
This results in a traceback for the user when trying to preview
a template where the first record hasn't yet generated its attachment.
As an example, trying to preview `Sales: Send Quotation`
on fresh installs.
task-3162320
X-original-commit: b4bd93c9b61736a7f41d70afe5db977a6e4b35e0
Part-of: odoo/odoo#118710
If the preview wizard was used to preview a template on a model that
has no record, error_msg would not be set.
This means the field is never set in that case and creating the wizard
results in a cache miss on that field.
The fix is to simply set it, and we add a test to cover that flow of
the wizard.
task-3162320
X-original-commit: 0976ce53e0a97a1f49dc2a262cf66355242fde25
Part-of: odoo/odoo#118710
Currently, the alias domain can only be set by selecting:
'Custom Email Server' in the settings.
This does not make sense for users of pre-configured databases who
just want to use the default server with their own domain.
We move the domain to its own setting to prevent confusion.
As people are not always aware they can just set a domain without
configuring a server.
task-3224434
closesodoo/odoo#116174
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Precommit hooks would stock data until a call to ``cr.flush`` was made.
Notably, this happens when the ``assertRaises`` method is called.
Functions were applied on records already cleared from the cache.
This change adds a cleanup call for `TransactionCase` as it keeps
the same cursor for all tests. Cursor precommits can now
be safely executed inside tests.
Task-2834304
Forward port of #117555closesodoo/odoo#118290
X-original-commit: ff5d0c75fcea5842c5236b1b3f7480ef5a3dc415
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
Prior to this all of the context of the action called in the list
action was overriden. We now combine the action context with the
environment context.
This allows keeping the context from the XML action that defines the modal sizing.
task-3235932
closesodoo/odoo#116287
Related: odoo/upgrade#4493
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Currently there is no way of knowing who changed the address
of a partner. This field is of high importance and should be
tracked to be able to follow who is editing it.
As addresses are represented with a bunch of fields, tracking
them individually would result in weird-looking tracking
messages with each value stacked on top of the other.
To avoid this, we take advantage of the fact that tracking can
be used on non-stored compute fields to log any change as a
change over the full address.
The full address is derived from the contact_address field to
take advantage of the existing regional formatting of addresses.
It is however modified to replace return to lines with commas to
accomodate the formatting of tracking messages in the front-end.
task-3165293
closesodoo/odoo#114695
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
When the template layout was made more mail-client friendly in 16.0
we used padding on a <td> node with
a color background to make it look like a button with centered text.
This approach makes most of the button unclickable.
The fix is to put the padding inside the link itself so that the whole
'button' is clickable. We already do this for most templates.
task-3168757
closesodoo/odoo#116945
X-original-commit: c40327db4f46040d4a6ed0231afcdefd5be47db5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Add back the 'sudo()' on batch mail unlinking.
Sudo is necessary to delete user notifications on auto-delete.
Which makes sense as the recipient would have an email for it anyway.
The sudo was there as far back as:
c5c369355d
Then transfered in this change:
036a739b62
And removed in the recent optimization here:
e38bfd25df1bb25e7e5695b536052d5a0c85c5c4
task-3225207
closesodoo/odoo#115956
X-original-commit: 93a28f17024511e30d3c70eb847c361ca87e0ffe
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
A/B testing was used in the past to create mutually-exclusive mailings.
Since then a 100% limit for the recipients of an A/B campaign.
As there is no technical reason for this limit and not having it allows
for a special usecase, it is replaced here with a text warning.
The usecase in question being that as the domain of the different
mailings composing a campaign may be different, users may want to
take advantage of the fact that only 1 email will be sent to each
address to avoid sending 2 mailings when only one or the other should
be sent. Consequently users may want to use 100% of the domain on
every mailing in their campaign.
As the ab_testing_total_pc is only used for that purpose the field
is removed. 'total' field is not always accurate and is unused so
it is also cleaned up.
task-3008627
closesodoo/odoo#105639
Related: odoo/upgrade#4257
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The sample server did not create a __range value when grouping by 'date'
This resulted in a traceback as it is expected to at least be false.
This commit computes it properly.
task-3098681
closesodoo/odoo#113163
X-original-commit: cf074f1dc01da39e75aa30e4ac21eafa29d528d9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In 16.0, at 6a42ec7c73
an error was introduced redirecting users to the configuration panel
when clicking the 'sync' button for extenal providers in calendar.
This simply replaces that call with a redirect to an authentication url
received from the back-end.
task-3131128
closesodoo/odoo#111392
X-original-commit: 0574c18acd70c3fe52cdb5cbe563ffa02f5f5ad3
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
The percentage used for A/B test was applied even when
A/B testing was disabled. As that value is 10% by default
the 'total' was innacurate by 90% for most mailings.
task - 3008627
closesodoo/odoo#110677
X-original-commit: eb2271330e7759400dad155b72208cf7677e175e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Before this change URLs would get their url-safe encoding replaced
with regular characters when cleaning up
html content.
This caused signed URLs that use some of those characters to become
invalid if the target did not accept equivalent characters.
Concrete example:
/markers=size%3Alittle%7CAddress
is not the same as
/markers=size%3Alittle|Address
for google maps signed static urls
Do not add special handling for MAKO patterns
as they are not used in templates anymore
task - 3079113
Part-of: odoo/odoo#107200
Google now requires an API key for the static maps API.
As API calls cost money, and we cannot restrict the domain of the caller
with the API key in emails, as the domain may vary vastly,
the signing of static API URLs is implemented in the existing
'google_map_img' of partners.
This in turn can be used to get a url for an existing location.
While preventing anyone from stealing the API key for their own purposes
task - 3079113
Part-of: odoo/odoo#107200
The function that adds the missing url root on documentation links uses a regex
in startsWith, which is not supported.
startsWith is replaced with ``regex.test`` which will succeed
if the regex has any match.
Which is fine because we use a '^' to ensure it *starts* with https
task-3079113
closesodoo/odoo#110443
X-original-commit: fdaeaf69c1770edf3f33e32947326d1ebe42820e
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before this change, if a user left a string value in a m2m_tags
and removed it afterward without selecting a tag, the update method
of Many2XAutoComplete would be called with false.
As the update method for m2m_tags expects a record or record list
this caused a traceback.
The fix is to simply skip the update in that case.
task-3109811
closesodoo/odoo#110123
X-original-commit: 14f314feb7594dc888de6af4e4ad23a948044854
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Note:
This is not fixed earlier because this in invalidates
template translations and this isn't a major issue.
Invalidating translations on 16.0 should still be
fine as of writing this.
Issue:
Google recently added a requirement for an API key
to their static maps API. This means we can no longer generate
<img> tags linking to the google API without using a key.
As we send that key inside emails, it cannot be protected
by origin policies to prevent people from using the key outside
of the domain of the database. Protecting it would require
implementing signed google API requests, which cannot be
done both quickly and sanely on stable.
Fix:
This commit replaces the image with a generic string to get rid of the
'missing image' icon. A better fix/imp may be introduced on the master
branch at a later time.
task - 3079113
closesodoo/odoo#109797
X-original-commit: a730c9920bc82a6637882f325ca3d947ca0ddd78
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.
This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.
This also removes "Re:" from default mail subjects.
Task-2833215
closesodoo/odoo#95817
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
CONTEXT:
emoji_char_field and emoji_text_field
previously used the emoji_dropdown component
along with some utility functions to display
a very limited number of emojis.
As discuss now has a feature-full emoji picker
we aim to take advantage of it by bootstrapping
the picker from the existing components,
using a new javascript model for the
insert/update logic
AFTER THE CHANGE:
Users should be able to select the same emojis
they can use in the discuss chat in all fields
that previously featured an emoji picker.
Such as the livechat bot responses,
social posts, mailing subjects and
the sms message composer.
RELATED CHANGES:
Some tests are updated to use the pyEnv testing
'framework', as we now need to have access to
the messaging service to test these fields.
emoji_mixin is modified to match any emoji
character. The mixin is consolidated into
a single function is actually called anymore.
The text to emoji dict from emojis.js is removed
as it is no longer relevant where it was used.
The fields that used the emoji_mixin will no longer
trigger onChange on inserting an emoji.
However both the input and keydown event are fired
to allow fields using onchange_on_keydown
to trigger the onchange.
The emoji button was turned into an actual button
replacing the original span used in these fields.
This required a different approach to styling as
buttons inherently behave differently than spans.
The button is now moved using an empty div next
to the input and absolute positioning.
Most of the code used for char and text emoji
fields is consolidated into emojis_field_common.
task-3035021
closesodoo/odoo#104799
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
## Issue
Currently if an administrator installs one of the sync modules but does
not set any credentials. If the user tries to sync their calendar
they are met with an error.
## Fix
Make sure they get a clear dialog explaining why they cannot sync.
task - 3056311
X-original-commit: 6ec6a3764c5e5460aa8a1cdfa228740606fdfe13
Part-of: odoo/odoo#106517
## Issue
Regular users were not able to see the sync button
used to sync with external calendar services even after
these services were configured
## Fix
Conditionally display the whole sync section until one of the
services is configured.
Override the display conditions when one of the relevant modules are
installed.
task - 3056311
X-original-commit: 29f820cfd421859a2b480725ba2a81a515509b88
Part-of: odoo/odoo#106517
Issue
When the google and outlook sync plugins are not installed the admin user should see an option to install them from the calendar but other users should not see anything.
Fix
This replaces the 'groups' attribute in the calendar controller template with a t-if and a dynamic check as OWL doesn't process 'groups'.
task - 3056311
X-original-commit: 4d5b7d4b5347c958f37b8f40e9edfae7cd78c2ca
Part-of: odoo/odoo#106517
The logic to set the focus on the emoji search bar was only triggered
the first time any emoji picker was opened.
This makes sure the focus is processed every time a picker is opened.
task - 3035021
closesodoo/odoo#106315
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Commit a170b7265e158323d3769f1631314f06c96a6e4b
applies the star color to all stars in the form view
The star in the stats bar should remain black.
task-3044832
closesodoo/odoo#104210
X-original-commit: b2f37a06546638fde69d392dfec3d76fc15ca0e3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
There was too much padding up and down from the tooltip.
Adds conditional display on the template menu
when there are no templates (t-for-each is not fully empty).
Also fixes the favorite icon color in edit mode.
task #2984478closesodoo/odoo#104108
X-original-commit: a170b7265e158323d3769f1631314f06c96a6e4b
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
When creating a recipient from composer_suggested_recipient the user
is free to modify the partner form however they want.
This can lead to them inputing data which will create a partner
that does not match the suggested partner data.
In that case the box acts as if the partner was not created.
This aims to remove the partner in such cases and warn the user.
task #3016112closesodoo/odoo#104005
X-original-commit: 51dd925d3660609b03349c42377e15064461eb3e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Due to a previous fix, attachments uploaded through media dialog would appear in the attachments of mail marketting.
That fix prevents attachments from 'dangling' and being garbage collected later.
That fix is now limited to the mail composer in this commit as attachments are only garbage collected for that model, for now.
related commit: c112361bf9e2f5e7b087c5e5b9a31879856b1da4
task 3003939
closesodoo/odoo#103038
X-original-commit: 69fdca133b06eb66443635bc52d380233580ef51
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently when creating a composer in mass mode
the composer always shows the 'mass mailing name' option
even when a mailing cannot be created.
This silently creates a regular mass mail.
This hides that option when selecting records of models
that do not inherit from thread. So that users do not falsly
believe a mailing will be created.
task #2990447closesodoo/odoo#102105
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Imported unsplash in web_editor when it was not a dependency.
This caused the test to fail when web_unsplash was not installed.
As it is necessary to import it when the module is installed,
this test is moved to test_website as both modules are installed there.
(Also updated to ES6 import syntax + odoo-module style test)
task #3000801closesodoo/odoo#101672
X-original-commit: d85ba585ec4642a507d24ab94606a65970c635f3
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
An event was not called on uploading files in a media dialog.
This meant the parent of html field didn't know of the new attachments
which resulted in attachments being linked to no record at all
and not being garbage collected later.
This adds a reference inside the media dialog file input so that it can
trigger that event on behalf of the html field.
The attachments newly uploaded in media dialog are uneditable
to prevent users from unlinking attachments
that are still used in the body of the composer (causing the same issue)
Task-2860761
closesodoo/odoo#101405
X-original-commit: f4dd1eb3f25672e7309759c347e2b552c5652b2f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This change allows for adding and removing followers from threads
by directly setting the message_partner_ids field of threads.
This enables the use of many2many_tags to add followers to a thread.
Task-2804888
closesodoo/odoo#95645
Related: odoo/enterprise#29284
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When sending a mass mail through the composer, if the field ``reply_to`` had to
fall back to being ``email_from``, reply_to would take the value of the template
syntax instead of the rendered value.
This is notably the case when mass-mailing invoices through the accounting app.
Resulting in reply_to fields such as: '{{user.email}}'
On some mail clients (including mailhog), this could also result in template
syntax being shown as part of the subject or sender field.
This commit fixes that by correctly taking the rendered value of 'email_from'
Task-2816845
X-original-commit: e320b852e8f1958ac3dccaa5333420bb7b8d8f3d
Part-of: odoo/odoo#98287
FWD-PORT: updated to new test files, and tests are more in-depth since v14
When sending a mass mail through the composer, if the field ``reply_to`` had to
fall back to being ``email_from``, reply_to would take the value of the template
syntax instead of the rendered value.
This is notably the case when mass-mailing invoices through the accounting app.
Resulting in reply_to fields such as: '{{user.email}}'
On some mail clients (including mailhog), this could also result in template
syntax being shown as part of the subject or sender field.
Task-2816845
X-original-commit: b87df6664908615bdf57bf16e239a10c3f7bf89b
Part-of: odoo/odoo#98287
(To be commited with [#94024](https://github.com/odoo/odoo/pull/94024))
Duplicating an email sent from Odoo would raise an error because some required fields could not be set.
Setting those fields on duplication does not make sense, duplication is to be disabled on e-mails.
As this applies to some messages and no use-case could be found for the duplication of messages or notifications,
both also had duplication disabled.
Task-2857244
closesodoo/odoo#95138
X-original-commit: 6f9656fc4ceeecd304f600b7cd65d649618ad182
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Emails could not be resent from the chatter after failing to be sent.
This was due to parts of code not being updated after a refactoring of OWL.
Multiple other instances of non-updated code are updated here.
Task-2887153
closesodoo/odoo#94529
X-original-commit: 8fbdb1b52b9051e92e4980d5af73460a46fe70da
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>