Commit Graph
152883 Commits
Author SHA1 Message Date
Arthur Detroux (ard) c6524ee9d6 [FIX] website: adapt carousel options to BS5
Commit [1] migrated to Bootstrap 5 using automation. This mistakenly
changed attributes related to Snippet Options.
Commit [2] moved the website edition in the backend which created a
conflict with the tooltip system of the editor ([data-tooltip="true"])
and the tooltip system of the backend ([data-tooltip="content"]).

This commit fixes both these issues by changing the XML and removing the
related js code.

[1]: https://github.com/odoo/odoo/commit/1fcd098af5fa18e848c66bb83bdceb6ba0308512
[2]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#94564

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-10 20:28:49 +02:00
Arthur Detroux (ard) f7055d3dba [FIX] website: adapt bootstrap elements' options to iframe edition
Commit [1] moved the edition of website from the frontend to the backend
and in doing so, introduced an iframe from which the website is edited.
This broke some behaviours as the event binding for jQuery widgets (such
as the carousel) is no longer done from the same jQuery as the editor.
So bootstrap events triggered inside the iframe do not reach options
that are listening using the top window's jQuery (simple $()).

This commit adds the $bsTarget property to the SnippetOption class.
It wraps $target[0] using the iframe's jQuery instance.
This allows for options to listen to bootstrap events.
(using $bsTarget.on)

Options that were doing that previously are adapted by this commit.
(Carousel, Popup, Accordion (collapse))

Note: Popup was already adapted locally (by [2]), this commit only
changes its use of an $iframeTarget property to the $bsTarget one.

This commit also fixes "Add item" on accordion snippet to properly
assign a unique ID to the new tab.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:49 +02:00
Arthur Detroux (ard) ddf2e74b4c [FIX] website: fix gray color picker
Commit [1] changed the way styles are handled. Now that the edition of
website is done in an iframe, the styles are computed inside the iframe
instead of the top window / global document element.

But for computing the gray colors, a base style defined
by `web_editor/color_palette.scss` is needed. This style is not part of
the frontend assets, so using the iframe to fetch it creates bogus gray,
which results in the feature not working.

Steps to reproduce:
- Go on the website editor
- Select the THEME tab
- At the bottom expand the gray color picker
- Use the settings
- The preview is not updated while sliding.
- The colors are not updated in the page.

This commit fixes the bug by fetching the base style from the top
window (where backend assets are present).

[1]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Arthur Detroux (ard) 4292ed0e35 [FIX] website: re-enable action buttons when canceling discard dialog
Steps to reproduce:
- Go on website
- Click on edit
- Add a snippet
- Click on discard
- Close the popup using the 'X' at the top of the popup
- Buttons are still disabled

Commit [1] adapted the website dialogs to the OWL Api but also
introduced this bug.

This commit fixes that behaviour and re-enables the buttons
if the popup is closed.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Arthur Detroux (ard) 24ca4ae3fb [FIX] website: (re)start widgets on a cloned snippet
Commit [1] moved the website builder in the backend and in doing so
transferred event handling to the wysiwyg_adapter from the edit button
widget. Unfortunately, during that process, handling of event for
cloned snippets was forgotten.

This commit restores that and adds a test.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#94564
2022-08-10 20:28:48 +02:00
Chong Wang (cwg) 51c7734ef3 [IMP] base: allow non-administrators to search res.groups by names
before this commit:
users without read permission of ir.module.category cannot search
res.groups by names. An access error will be raised.

after this commit:
all users with read permission of res.groups can search res.groups
by names

closes odoo/odoo#97877

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-08-10 19:15:53 +02:00
Jorge Pinna Puissant ee9b28b546 [FIX] web: allow empty domains on arch
Since the new views, the empty domains on the archs were not be taking
into account.

Now, the empty domains are taken into account, this was the legacy
behaviour

