Before this commit:
When we paste html using selectAll and we click code view button then the newly
added template will be visible and immediately got removed by old template. This
problem is because of pasted html is not sanitized.
After this commit:
Now when we paste html using selectAll then we actually see new html template in
result.
task-3473633
closesodoo/odoo#139384
X-original-commit: 6d6e1527ccdf5e616330905bc4b7e4fdd80c6192
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
When you try to copy paste html in code view of email marketing then in preview
it will show the code instead of template.
After this commit:
Now when you try to paste html in code view of email marketing then it will show
template preview as a result.
task-3473633
X-original-commit: 5cd1a900d89c34877be2c1036ad52d8b4a70c849
Part-of: odoo/odoo#139384
The res config settings view contains block in which peppol can be
enabled. Enabling peppol using the checkbox inside the block installs
the peppol module. Once installed, the "Use Peppol invoicing" option is
available, which is itself a checkbox, nested inside of the previous
one. This gives the appearance of duplication, and in addition it's not
relevant at this point to provide the user the option to uninstall
peppol from this menu.
The solution is to replace this content in the view when peppol is
installed, such that the peppol options are always displayed, and the
enable peppol checkbox is replaced.
For this reason, references to the "is_account_peppol_participant" have
been removed, as its use was primarily for hiding/displaying these
settings. The field is no longer useful, and should, references to be
removed in a later Paccount_R have been removed, as its use was
primarily forhiding/displaying these settings. The field is no longer
useful, and should be removed in a later upgrade script.
Required fields have been modified in the xml such that they no longer
prevent saving from the res config settings, instead validation is
performed on the "validate registration" button action.
closesodoo/odoo#139379
Task-id: none
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This PR introduces a general redesign of the Portal user interface in order
to give it that fresh and sleek vibe we also introduced in the backend.
A list of the different changes can be found below. It includes redesign
of some elements as much as layout modification, or element additions.
closesodoo/odoo#138077
Related: odoo/enterprise#48641
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: fdamhaut (FLDA) <flda@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
This commit removes unused variables inside portal.
Before the redesign, portal was using a card layout. To ensure these
cards were always visible and readable, we used SCSS variables to detect
the `background-color` of the page. If the `background-color` was white,
we would set it to a light gray to ensure our cards are visible.
With the new design, we modified the structure and layout of the page,
using a bg-light class directly on the cards rather than modifying the
background of the body, which made these lines useless.
Since they are not used anywhere, we remove them from our SCSS file.
task-3046004
Part-of: odoo/odoo#138077
This commit removes the promise extension which added the function
`guardedCatch`. It was used to filter server and connection errors from
javascript errors. Instead of using guardedCatch, we should use catch
and check if the reason is a server or connection error if needed and
re-throw the error if it's not handled.
closesodoo/odoo#137702
Task: 3439226
Related: odoo/enterprise#48451
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Since it is cached by the ORM (see parent commit), there is no need to
manage the caching in the business code anymore.
In most cases in addition to making the code shorter, it also makes it
more readable by making the direction of the rate more obvious with the
use of the `to_currency` parameter.
closesodoo/odoo#137609
Signed-off-by: Raphael Collet <rco@odoo.com>
Most of the time, rates are computed in a loop by using
`<res.currency>._convert`. This leads to a lot of round trips with the
database.
This PR is caching the value for a whole transaction.
In order to do that, the non stored field `rate` has new (missing)
contextual dependencies: the arguments of `_get_conversion_rate`.
This allows to move the actual computation of the rate to the computed
field, and `_get_conversion_rate` is now only a proxy to avoid playing
with the context manually; also kept for backward compatibility.
Other solutions were considered:
* `ormcache`, but we want to avoid creating multiple caches and reduce
the possibility to have inter dependent caches.
* managing a local cache everywhere, which is cumbersome and error prone
* a helper for the previous option by using a converter factory, but it
is still an issue when the convert function is called from multiple
call functions because the cache isn't shared then.
Part-of: odoo/odoo#137609
Before this commit, the "Print Labels" button shows for all products except
services.
However, this button does not make sense for event_booth, event_ticket, course,
... products
So we only show this button for storable, consumable and combo products.
Task-3390587
closesodoo/odoo#136753
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit changes the wording of actions and notifications in the modules
listed below:
1) Discuss (Leave Conversation)
2) Web (Delete Filter, Get View - Close, Tours - Close, and property field
access warning)
3) Calendar (Stop Synchronization, Configure, and Discard)
4) CRM (Assign Leads)
Task-3390780
closesodoo/odoo#130353
Related: odoo/enterprise#44919
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit's purpose is to ease the the flow of invoicing from the
project app. The warning message when the user tries to invoice without
fulfilling the condition has been updated.
When the customer of an SOL is a person and belongs to a company, the
company is now also shown on the sol, in addition of the name of the
customer. The idea is that the user is more keen to recognize the
company than just the name of the person.
task-3251615
closesodoo/odoo#122611
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit:
An internal use case of training cannot be handeled with the current ux.
Basically, training is sold to customers. It is given by a consultant who needs to timesheet their time.
With the current implementation, each training would generate 1 SO per customer per training.
This makes it impossible to timesheet because the consultant cannot split nor multiply their
time per person attending the training.
Because of that, timesheets cannot be billable which leads the reporting to be inaccurate.
After this commit:
A new field called `billing_type` is introduced allowing the users to flag the timesheets from a project as
considering as billable even they have no SOL set. And so
a billable project with billing_type set to 'billable manually', will have its timesheets without any SOL
considered manually billed.
task-3565762
closesodoo/odoo#139478
Related: odoo/upgrade#5318
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
When the user tries to modify the view with an invalid xpath expression,
an XPathSyntaxError traceback will appear.
Steps to produce:
1. Install the Accounting module.
2. Settings > Technical > UI > Views > Open any view
3. Invalidate expr syntax and try to save, thus an error will be generated.
Error: XPathSyntaxError: Invalid expression
This commit handles XPathSyntaxError by raising ValidationError
instead of a traceback.
sentry-4377014622
closesodoo/odoo#139435
X-original-commit: 2af583d0b803b3334b871002e447d3211eb09bc2
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Several fixes after test:
- `l10n_it_edi_warning_message` 's compute was wrong
- `is_being_sent` allows for the Check Sending button to show, it just
reloads the page
- now the XML export button is only readonly if there's PDF and no XML.
In the other cases, it can be checked. It's checked and readonly if
all XMLs are generated.
- some label fixin'
closesodoo/odoo#139362
Signed-off-by: Laurent Smet (las) <las@odoo.com>
If a chart was linked to an odoo menu, but the odoo menu didn't have
an action, the user would get a traceback when clicking on the chart.
This commit:
- Improves dashboard validation. Now we test that the menu is linked
to an action, in addition to testing that the menu exists
- Send a "danger" notification when the user clicks on a chart with
a menu without an action linked to it, rather than a traceback
closesodoo/odoo#139324
Task: 3563450
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Remove the extra mailing_domain in the form view and
keeping the one on a separate line.
This extra domain field was introduced by the improvement
task on the mailing form view design.
For more info see: e542cca69e
task-3562293
closesodoo/odoo#139224
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
How to reproduce:
=================
1. Open any course having quiz.
2. Select quiz content.
-> In the quiz template we can see that the html content is not sanitize.
Technical:
==========
I think the issue arises after this commit https://github.com/odoo/odoo/commit/0d7acf60b4cca84a8c700edd97af8c4de6b78010
After this commit:
==================
Now t-esc is deprecated and the HTML text is not sanitize in the template
so instead of t-esc we are using t-out.
Task-3555159
closesodoo/odoo#138873
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
* = hr, hr_holidays, hr_homeworking
Change the disposition in Kanban card.
Changes the behavior of the image in the kanban card: if an employee don't have an image the avatar's image is displayed.
task : 3527398
closesodoo/odoo#138858
X-original-commit: c55dd60baa8aeb6d54a2dc7f1039be1e84113cf8
Related: odoo/upgrade#5314
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit contains some misc improvements based on the 16.0 overall improvements regarding navigation and Journal Items
in account.full.reconcile, 'name' field has been removed, and the replacement for matching_number will be the SQL id instead (no more sequences)
For full reconciliations, the matching number now don't have an 'A' prefix
For partial reconciliations, the matching number will have a format of 'P{id}'
Community-pr: https://github.com/odoo/odoo/pull/138140
Enterprise-pr: https://github.com/odoo/enterprise/pull/48980
Task-id: 3530458
Part-of: odoo/odoo#138140
When using the media dialog, the dialog always seems glitchy as its size
is always changing with the loading files. This behavior is not really
convenient as it can make the user click on unwanted images. Another
"issue" of the current media dialog is that when loading more images,
the dialog auto-scrolls to the "Load More" button, which can make the
user miss new images and he therefore needs to revert the scroll. A last
issue encountered by the users is that some of them think that the "Add"
button in the footer is used to upload files from their device, while it
only adds the selected media to the page.
This commit improves the UX of the media dialog:
- The dialog height is now fixed and has the same size as when it is
fully filled by images.
- The top bar with the search input now stays at the top when scrolling.
- There is now a small footer under the attachments (for the Images and
Documents tabs only) and containing the following:
- When there is content to scroll, a small circle with an arrow that
scrolls one row when clicking on it.
- When there is nothing to scroll, the "Load More" button which will
load more images. When new images are loaded, if we can scroll, the
small arrow is displayed again.
- When there is nothing to scroll and to load anymore, the "All
images/documents have been loaded" text.
Note that the main goal of this footer is simply to indicate to the user
when there is still content to scroll and when he can load more files.
In order to solve the "Add" button issue, this commit also enables and
disables this button, depending on whether some media are selected:
- if a media is already selected, we can click on the button;
- if not, the button is greyed out and we cannot click on it.
task-3441587
closesodoo/odoo#135875
Related: odoo/enterprise#49535
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit introduces a new optional feature in the chatter.
Users can request translation from the Google Cloud Translation API.
Documentation: <https://cloud.google.com/translate/docs#docs>
Adding the key in settings will instantly enable the feature for all
users of the database and consumption is not measured nor limited
by Odoo as it is natively supported using the Google Cloud Console.
Translation values are stored in the database to reduce cost as
much as possible. Therefore, translation values are automatically
garbage collected every 2 weeks to prevent database pollution.
Task-3338165
closesodoo/odoo#126555
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The goal of this commit is to replace the "Toggle underline" option
from the website's text editor by a new "Highlight effects" option which
should allow applying some highlights on the selected text and setting
their color & thickness. Also, the text editor "Toggle strikethrough"
option will be moved to the list of highlight effects in the new option.
For this purpose, the JS code used for text animations will be updated
to be more generic and handle text highlights too. Moreover, The "Text
Highlight" options will be applied by adding a SVG to the targeted text
element (allowing to adjust their `stroke` and `stroke-width`).
To simplify adapting highlights when the text content is updated,
we follow this generic structure:
```
<span class="o_text_highlight">
<span class="o_text_highlight_item">
line1-textNode1 [line1-textNode2,...]
<svg.../>
</span>
[<br/>]
<span class="o_text_highlight_item">
line2-textNode1 [line2-textNode2,...]
<svg.../>
</span>
...
</span>
```
Rendered line breaks in text nodes are detected using range client
rectangles (see: `text_processing.js` > `splitNodeLines()`), and the
highlights are updated on window resize...
We also need to adjust highlight SVGs to fit an updated text in "edit
mode" (mainly using editor's commands), a `MutationObserver` is used
for this purpose (we only redraw the SVG for each text unit).
A simple SVG path generator was implemented in this commit (see:
`text_processing.js` > `drawPath()`) to build highlights. It applies a
list of SVG path commands according to text dimensions in a specific
mode (E.g. on "pattern" mode, we repeat the same elementary path to fit
targeted text node...).
Remarks:
- The `--text-highlight-width` and `--text-highlight-color` properties
are used to control the highlight effect's thickness and color.
- We build the highlight option preview in the same way as text content.
To achieve this, a hack was used (we open the `<we-select/>` first since
we need the right `getBoundingClientRect()` dimensions to correctly draw
highlight SVGs).
task-3285817 (rd-website)
task-3269759 (rd-design)
closesodoo/odoo#122751
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Chrysanthe (chgo) <chgo@odoo.com>
*: web_editor, portal
This adds a button to add language in theme tab. When clicked, opens
the "add a language" wizard.
If the website has only one language, the options to enable language
in header & footer are hidden.
When an user add a language, the default behavior is Header: dropdown
& Footer: inline.
Also provides two more rendering options : Language Code and Flag +
Language Code.
task-3457554
closesodoo/odoo#119650
Related: odoo/design-themes#651
Related: odoo/upgrade#5214
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
When we set a border on a header, its 4 sides are affected. For most
templates, it doesn't make sense to have borders on the top, left and
right sides.
This commit applies a border-bottom-only style by default to headers,
and adds two classes `.o_full_border` and `.o_border_right_only` to
override the default behavior. As their names imply, they respectively
apply borders on the 4 sides or on the right side only.
task-3474743
Part-of: odoo/odoo#119650
Currently, the template headers all have the same default behavior, you
cannot define different default behaviors for header A and header B
(e.g. have header A appear over the content and header B fixed).
This commit allows to specify other behaviors than the default ones for
each header template. It should be noted that, as it currently stands,
most options trigger a reload of the page, which prevents simpler
solutions like using `data-trigger` attributes to tie some options to
the header selection.
Specifically, this commit:
- defines a header visibility for each header with `data-trigger`. This
is actually the only option of the 3 concerned by this commit that could
be handled that way, for the aforementioned reasons. Only the visibility
of the `header_rounded_box` template is actually modified, but to allow
switching back and forth between the different templates and still have
the intended Odoo experience, a trigger is specified for each header
choice (the other ones having the default visibility).
- applies the "pills" link style for the `header_rounded_box` template
and introduces a `customizeWebsiteVariables` public method to do so.
This method, called through the `data-customize-website-variables`
attribute, allows to specify additional variables that should be
modified by selecting the option. It is as of now only used in that
specific case, but could be used with a number of other options which
are defined in a similar way, such as the scroll effect, alignment,
font, logo height...
- uses the default link style to apply it to each template by default
through the use of `data-default-variables`. This is needed (1) to make
sure that the `header_stretch` template can never have another style
than the default one, as the option is hidden when it is selected, and
(2) to go back to the default behavior when switching between headers.
Both `data-customize-website-variables` and `data-default-variables` use
the same syntax: a list of `variable: value` separated by a comma.
e.g. `header-links-style: pills, header-scroll-effect: fixed`
- removes the "Round corners" option field and border-radius for headers
sales_one, sales_two, sales_three and sales_four, because the option
does not play well with their layouts.
task-3474743
Part-of: odoo/odoo#119650
Following the redesign of website template headers, this commit
introduces a new class `.o_header_hide_on_scroll` to hide some part of
the header when scrolling.
task-3474743
Part-of: odoo/odoo#119650
Following the redesign of website template headers, this commit applies
a few fixes and modifications to the behavior:
- It separates some elements' options into their own option sections:
brand logo, language picker, searchbar.
- It disables interactive elements in the header (search modal, language
dropdown, logout button) while in edit mode.
- It solves the following bugs introduced by the headers redesign:
- Displaying the language selector with an inline style and flags
only is working.
- Social links are now unmovable and unremovable (other than by
clicking on the "Show/hide social links" expressly made for it), as
their place in the templates is fixed, as allowing the snippet to be
moved caused several tracebacks, and as removing it through the
options and trying to show it again caused a server error.
- The CTA button is made unremovable (other than clicking on the
"show/hide button" expressly made for it) for the same reasons.
- It was possible to write in spaces where it shouldn't have been
(search icon, mobile menu closing icon): they are made not editable.
task-3474743
Part-of: odoo/odoo#119650
Prior to this commit, the dropdown of the search bar which was displayed
in a navbar had a static position when the viewport was below lg.
This dropdown pushed the navigation down instead of being in front of
it, creating a layout issue in the offcanvas menu.
To fix this, this commit forces the `dropdown_menu` of the search bar to
be in absolute position.
task-3060986
Part-of: odoo/odoo#119650
Prior to this commit the id used for the main navigation wasn't
descriptive enough.
This commit fixes this issue.
task-3060986
Part-of: odoo/odoo#119650
Prior to this commit, dropdown menus floated in offcanvas menus. This
can create an UX issue on mobile when you want to click/tap on a
link that is behind the open dropdown menu.
To fix that, this commit removes the floating style and lets the
dropdown menu extend below the parent button.
task-3060986
Part-of: odoo/odoo#119650
*: website_sale, website_sale_wishlist
This commit allows the user to show and hide the menu items they want
using the web editor.
task-3060986
Part-of: odoo/odoo#119650
Prior to this commit, icons in the user dropdown were not visible when
we applied a dark background color on the header.
In fact, when we use a dark background, it applies the "nav-dark" style
and turns the "text-muted" in a light gray which is not visible on white
background.
This commit fixes this issue by using the primary color instead of the
muted gray.
task-3060986
Part-of: odoo/odoo#119650
*: website_sale, website_sale_wishlist
This commit removes the following templates:
- template_header_image
- template_header_hamburger_full
- template_header_magazine
New templates were added by previous commits. Those old 3 do not have
an equivalent anymore and are simply removed.
task-3060986
Part-of: odoo/odoo#119650
*: website_sale, website_sale_wishlist
The new header is quite different from the old one, the xml_id of
the header will thus change. That new "sales_three" header will however
be the closest one to the "contact". A related upgrade script will be
made to treat this as a simple xml_id renaming.
task-3060986
Part-of: odoo/odoo#119650
*: website_sale, website_sale_wishlist
The new header is quite different from the old one, the xml_id of
the header will thus change. That new "sales_two" header will however be
the closest one to the "slogan". A related upgrade script will be made
to treat this as a simple xml_id renaming.
task-3060986
Part-of: odoo/odoo#119650
*: website_sale, website_sale_wishlist
The new header is quite different from the old one, the xml_id of
the header will thus change. That new "search" header will however be
the closest one to the "centered_logo". A related upgrade script will be
made to threat this as a simple xml_id renaming.
task-3060986
Part-of: odoo/odoo#119650
This commit fixes the structures of some existing elements (language
selector, etc) and introduces new ones which will be possible to toggle
in each new header templates in following commits.
Note: the fixes may need to be backported in the future somehow.
Note 2: after this commit, some of those elements can appear broken.
This is because they are meant to be used in the new headers templates
in following commits.
task-3060986
Part-of: odoo/odoo#119650
Co-authored-by: Robin Lejeune (role) <role@odoo.com>
*: website_sale, website_sale_wishlist
This commit adds a new header template displayed on mobile screens.
It also introduces the Mobile Alignment feature, allowing the user to
adapt the Navbar alignment to mobile screens. It will replace the
previous "off-canvas" feature also available on desktop. This commit
removes that old feature but the new mobile menu will only be enabled
in each template in next commits.
task-3060986
Part-of: odoo/odoo#119650