The saas version of the client is added in each call to
website.api.odoo.com. This allows the server to return
different results based on the client's saas version
task-2602521
closesodoo/odoo#75617
X-original-commit: 6e1ae856584048912cb5eaf53c0aa027b2342b5c
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit completes [1] by further reviewing the drag and drop
technical flow order:
- The content_changed event should be triggered before starting snippets
as well as it is only useful to signal the snippet modifications made
by onBuilt.
- The undroppable snippets update which was done first could probably be
done anywhere -> best to put it at the end when everything in the DOM
is done, and it is also the last thing the user expects to be done.
Note: in the new editor the role of 'content_changed' became however
unclear and should be further reviewed. This commit fixes problems with
the old flow in master though (problems around removing items in a
snippet during its onBuilt call).
[1]: https://github.com/odoo/odoo/commit/60d7bf6d7daea83db9332b4fc47a4ac6892d21d7closesodoo/odoo#75596
X-original-commit: efdfe261afd933972869305fd3358c764f7c18c3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Regarding previous commit, the option parameter can be removed
from _get_asset_content api, followed by a nice snowball effect.
Part-of: odoo/odoo#75248
Before this commit clicking between the buttons of the link popover
widget did deselect the link. When this happened, if edit was clicked
and the edited link was one within the popover widget instead of the one
on the page.
After this commit clicking on the popover between the buttons has no
effect anymore.
task-2630257
closesodoo/odoo#75544
X-original-commit: 536f72333297ea70cd06c83d92ab0d8f25c0142e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso-odoo@users.noreply.github.com>
Somehow, trying to forward-port the work done at [1] makes it impossible
for the link popover tour test to pass (although that test already
existed in the version where that original work was merged). It's
unclear why the test did not fail before but hopefully it did here: this
reveals a race condition in the editor code where the link popover is
fully shown to the user while clicking on some of its button would have
no effect... because those rely on clicking in the editor panel which is
potentially not up-to-date yet.
This commit fixes the problem in a hacky way, waiting for the editor
panel to be updated before showing the popover but it should not be
necessary in a better refactored codebase.
[1]: https://github.com/odoo/odoo/pull/74861
Part of https://github.com/odoo/odoo/pull/74959
Add an option in the masonry snippet's allowing to choose among multiple
templates for the snippet layout. The usability of the snippet also has
been reviewed (restrict the ability to control background on deeper
boxes). Also reviewed the bg-200 use on boxes and replaced them with
a preset as otherwise it seems buggy to not be able to remove the
bg-200 by selecting a preset (other than hitting the trash icon in the
colorpicker).
Part of https://github.com/odoo/odoo/pull/67361
task-2463033
closesodoo/odoo#67361
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: smottet <oms@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit improves action helper message for visitors menus of
website and removes old action helper message from visitor menu
of livechat for better onboarding.
Menus
1) Visitors(action -> website_visitors_action)
Task-2584073
PR odoo/odoo#74082
Related: odoo/enterprise#20125
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As nicely pointed by @kig-odoo at [1], the new feature of snippet
visibility conditions introduced in [2] has some issues. This fixes
the fact that condition identifiers were built by combining IDs without
a separator. A condition targeting a lang with ID:4 and another one with
ID:5 could thus produce the same condition identifier as another
condition targeting a lang with ID:45 (as 4 and 5 side-by-side makes
45...). Now, all parts of the identifiers are separated with '_'.
[1]: https://github.com/odoo/odoo/pull/67140#issuecomment-902531321
[2]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05dfclosesodoo/odoo#75386
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the newsletter popup was using its own mechanism instead of
the popup snippet, making a lot of extra code.
Now, the newsletter popup snippet just use the behavior of both the popup
snippet and the newsletter snippet.
Community: https://github.com/odoo/odoo/pull/74667
Upgrade: https://github.com/odoo/upgrade/pull/2742
task-2246975
The algorithm extracting primary and secondary colors from
an image automatically mitigates too bright colors. A color
component is considered as too bright if its value is above
an arbitrary value. We re-use this algorithm in the website
configurator to extract colors from logo and to generate a
palette. In this particular case we don't want the mitigation
to be applied. We therefore added the mitigation threshold as
a parameter of 'extract_image_primary_secondary_colors' and
avoided any mitigation by setting it to 255 in our case.
task-2602521
closesodoo/odoo#75255
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web
After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.
The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.
Part of https://github.com/odoo/odoo/pull/73611
task-2599770
closesodoo/odoo#73611
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
Previous implementation always updated *current website*, which is not
always the same as the value from `res.config.settings`.
---
opw-2623007
X-original-commit: d66d44db031be76403ce7c01616e334ef196fd03
When a color combination was used as "color" (base case) for the menu,
the menu background in the boxed template, the footer or the copyright
section, it was not properly marked as selected in the color palette
widget of the editor panel.
Related to task-2599770
closesodoo/odoo#75157
X-original-commit: 04c476a11a084c825725cae89e104e9f205c685b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Remove read access on `ir.model`, `ir.model.fields`, `ir.model.fields.selection` and `ir.model.data` for employees.
To access such records, the code must use the helpers (`_get`, `ref`,...) instead of CRUD operations directly.
Simplify the helpers to ir.model.data that were public and redundant.
self.env.ref is encouraged instead but with the slight drawback that `ref` makes a call to `exists()` (`_xmlid_lookup` can be used if this wants to be avoided).
Part of task-id 8203
closesodoo/odoo#69120
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The attribute lang was set in the template website.website_configurator.
This is not needed. This commit therefore remove this code.
task-2602521
closesodoo/odoo#74931
X-original-commit: d65efdb9896664cba132a08fe85dad6baa348f3b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Coupons and promotion programs can now be shared by creating a link that can
directly be used by the customer.
Using the link, the system will try to apply the coupon/promotion to the
customer's order.
If this can't be done, the error will be shown to the user, for instance
"A minimum amount of 1000$ is required to get the free ipad".
That coupon/promotion will then be stored in session and the system will try
automatically reapply it when something is added to the cart.
task-2489749
closesodoo/odoo#69053
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
*: tools
The app received many fixes and its code was improved and cleaned. It
was about time to include it directly into the website features.
task-2215118
closesodoo/odoo#74697
Related: odoo/design-themes#478
Related: odoo/upgrade#2709
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
It creates race condition, as it contact external ressource, in this case
facebook.com.
Tests should never call external services anyway, it always lead to race
condition.
closesodoo/odoo#74704
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
In order to limit encoding decoding, the _render method returns a
unicode string in the markup safe object instead of a MarkupSafeBytes
closesodoo/odoo#68299
Related: odoo/upgrade#2454
Related: odoo/enterprise#17270
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
* Remove AST in favor of pure Pyhon. This should make it easier for
developers to understand and create new directives because they do not
need to know AST.
* Remove `t-call-options` as it has been merged into `t-options` for more
consistency. Support for t-call-options is retained.
* Use generators for lists. This increases performances as the rendering
can be sent directly without having to wait for the creation of the
entire list.
* Optimize expressions runtime computation by pre-computing the static
parts.
Example:
'<' + 'div' + '>' + '<' + dynamic_value + '>'
Now compiles as:
'<div><' + dynamic_value + '>'
Previously, the debug manager was rewritten with the new webclient
architecture, however, because the frontend did not have access to the
new infrastructure (env and services), the old debug manager was kept
and used only in the frontend.
Since odoo/odoo#72675 the new env and services are now available, this
commit simply uses the new debug manager in the frontend and removes the
legacy code.
closesodoo/odoo#74609
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Edit a website menu label with:
& < > " ` '
This is what is shown after saving:
& < > " ` '
This is happening since ea4dbcd240: characters &, <, >, ", `, and ' are
now always escaped. Before that commit, only < and > where escaped and
only when an image was inside the label.
With this change, we unescape the label when we are editing a menu.
opw-2609413
closesodoo/odoo#74558
X-original-commit: ab77054987287444c5f6141b047a63bab4b67baa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
*: web, website_livechat, website_sale_comparison
Before this commit, bottom fixed elements (e.g. the livechat button)
hid the buttons to go to the next step in website sale when these
buttons are located at the bottom of the page, on some screen sizes.
After this commit,
- A bottom fixed element is hidden if this element hides a button at
the bottom of the page.
- Bottom fixed elements are hidden if a modal is open
to prevent it to hide buttons or any important part of the modal.
task-2501400
closesodoo/odoo#74515
X-original-commit: a851db9495fe9d8c1951f218a71e4d4a427cf96d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The configurator takes care of the organization of the links to the different
pages. Some links are put in the menu and some are put in the footer. The order
is predefined. If too many links are present in the menu then a sub-menu 'Company'
is created and some links are put in it. For the 'News' and 'Succes Stories' features
a website specific blog is created.
Links have the following order in the menu and are present only if their corresponding
website.configurator.feature has been selected in the configurator excepted for the 'Home'
and 'Contact us' links which are default links:
- 'Home'
- 'Shop'
- 'Event'
- 'Courses'
- 'Services'
- 'Pricing'
- 'Company': if more than 8 links in menu and more than 1 item in this submenu
otherwise the three following links are in the top menu.
- 'News'
- 'Success Stories'
- 'About us'
- 'Appointment'
- 'Contact us'
Links in footer:
- 'Privacy Policy'
- 'Help': if website_helpdesk installed. This is not a website.configurator.feature.
- 'Forum'
Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930
task-2518565
Co-authored-by: Sébastien Mottet (oms) <oms@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Before this commit, if the configurator was applied without a module to install
it would still go through `_button_immediate_function()` which does
```
self._cr.commit()
api.Environment.reset()
modules.registry.Registry.new(self._cr.dbname, update_module=True)
```
for no reason, even if `self` is an empty module recordset.
This code is taking ~5 seconds.
This flow will occur when you either:
- Create a new website when selecting only page feature
- Create a new website when some modules feature are already installed
Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930
task-2518565
Image gallery snippet when dropped is throwing a traceback.
This lead to the editor not usable anymore, as any JS error will prevent any
further action (no JS will work anymore).
This introduce a test that will drag and drop every snippet in a page and click
on it to load its settings in the right panel.
Note that it will remove the snippet before drag & dropping the next one, as
having too many snippet will impact the perf, even killing the browser entirely
if there is a lot.
task-2604383
closesodoo/odoo#74135
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.
Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.
The geoip country had to be added to the session for the feature to work
with countries.
Part of https://github.com/odoo/odoo/pull/67140
task-2381049
closesodoo/odoo#67140
Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Issue: traceback when website editor is entered and theme options are
clicked on themes using an unknown-to-the-editor font family (see for
the theme repo fix for such an example).
opw-2559735
closesodoo/odoo#74423
X-original-commit: c664cf1a1fb4b6781fe2802e66c993cfa1a4a028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
On the 'Contact us' form of the 'website' module, the client can
auto-fill the fields with the 'false' text string when the logged
partner has some missing values. This happens because the server
set the missing values to 'false' and the client directly uses those
values to update the form fields.
To solve the issue, the client will replace the falsy values set by
the server with an empty string before updating the form fields. That
way, the form fields will no longer be filled with the 'false' text
string.
task-2610948
Fixes 116d55d62fd411d3be5d9f0885dadac530839b99
closesodoo/odoo#74256
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit,
User was allowed to create new records from form view through
Graph view' action. Since we do not have a way to prevent opening
form view from Graph and also we should not Introduce new form view
on stable version.
With this commit,
we are disabling create/edit/copy from action.
closesodoo/odoo#74288
X-original-commit: e8c5302e5cb11f185d1d5b1ef43ab641b2be6f76
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Before this commit, anchor select on link dialig was never shown
-> xpath done on attribute class but t-attf-class is used
Now we show the anchor input.
This commit also avoid useless anchor detection for empty url and external url.
Or in case of the selected url is the same than the last one loaded.
E.g. type /contactus -> load anchor -> choose one identicalfrom list
before -> reload anchor
now -> we don't refresh anchor screen
X-original-commit: 8e11a0b
closes odoo#74164
closesodoo/odoo#74272
X-original-commit: 6c930e72b7d00f7beb4c43024c52a3e6c44a35f4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Setting a controller URL to a menu which is linked to a page should unset the
m2o relationship to preserve the page URL.
Step to reproduce:
- Create a page (with a menu) and save, eg: "My Page" (url will be /my-page)
- Edit that new menu and change the URL to /shop (or any controller)
Issue:
- The page URL is now /shop, which doesn't have a lot sense if there is a
controller for that URL.
- Unpublishing the website.page will unpublish the menu, as a menu needs its
page to be published in order to be visible.
Note: The flow introduced here is the same as if you choose an URL of an
already existing page, the menu's page will be unlinked from the menu and
left with its original URL.
task-2575974
closesodoo/odoo#74163
X-original-commit: b52a01f76d89ebb7bdd75577e60a09f048c83000
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Currently, when you add a link in any of the buttons on the website with
non HTML/XML page, it will raise the traceback as we fetch the content to find
id to propose as a list of anchors.
Reproduction Steps:
1) Add a button on the website using the editor.
2) Add link in URL (i.e. /robots.txt)
3) Traceback
With this commit, When you add the non HTML/XML page to any of the link
will not raise the traceback.
task-2596392
closesodoo/odoo#74194
X-original-commit: 5f78c19995cc6d1fe480b982176e0701bd4d3e86
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Anonymous website users do not have access to the Customize menu
obviously, but the website.set_view_track widget still attempts to
extend the CustomizeMenu.
Now, set_view_track module is only loaded into editor assets instead
of frontend assets.
closesodoo/odoo#74186
X-original-commit: b7d485cf0280d388cdaab1723ac759e53dea04fc
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
New system of ir.asset doesn't clear specific website asset on uninstall.
Now when we delete a website, we delete relate ir.asset.
task-2611030
closesodoo/odoo#74180
X-original-commit: 4e2df51a5f57bb8dde792e59295c20f3104bf4e2
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, some snippets that contains special charactere like –
was wrongly displayed, since we removed the call to pycompat that did a
decode('utf-8') in previous version.
closesodoo/odoo#74041
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Define `data-hotkey` on most used action buttons.
For the modals, the following keys are dedicated for "special"
actions:
- Alt+G: add
- Alt+V: save
- Alt+Z: cancel
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Prior to this commit, if we go to visitors form view and clicked on
stat buttons like offline/connected or visits, a traceback was
thrown because the buttons are meant for showing stat only, they
aren't linked to real actions / methods. It used to work before, but
the recent traceback is result of more strict checks from the web-client
re-write. See the original commit[1] for more information.
This commit sets 'disabled' attribute on the buttons, and keeps the action
from being performed for display-only stat buttons.
commit[1] - https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431
TaskID-2593552
closesodoo/odoo#73813
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>