closes odoo/odoo#97791

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-10 19:15:51 +02:00
Julien Castiaux f213f7e349 [IMP] core: support partial http response
An HTTP Partial Request is a regular GET request with a Range header
that indicate what chunk of the data the browser wishes to download. It
is useful to peek in a video stream or to resume an interrupted
download. The server can respond with a 206 - Partial Content response,
set the appropriate Content-Length and Content-Range headers and only
send a chunk of the data in the body.

Werkzeug's `send_file`, the library function we use to stream files over
http, is fully compliant with partial requests and responses. It
understands the Range request header and create the corresponding
response.

NGINX does also comply with the Range header even via X-Accel-Redirect.

closes odoo/odoo#97422

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-08-10 18:10:40 +02:00
Lucas Perais cceb205371 [FIX] web: legacy field retrieves noLabel from the legacy widget
Have a legacy field with the noLabel attribute to true (in the actual widget definition).
Put that field in a list view (new OWL framework).

Before this commit, the noLabel attribute was not taken into account.

After this commit, it is.

closes odoo/odoo#97899

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-10 16:08:24 +02:00
Yannick Tivisse e66995d5fa [IMP] hr_contract: Make contract type name translatable
closes odoo/odoo#97896

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-10 16:08:21 +02:00
sofiagvaladze 19364c79d7 [FIX] hr_expense: add default_partner_bank_id in context
The mistake was made in odoo#81904

Instead of 'default_partner_bank_id' we have 'partner_bank_id' in the
context of action_register_payment.

In this commit, we undo that mistake and also backport the change to v15.

task - 2774594

closes odoo/odoo#97886

X-original-commit: 5c8b74bb3bddd67b5a76d37f7d97a1d5d77c00c4
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-10 16:08:18 +02:00
sofiagvaladze aa8bfeca0c [IMP] sale_expense_margin: set purchase_price on sale.order.line for expense
Purpose: When re-invoicing the expense on the SO, the cost (purchase_price)
is not correctly set. For expenses with zero product it is set to zero,
and for the expenses with price on it, it is set to unit_price of the product.
As a result, the margin is calculated incorrectly on SO.

It should be set to the untaxed_amount of the expense in case of zero
product, or untaxed_amount of the product in case of a product with
price defined on it.

task - 2867723

closes odoo/odoo#96981

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-10 16:08:06 +02:00
sofiagvaladze 7abf1b33f0 [FIX] sale: always round price_unit
In case there is no need for currency conversion, the return value of
 _sale_get_invoice_price is not rounded. While, when currency conversion
takes place, the return value is rounded. First of all, the behavior is
not universal, It should be the same across these cases.
Secondly, not rounding the return value causes discrepancy when computing
margin (in the sale_margin module) for expense products; as price_unit
is not rounded (in the first case), while purchase_price is rounded.

task - 2867723

Part-of: odoo/odoo#96981
2022-08-10 16:08:06 +02:00
Younn Olivier 6673a9c965 [FIX] web_editor, website: update toolbar visibility in translate mode
Before this commit, in translate mode, the toolbar and the
table-container were shown when initializing the SnippetsMenu (and
removed for a click on an element that was not a translation).

To reproduce:
-> Install another language on website 1,
-> Click on translate
-> Click on a button of the informative dialog
-> The toolbar was there, then was removed on the click on the dialog,
and won't reappear.

(If the informative dialog is not shown, because it was permanently
dismissed, click on an image, the toolbar is still there and won't be
removed).

To fix that, the clicks on translations elements are not stopped from
the TranslatePageMenu and are taken into account in
_checkEditorToolbarVisibility to show/hide the toolbar.

Related to task-2687506

closes odoo/odoo#97855

X-original-commit: fbe35ed2f4c0727d097227fa6decf544f5db27fe
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-10 14:44:02 +02:00
Nshimiyimana Séna d0d9d09216 [FIX] sale: set correct invoice status
Steps to reproduce:
- Create a quotation
- Add a product that is invoiced on "ordered quantities" and set the
  quantity to a negative number.
