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>
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>
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>
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
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>
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>
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>
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>
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows
In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.
This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.
This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.
In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.
closesodoo/odoo#125284
X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
With this commit, when a user clicks on the font size number in the
editor's toolbar, two things happen:
1. Same as before: the list of recommended sizes opens.
2. The current font size is selected, and the user can type any value
they want. They need to confirm with "Enter" or blur the input to use
a custom value.
task-3167041
Part-of: odoo/odoo#119972
Since [1] the `value` prop is no longer part of the standard field
props, and its value must be accessed as
`this.props.record.data[this.props.name]`.
This commit fixes a traceback when opening a mailing in read-only mode,
which resulted from reading `length` of `this.props.value`, which is
undefined.
[1]: 688986f888closesodoo/odoo#125070
X-original-commit: 2ccee9ab4316f991252a398c9856c47ef3030789
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
Images weren't shown when using predefined templates, the problem was
that returned object wasn't assigned to anything, because sometimes
`filename` wasn't found in `imagesInfo` object,
which caused wierd behaviour.
bug happened: f4f0f78318
task-3328675
closesodoo/odoo#124786
X-original-commit: 0944db93f9d9ac895cf81401998aff7bd11a3c92
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Prior this commit:
While sending mail through CRM, the mail body doesn't show message content
in the mass_mailing module.
After this commit:
User will be able to see the message content inside Mail Body.
Task-3245572
closesodoo/odoo#123963
X-original-commit: a4549981790a6aa85ff59ea5ec6157c3ec3cfda6
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Go to Email Marketing, open a record with status "draft". Directly
when the record opens, and before the html field is loaded, click
on another menu or on the breadcrumb to leave the view. Before this
commit, it crashed because the HtmlField tried to perform an RPC
after being destroyed.
opw~3297859
closesodoo/odoo#123381
X-original-commit: 3e8d2c7006b16738cdab7442a7135ae7f1c60da9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit adapts the style of the close button on the mass mailing "mobile
preview" to ensure that it's visible in both regular mode and dark mode.
Task-3326846
closesodoo/odoo#122394
X-original-commit: 440c0f04c7fe59953bfb2924a668f76316c6215e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Rename tours, reorder tests and test files, perform a quick linting of UI
or tours related tests. Purpose is to prepare files to add some new tests
in mass mailing.
Each tour now belongs to a single file to ease maintenance and update as
well as seeing feature coverage. No real change should occur with this
commit except some test data (setup, test input).
Prepares Task-2150462 (Mass Mailing: Improve subscription management)
Part-of: odoo/odoo#122106
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.
This commit fixes this issue.
task-3326633
Part of task-3326263
X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
Before this commit, the moved tours were added to the common and
frontend bundles, and were thus loaded all the time even though
they only exist for testing purposes.
This commit moves the two files to the correct bundle.
closesodoo/odoo#121408
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238
closesodoo/odoo#120437
Signed-off-by: Géry Debongnie <ged@odoo.com>
hr_recruitment: switch smart button value and label
- Switching applicant's name with "Employee" label to be consistent with
the rest of smart button's format
mass_mailing: adapt status bar layout
- Removed excessive margin between the status bar and the content
- Added no padding between status bar and the control panel
- Removed a useless border before the status
- Improved margin between alert and buttons
project: right side panel stats buttons alignment
hr_skills: fix `::before` alignment
== ISSUE ==
Before this commit, the :before line in Employee resume is not aligned
with the dots. This is due to the fact that the variable
$o-hrs-timeline-entry-padding used in the mixin isn't the right value we
should use.
There was also an issue with responsive.
== After this commit ==
We now use a calc, which process the half of the circle plus the padding
minus the border-width. The $o-horizontal-padding is the variable used
to define the padding of the line inside the form view.
We adapt this in a smaller media query since the $o-horizontal-padding
value is different.
task-2818586
Part-of: odoo/odoo#116641
Commit [1] defined a value for the `onWysiwygBlur` option of `Wysiwyg`
in the `mass_mailing` `html field`. This had the side effect of
overriding the value set by its parent `html field`, which was to call
`commitChanges`. As a result, the `mass_mailing` `html field` was not
saving its content on blur. This restores that behavior by explicitly
adding the call to `commitChanges` where it was missing.
[1]: https://github.com/odoo/odoo/commit/e212e873eb35eb9b9a931fb1521109475c008074
task-3288881
closesodoo/odoo#121231
X-original-commit: 817d494e4eaa29983f75d4f3d6754ef3c3cc6e51
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
We allow edition/creation of domains with a domain selector via the
search bar facets or the menu "Add Custom Filter".
The domain selector has also been improved and now support expressions
and a new operator "between" for some field types (those for which <=
and >= are valid operators). We also improve the support of the connector
not.
Task ID: 3063564
closesodoo/odoo#112326
Related: odoo/enterprise#37715
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Prior to this commit:
When the mobile preview is clicked in the mailing template of the marketing
automation, the preview is empty. The preview is seen after closing all the
dialog boxes, but it is still not obtained as expected.
Post this commit:
The mobile preview is working properly while clicking on the preview button.
Task-3272504
closesodoo/odoo#120415
X-original-commit: 095b456bf518a6730b5b0039fef40f4cfe8e3511
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit adds a basic tour for creating a mailing from a campaign's
"Mailing" tab, via the list view of the `mailing_mail_ids` one2Many field.
closesodoo/odoo#119918
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The campaign's "Mailing" page displays the one2Many `mailing_mail_ids` field
in a list view. When creating a new mailing from this view, a new record is
created with the fields from the comodel(`mailing.mailing`)'s form view, which
does not have the necessary "body_html" field.
This resulted in a traceback when attempting to save changes to the newly
created record, as `MassMailingHtmlField.commitChanges` calls `Record.update`
for such field.
This commit ensures the `body_html` field is present by adding it as a
dependency of MassMailingHtmlField.
Task-3225211
OPW-3204686
Part-of: odoo/odoo#119918
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
web_tour
**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.
Examples:
<form class="foo">...</form>
gives
<div class="o_view_controller o_form_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="foo o_form_editable ...">...</div>
</div>
</div>
and
<list class="foo">...</list>
gives
<div class="o_view_controller o_list_view foo">
<div class="o_control_panel">...</div>
<div class="o_content">
<div class="o_list_renderer foo ...">...</div>
</div>
</div>
**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8
**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
"o_form_renderer" class, which was removed during the recent form view
refactoring.
- the list renderer no more adds the root node class attribute to its
"o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
classnames derivated from the arch root node, an util has been
introduced to avoid duplicating code
- the whole codebase has been checked and adapted.
Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
*: mail, mass_mailing, sms, web_editor
This commit adds a new supportedOptions attribute that can be added to any
field widget metadata object. This documentation can be used from other places
(Studio for example) by getting the field from the registry and then read
this key. This attribute can contain an array, detailing the list of available
options for the field widget.
By using an array, it can be ordered easily without having an object with keys
unalphabetically. Ordering the options can make sense, especially when two
options are tied to each other, it is easier to group them one after the other.
(eg: 'start_date' first, then 'end_date')
Each option documented is an object and has the following attributes:
- help: contains more details on the current option and its use
- name: name used in the options object from the node
- label: a label with a more explicit name than the option name
- type: the type of value that must be used as a value (string, boolean, selection, field, domain)
- choices: for options with a 'selection': can be used to know available values
where multiple values can be chosen as the value. This must be
an array containing the options.
- availableTypes: for options with a 'field' selection: can be used to filter the
available fieldNames to choose as a value.
- default: the value that is used by default, when the option is not set
in the options
task-3259617
closesodoo/odoo#118713
Related: odoo/enterprise#39847
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>