- Leave 'delivered' to 0
- Confirm the quotation
- Create the Invoice and validate it.
- Go to the SO list view (Orders > Orders)

You should see that the Invoice Status of the order you just created is
'Upselling Opportunity', which is not correct.

Why this is happening:

Here's an explanation on the 'Upselling Opportunity' state (found in
the code):
" upselling: this is possible only for a product invoiced on ordered
quantities for which *we delivered more than expected.* "

In our case, the invoice line's state is set to 'upselling'
because we have a negative ordered quantity and a zero delivered
quantity (i.e. we delivered more than expected)

opw-2895218

closes odoo/odoo#97830

X-original-commit: 5f10583336bf39430a304e2c47dfd0310ee4fa3d
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-08-10 14:43:59 +02:00
Lucas Perais 312b9b1502 [FIX] web: correctly compile invisible when t-if already exists
Have a section of a settings view that can be search in.
Have a dynamic invisble modifier (governed by a domain) on it.

Before this commit, the condition were just juxtaposed, which will cause problem
if one of them contains a "OR" operator. So, sections that should have been invisible were visible
because the if looked like: search() or search_other() and isVisible().

After this commit, the t-ifs are correctly combined so that they look like:
(search() or search_other()) and isVisible().

closes odoo/odoo#97811

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-10 14:43:55 +02:00
tsm-odoo 6d9ff04a18 [FIX] mail: fix compute audio triggered on each qunit test
During qunit test, the audio notification is never used but the audio
element is still computed. This leads to unnecessary get requests
being triggered on the server. This PR prevent computing the audio
field of the user_notification_manager if canAudio is set to false.

closes odoo/odoo#97785

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-10 14:43:52 +02:00
Lucas Perais 0c4603d0fe [FIX] web: field help attribute in xml has precedence
Have a field declared in python with a "help" property.
Put that field in a view with a "help" attribute.

Before this commit, the xml declaration was not taken into account.

After this commit, xml declaration has precedence over the python one.

closes odoo/odoo#97782

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-10 14:43:48 +02:00
Lucas Perais 00fff80858 [FIX] web: one2many in kanban can remove a new record
Have a one2many in a form view. It displays its records with a kanban.
Add a record, now click on that new record.

Before this commit, there was not "Remove" button, preventing to effectively
remove a new (virtual at this point) record from the one2many.

Aftet this commit, there is a remove button that effectively removes the
record from the one2many.

closes odoo/odoo#97775

Signed-off-by: FrancoisGe <fge@odoo.com>
2022-08-10 14:43:45 +02:00
tsm-odoo d5234c314e [IMP] bus, calendar: remove longpolling polls in tests
In order to prepare the ground/reduce the noise in the PR
introducing the websockets in Odoo, the mocks of the longpolling
route in tests is replaced by calls to sendone/sendmany.
This will allow to keep the same code while changing the underlying
technology.

task-2053917

closes odoo/odoo#97771

Related: odoo/enterprise#30244
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-08-10 14:43:41 +02:00
tsm-odoo 75007b578e [MOV] bus, *: move startServer test helper to the bus module
*: calendar, hr, hr_holidays, im_livechat, note, rating, snailmail,
test_mail, test_mail_full, website_livechat, website_slides.

Part-of: odoo/odoo#97771
2022-08-10 14:43:41 +02:00
Rémy Voet (ryv) bfc2e76af2 [IMP] base: add index on key of ir_ui_view
The `key` field is often (`_get_view_id`/`_get_specific_views`) used to
find an ir_ui_view. Because `key` doesn't have index, PostgreSQL will
always do a SeqScan. Because the table is small, it doesn't create a
huge performance bottleneck, but it still not very efficient.

closes odoo/odoo#97478

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-08-10 14:43:26 +02:00
Brieuc-brd 6cc7f6bf09 [IMP] gamification: fine tune layout
This commit improves the layout to keep consistency.

task-2938963

closes odoo/odoo#97192

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-10 14:43:23 +02:00
Brieuc-brd c86d2fe419 [REF] gamification: review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2938963

Part-of: odoo/odoo#97192
2022-08-10 14:43:22 +02:00
Morgane (morm) eb71a1baa1 [IMP] purchase: scss revamp
Prior to this commit, the dashboard was a table and there was
unnecessary scss.
This commit changes the table into the new bs5 grids
and clean the scss files.
In the portal view, a class(orders_label_text_align) that didn't affect
the design was removed.

task-2906527

closes odoo/odoo#95902

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-10 14:43:12 +02:00
Morgane (morm) 6f68fe2e02 [IMP] web: enable Bootstrap 5.1 CSS Grid classes
Part-of: odoo/odoo#95902
2022-08-10 14:43:12 +02:00
Rémy Voet (ryv) 63b2790eac [IMP] core: improve compilation result of qweb
`content = self._compile_to_str(content)` is done twice in the compiled
method of qweb. Remove it once.

closes odoo/odoo#95755

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-08-10 14:43:07 +02:00
Rémy Voet (ryv) ef35a33300 [FIX] web: never cache the CSRF token
"website.layout" inherit of "portal.frontend_layout" which inherit of
"web.layout" which contains the creation of the CSRF token.
Add because "website.layout" add a t-cache key, the CSRF token is under
this cache key. But the CSRF token should be always generated,
then add t-nocache on CSRF token t-set.

Part-of: odoo/odoo#95755
2022-08-10 14:43:07 +02:00
Jeremy Kersten 75e1d93344 [IMP] google_calendar: rename google_cal[endar]_account_id
Rename from google_cal_account_id to google_calendar_account_id, to have
the complete 'service' name into the field and allow to use it from a
generic way in oauth2callback from google_account e.g.

task-2497212
pr-95744

closes odoo/odoo#95744

Related: odoo/upgrade#3673
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-08-10 14:43:02 +02:00
Jeremy Kersten 05b409f8f1 [REF] google_account, google_calendar: clean and make it overridable
This commit removes outdated method no more used since we delete oog
apps like gdrive.
This commit remove the logging of sensitive infos.
This commit allows to override easily api key.

task-2497212
pr-95744

Part-of: odoo/odoo#95744
2022-08-10 14:43:01 +02:00
Nguyen Hong Quang 034b72fe79 [FIX] base_setup: replace id for module_microsoft_calendar in
configuration

Currently, Outlook and Google calendar having same container `id`.
This PR will fix that problem

closes odoo/odoo#97858

X-original-commit: 757cf027afb5eaa1ac831b8dda6664edd45c6a69
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-08-10 13:23:56 +02:00
Ahmad Khanalizadeh ea4ee4e7ef [IMP] point_of_sale: better error message for identify customer failure
Before this commit if Identify Customer option was enabled for a
payment method in point of sale but no customer was set for an order,
we get a SQL constraint error that has no hints on where the problem
comes from.

This process can be improved by a better error message that directly
points out the problem.

opw-2907152

closes odoo/odoo#97566

X-original-commit: 06c8765d362f81aa92f25029cb5d4e9d4069b3d3
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-08-10 13:23:53 +02:00
Dardenne Florent (dafl) 22133a01be [IMP] web: add cumulative line chart
The cumulative option on line chart is useful for displaying
cumulative information graphically.

closes odoo/odoo#97394

Task-id: 2146487
Signed-off-by: FrancoisGe <fge@odoo.com>
2022-08-10 12:07:19 +02:00
Dardenne Florent (dafl) cef8cf87b4 [REF] web: eslint syntax applied on views/graph
Part-of: odoo/odoo#97394
2022-08-10 12:07:19 +02:00
Samuel Degueldre 8676fed6a7 [FIX] survey: fix broken questions in form view
With the conversion to the new views, legacy x2many fields go through a
thin and incomplete compatibility layer to talk to the new model. This
compatibility layer is not very robust and as such most custom x2many
fields are broken in this configuration, in this case the field
"question_page_one2many".

The proper fix is to convert this field widget, but in the mean time,
the simple fix is to force this view to keep using the legacy view
instead of the new view.

closes odoo/odoo#97868

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-08-10 09:21:28 +02:00
Jinjiu Liu 371ccb5ddb [FIX] website_slides: add style to the side bar container
Reproduction:
1. Install Website and eLearning
2. Add new language Dutch
3. Modify the course responsible’s name as “Gertjan Kleinbloesem” in
eLearning
4. Open the course page in the website app and switch to Dutch, the
responsible name is over flowed

Reason: The background container doesn’t adapt to the length of the text

Fix: Add text break to the responsible's name so it won't break the
style

opw-2862250

closes odoo/odoo#97839

X-original-commit: bb2045f77ee7383af85b2d65c015d91f92b20647
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2022-08-10 09:21:25 +02:00
Benoit Socias 19e4f1a856 [REV] web_editor: not add a zero-width space on top of color palettes
Since [1] a zero-width space is added inside all `we-selection-items`.
This breaks the layout of color palettes because zero-width spaces
still have a height, and are not considered as empty text.

This reverts commit e59ad49cb9f32240d8ca3c89fc20ab200e291adc.

based on:

https://github.com/odoo/odoo/pull/97382#issuecomment-1208015098

[1]: https://github.com/odoo/odoo/commit/e59ad49cb9f32240d8ca3c89fc20ab200e291adc

task-2919573

closes odoo/odoo#97829

X-original-commit: 2091bce403368003add4b01eaafaea051c758e27
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-10 09:21:19 +02:00
Antoine Guenet 696f4dc753 [IMP] web_editor: prevent crash with wrongly defined commands
The Powerbox crashed whenever a command was wrongly defined. That's a
bit too brutal so this sets defaults instead.

closes odoo/odoo#97794

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-10 09:21:16 +02:00
Antoine Guenet 9263db52a1 [FIX] web_editor: properly define the signature command
The signature command was using the wrong property names, leading to the
Powerbox crashing.

Part-of: odoo/odoo#97794
2022-08-10 09:21:15 +02:00
Swapnesh e5eb93f36b [CLA] add swapnesh to Mainframe Monkey's contributors
closes odoo/odoo#97856

X-original-commit: 02238b06cf6759d68637dbcc10b0021be9403ffe
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-10 08:09:56 +02:00
Jeremy Kersten 2e170ca07b [FIX] website_sale_autocomplete: fix alignment logo powered
pull-right is not standard Bootstrap 3.

closes odoo/odoo#97851

X-original-commit: 1098377b4e8fff4400c03da405903d9ba246dbd8
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-08-10 04:27:42 +02:00
Martin Trigaux b821961236 [I18N] *: sync fr_BE translation terms
Only for terms containing Credit Note and expenses

closes odoo/odoo#97840

X-original-commit: 1754b094a66476a0bdb29fe60dc5583c03336c3f
Related: odoo/enterprise#30262
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-10 03:11:53 +02:00
Pierre Masereel 10142fc0d8 [FIX] account: display invoice lines
When you print or preview an invoice, the lines with the product are not
displayed. Before changes made in PR: https://github.com/odoo/odoo/pull/96134
the lines containing products didin't have a display_type.

Since those recent changes, their type is product, so we are now
checking that they are of display_type 'prodcuct' instead of having the
display_type to false

closes odoo/odoo#97862

Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-08-10 01:59:54 +02:00
Pierre Masereel e149bdcd4b [FIX] account: remove useless attribute start in sum
Using named attribute 'start' in sum function is not compatible with
python 3.7, it is also set as 'start=0' which is useless as it is the
default value of start argument.

Part-of: odoo/odoo#97862
2022-08-10 01:59:53 +02:00
Pierre Masereel 7a4dea6e10 [FIX] account: fix lru_cache call
lru_cach must be called to properly work with python 3.7, so we call it
as it is in other lru_cach decorators.

As explained here in python 3.8 changes: https://docs.python.org/3/whatsnew/3.8.html#functools

Part-of: odoo/odoo#97862
2022-08-10 01:59:53 +02:00
Hubert Van de Walle (huvw) a5752e1e65 [FIX] web: parseMonetary with NBSP as a thousands separator and no currency
Steps to reproduce:

  - Switch language to french
  - Refresh the page
  - Create a new payment
  - Select a partner
  - Enter an amount of 100000,00
  - Save the record
  -> The following field is incorrect: amount

Cause of the issue:

 Since https://github.com/odoo/odoo/pull/97425 ,
 `parseMonetary` wrongly assumed that a currency was always passed in
 the parameters

opw-2937403

closes odoo/odoo#97861

X-original-commit: 9d518f847d2204fc5159a92bc4e4de655acf88fa
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-08-10 01:59:48 +02:00
Lucas Perais be4b211ffe [FIX] web: ask to save new record before translating
Fixup for 4caa9596bc, where a rebase went bad.

Have a translatable field in a form view.
Create a new record with that form view.
Click on the button to open translations for that field.

Before this commit, the record was not before opening the translation dialog, hence
changing the translations could not work properly.

After this commit, this feature is back, and we ask to save a new record before
opening the translation dialog.

closes odoo/odoo#97824

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-08-09 22:48:53 +02:00
mafo-odoo 076ef38282 [FIX] website_sale_delivery: no carrier change if there is a valid transaction
Issue:
Customers can use Mollie and lower the price on a quotation through changing the
delivery method, if they have two pages "/shop/payment" and proceed with payment
on one they can still change the carrier on the second. Although the quotation is
not confirmed because of mismatching amount, a confirmation email is still sent
and a bank payment is still created. Please see the following test video.

Solution:
We add a check so that changing a carrier can only be done when a no active/done
transaction is linked to the sale order.

opw-2925673

closes odoo/odoo#97818

X-original-commit: 151edb7d088ec9e5ea10fa8f184c7cb3a030a6ab
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-09 22:48:50 +02:00
Aurélien Warnon bdf06ed3a3 [FIX] website_event_track: avoid showing an empty agenda
Oversight of: 129b91027700313066db0305876adcf9b2a3817d

If the view is not up to date, it will not display any agenda locations.
We need to keep the 'locations' key into the returned values for code
retro-compatibility.

Task-2942630

closes odoo/odoo#97751

X-original-commit: 6c72297e72e0936e5564f175dcb1716057e0ac4b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-09 11:32:17 +02:00
Benoit Socias 5ad3451b37 [FIX] website: avoid double-escape of pages search results
Since [1] when the search bar was refactored, a search facility was
added on website pages and the rendering of those search results did
not correctly handle the HTML escaping.

This is related to the fact that the `ir_ui_view`'s `arch_db` field is
stored with this double escaping on text nodes, which is done by
`wysiwyg.js` through the `_getEscapedElement` method since [2].

This commit unescapes the last layer of `&amp;` before extracting the
page's text for generating the search results.

Steps to reproduce:
- Add some "&", "<" or ">" characters in a page.
- Use the search snippet to lookup for the page.
=> The results in both autocomplete and the results pages display the
content with an extra unwanted escaping (&amp;...)

[1]: https://github.com/odoo/odoo/commit/9f9c4bb7e40233e633f97c60fb00ae191e9077af
[2]: https://github.com/odoo/odoo/commit/f5acea7f9ce232773ec3adf1828a3d18bbedee1e

opw-2908645

closes odoo/odoo#97748

X-original-commit: 2b95dcdb0d8b49bac8ee38a8d062112468124012
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2022-08-09 11:32:14 +02:00