Commit Graph
152817 Commits
Author SHA1 Message Date
Jairo Llopis 4f5491b347 [FIX] account: extensible subtree views
Both the CE and EE web clients don't support proper responsivity when a subtree view is inside a `<group>`.

By removing them (they were unnecessary anyway) we recover proper responsivity in these views.

@moduon MT-688 OPW-2843895

closes odoo/odoo#90946

Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-05 12:42:25 +02:00
Touati Djamel (otd) 024ee89678 [FIX] product_expiry: filter quants by expiration alert date
Steps to reproduce the bug:
- Enable “Expiration date” in inventory settings
- Create a Storable product “P1”
    - Tracking: by serial number
    - Enable the expiration date option
    - Update the quantity:
        - Create a new Lot “SN1”:
            - select today's date as the alert date

- Go to inventory > reporting > Inventory Report
- Try to filter by “Expiration Alerts”

Problem:
The product P1 is not selected, because the filter checks the removal
date instead of the alert date

Solution:
The filter should check if the alert date is less than or equal
to today's date to display products or not, as it is for lots:
https://github.com/odoo/odoo/blob/14.0/addons/product_expiry/views/production_lot_views.xml#L30-L39

opw-2889737

closes odoo/odoo#95289

X-original-commit: 1c04bc5407f02c7299b86a7f4fef207f4aa01c77
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-07-05 11:35:25 +02:00
Aaron Bohy e37a663b52 [FIX] web,*: kanban: support t-set defined outside cards
*base, event, hr_holidays

Before this commit, `<t t-set/>` nodes declared outside the main
div of a kanban card where ignored by the kanban compiler. This
commit fixes that issue. To do so, we refactor a bit the way the
compiler and KanbanRecord handle multiple root cards (typically,
several roots with a t-if/t-elif/t-else, s.t. there's a unique
rendered root), by removing the faulty logic from the compiler
that identified card root nodes (and filtered out t-set nodes),
and introducing a div for the KanbanRecord component on which we
can set classNames, attributes and handlers.

The issue could be observed on the Apps kanban view, as it
displayed the "Install" button, whether the app was already
installed or not.

closes odoo/odoo#95211

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-07-05 11:35:16 +02:00
Xavier-Do 61f54e5b88 [FIX] profiler: make profiler work with freezegun
When freezegun is used, the profiler and sql_db time are freezed,
Making the profile and sql perf counters invalids.

A possible solution would be to black list some modules in freezegun but
this doens't look possible in the pinned version (0.3.x).

Saving the builtin time.time is not enough, it looks like freezegun will
find all occurences and replace them.
We need to get the __call__ instead.

closes odoo/odoo#95100

X-original-commit: 9ac5fdf1e6d00e6e4b4ff4b6e94a3cd28f8cae11
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-07-05 11:35:13 +02:00
akr 4aca2aef60 [FIX]l10n_eg_edi_eta: Add auto-init to avoid compute timing out
closes odoo/odoo#94323

X-original-commit: c7ce276b2e5822091ff02962a04034f2c66b3d77
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-07-05 11:35:04 +02:00
Raphael ColletandVincent Schippefilt eb67feb590 [FIX] *: cache consistency
In module mail, invalidating 'message_ids' on a mail thread also
invalidates its inverse field 'res_id' on messages.  If you haven't
flushed it before, your cache will be inconsistent, as shown by the test
/mail:TestMailgateway.test_message_process_bounce_records_channel.

In module purchase_stock, add depends on report.stock.quantity.  This
ensures that when the model is queried after changes in other models,
the data on which the SQL view depends is flushed to the database before
querying that model's table.

closes odoo/odoo#66938

Related: odoo/enterprise#16722
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2022-07-05 11:35:01 +02:00
Raphael Collet 9c3b9a4926 [FIX] core: automatically flush upon invalidation for cache consistency
Because method _read() no longer updates existing values in memory,
those values in memory must be consistent with the database.

On the other hand, if pending updates are not performed on the database
before fetching values, it means that the corresponding database values
cannot be put in cache.  This implies that one cannot empty the cache
without flushing the corresponding fields.

In order to avoid mistakes, flush automatically before invalidating the
cache.  This makes the invalidation methods safe by default, and avoids
cargo-culting which would systematically associate invalidation to
flushing, which may eventually be less performant.

Part-of: odoo/odoo#66938
2022-07-05 11:35:00 +02:00
Raphael Collet a91cb08c5d [IMP] core: avoid flushing fields to read
The idea is to avoid flushing the fields to fetch in method _read().
This delays UPDATE queries, and makes the prefetching mechanism simpler
and more effective.

We do this by not overwriting the cache values by the values fetched
from database.  This simple idea allows to fetch more fields and more
records without having to care about pending computations and updates.
But it requires the cache consistency to be much more strict, because
nothing will "fix" the cache inconsistencies "by chance".  And it also
requires pending updates to be present in cache.

Part-of: odoo/odoo#66938
2022-07-05 11:35:00 +02:00
Raphael Collet 0728b78c68 [IMP] core: improve code of fields
Part-of: odoo/odoo#66938
2022-07-05 11:35:00 +02:00
Raphael Collet 206f6924dd [IMP] core: improve code of method _read()
Add a test to document the suboptimal behavior of the prefetching
mechanism in the presence of fields to compute.

Part-of: odoo/odoo#66938
2022-07-05 11:35:00 +02:00
Raphael Collet 9f6be9321c [IMP] core: reimplement cache check in pure SQL
This allows checking that the ORM keeps the cache consistent without
relying on it for the check.

Part-of: odoo/odoo#66938
2022-07-05 11:34:59 +02:00
Raphael Collet d86e582283 [IMP] core: move class Query to odoo.tools
Move the definition of class Query to odoo.tools, in order to avoid
circular imports when importing Query in core Odoo modules.

Also reorganize imports in the impacted modules.

Part-of: odoo/odoo#66938
2022-07-05 11:34:59 +02:00
Joseph Caburnay ca2531d9c3 [FIX] pos_sale: fix screen to show
Because MobileSaleOrderManagementScreen is rendered inside
SaleOrderManagementScreen, the `useListener` calls in
SaleOrderManagementScreen are called twice. This is because
MobileSaleOrderManagementScreen is derived from
SaleOrderManagementScreen. Because of this, when an event is triggered
in the SaleOrderManagementScreen, say the 'click-sale-order', the
handlers are called twice. To fix this, we should not render
MobileSaleOrderManagementScreen inside the SaleOrderManagementScreen
anymore. Instead, depending on the screen size of the device, identified
using `env.isMobile`, we show the appropriate screen, that is, when
`isMobile` is true, we show MobileSaleOrderManagementScreen otherwise,
we show SaleOrderManagementScreen.

closes odoo/odoo#95282

X-original-commit: 6a8a43d09a798be3dfc5581561b67bc5c5521634
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-07-05 00:50:53 +02:00
Joseph Caburnay ac4bf1ba5f [FIX] pos_sale: always start with the default domain
When opening the sale order management screen, we should always start
with the default domain so that we don't have instances where fully-paid
sale orders show in the screen.

X-original-commit: 5b8cff6a545d1fb3ee614cdd347e0aa463dc8a5e
Part-of: odoo/odoo#95282
2022-07-05 00:50:52 +02:00
Joseph Caburnay 5dca98315a [FIX] pos_sale: properly show sale order screen
When in mobile view, the sale order management screen don't show when
clicking the Quotations button.

This change fixes this problem. Check the comments in the changes for
more details.

X-original-commit: 4ac8c363213dec747a7ca1bf5f2b22c6e2c6abf2
Part-of: odoo/odoo#95282
2022-07-05 00:50:52 +02:00
Joseph Caburnay 424635bf1b [FIX] pos_sale: misspelled setup method
Because the setup method is not properly executed, sale order management
screen crashes when viewed in mobile screen.

X-original-commit: c27716c97c4d32bb0b12f3772ea55941fa423c63
Part-of: odoo/odoo#95282
2022-07-05 00:50:52 +02:00
Andrea Grazioso (agr-odoo) 691ef8e9f7 [FIX] l10n_latam_invoice_document: wrong name on batch post
Have a Peru company setup
Create 2+ draft invoices of mixed type 'Boleta' and 'Factura'
In list view select the created moves and do action>"post entries"

The posted entries will have the same name prefix, either all 'BOL' or
'FFI', depending on the first computed name, the system will use the
same prefix for the remaining move names

opw-2860231

closes odoo/odoo#95271

X-original-commit: d7a5b34e46436f49592ab6706ac33bcf7a3fbf80
Signed-off-by: William André (wan) <wan@odoo.com>
2022-07-04 19:57:51 +02:00
MerlinGuillaume 2afe14fbc5 [FIX] l10n_es_edi_sii: allow any user to send invoices to the SII
Only users with admin rights are able to confirm and send an invoice to
the SII

Steps to reproduce:
1. Install l10n_es_edi_sii module
2. Switch to company 'ES Company'
3. Go to Settings > Invoicing > Spain Localization > Registro de Libros
   connection SII and select 'Hacienda Foral de Gipuzkoa'
4. Go to Invoicing > Configuration > Accounting > Journals and open
   'Customer Invoices'. In the 'Advanced Settings' tab, enable EDI
   functionality 'SII IVA Llevanza de libros registro (ES)'
5. Go to Invoicing > Configuration > Spain > Certificate (ES) and import
   the certificate (file named sello_entidad_act.p12 in
   l10n_es_edi_sii/demo/certificates/) with password "IZDesa2021"
6. Connect as demo in 'ES Company'
7. Create an invoice with any customer and product and confirm it
8. Click on 'Send now', an access error is raised

Solution:
Call `_decode_certificate` with sudo to allow any user to send invoices
to the SII

opw-2767288

closes odoo/odoo#95259

X-original-commit: e3f768c854b41c91de399597f42685eca9534539
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-07-04 18:53:35 +02:00
hoangtiendung 609ebb86e2 [FIX] purchase: Wrong statistics RFQs Sent Last 7 Days
Issues
------
Purchase Dashboard gives wong value for PO in RFQ and RFQ sent when
user's language is not English

Current behavior before PR:
---------------------------
1. Create some RFQ and RFQ Sent to see its statistic in dashboard
2. Swith user language to another one that is other than English
3. Statistic in the dashboard is wrong now

Solution
--------
Passing translated RFQ and RFQ Sent into the dashboard query in stead of
passing pure text without translation.

closes odoo/odoo#95248

X-original-commit: ba8ad25b413151544b85477c9aae858e99c6cfaf
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-07-04 18:53:31 +02:00
Sébastien Theys 637c57cb14 [IMP] mail: remove _delegateEvents fix
The bug this code was supposed to fix is no longer reproducible following
recent improvements in the rest of the code.

Part of task-2871070

closes odoo/odoo#95218

Related: odoo/enterprise#29077
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-07-04 18:53:22 +02:00
Sébastien Theys ee0b42d4b6 [IMP] mail: remove useless condition on attachmentsInWebClientView
`attachmentsInWebClientView` is necessarily true if `hasAttachmentViewer` is
true above

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 935ca62a1f [IMP] mail: remove _updateChatterContainerTarget
It is only called inside `_interchangeChatter`, therefore its code can be moved.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 7fd20304ea [IMP] mail: remove useless _updateChatterContainerTarget
None of the values that changes the result of this method have changed in this
case.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys c7b6299dd0 [IMP] mail: move _interchangeChatter to _updateView
This allows removing the _renderView override and opens up further clean up.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:21 +02:00
Sébastien Theys 18efe5383b [FIX] mail: properly position the chatter inside form sheet
task-2900627
part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys d5221153f3 [IMP] mail: read thread from state rather than event
Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys 9c0a2df0ff [IMP] mail: move _onChatterRendered to community
This will reduce the overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Sébastien Theys b9abc680d9 [IMP] mail: move _interchangeChatter to community
This will allow to reduce the number of overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#95218
2022-07-04 18:53:20 +02:00
Antoine Guenet 6d428bce03 [REM] web_editor: remove Odoo Editor demo and README
When Odoo Editor was in a separate repository, it made sense to have a
separate demo page and README file. It doesn't anymore.

closes odoo/odoo#94516

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-07-04 18:53:07 +02:00
Antoine Guenet ae7110f44e [IMP] web_editor: add route for Odoo Editor tests
Loading assets for Odoo Editor's tests was a problematic matter since
some were in the lib folder while others were in src. This solves that
issue by finally creating a route for these tests, like web has one for
QUnit tests.

Part-of: odoo/odoo#94516
2022-07-04 18:53:07 +02:00
Antoine Guenet 62590e7c60 [FIX] web, test_lint: add editor libs global constants to eslint config
Odoo Editor uses chai/mocha for testing. Since it was moved into Odoo,
we need chai's global constants to be recognized by eslint. The same
thing applies to DOMPurify.

Part-of: odoo/odoo#94516
2022-07-04 18:53:06 +02:00
Antoine Guenet c35cee3078 [FIX] web_editor: remove prettier configuration
Odoo Editor had a custom prettier configuration when it was a separate
repository. We don't need it anymore.

Part-of: odoo/odoo#94516
2022-07-04 18:53:06 +02:00
Antoine Guenet 9b4ff416b2 [MOV] web_editor: move DOMPurify to the lib directory
DOMPurify is a library but it was mixed in with Odoo code.

Part-of: odoo/odoo#94516
2022-07-04 18:53:06 +02:00
Antoine Guenet 24f4f74a4e [FIX] web_editor: remove unused variables
Some variables were defined but never used, causing eslint tests to
break.

Part-of: odoo/odoo#94516
2022-07-04 18:53:06 +02:00
Antoine Guenet 920cffdd96 [MOV] web_editor, knowledge, mass_mailing, website: editor lib to src
Odoo-Editor, having originally been developed with the purpose of being
a standalone library, was put into a `lib` folder. Since in the meantime
the library plans were aborted and since its presence outside the `src`
directory makes translations unavailable for it, this moves the editor
to `src/js/editor/odoo-editor`.

task-2880723

Part-of: odoo/odoo#94516
2022-07-04 18:53:05 +02:00
Abdelouahab (abla) d126f01e30 [FIX] account : add current assets to default bank supense account
Purpose
=======

possible values of Default Bank Supense Account (in accounting settings) are Current Liabilities
when they must be Current Assets.

Specification
=============

to solve the issue we added Current Assets to the possible values of this field.

opw-2855788

closes odoo/odoo#95233

X-original-commit: 2730b80942d3d32f72bae922cb06a61ecfa38c0f
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-07-04 16:44:55 +02:00
Achraf (abz) 353a837d9a [FIX] website_sale: Prevent displaying categories from other websites
Steps:
    - Go to website/configuration/ecommerce categories
    - Change `Chairs` website to `Website`
    - Go to `Website 2`/shop
    - Write `ch` in the search bar

Autocomplete returns `Chairs` even if it's not available in `Website 2`

opw-2884856

closes odoo/odoo#95219

X-original-commit: 2f99929accc4b71156d235019f7b78a2dd4c75e5
Signed-off-by: Achraf <abz@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-04 15:24:14 +02:00
luvi 42eb0f6656 [FIX] web: ImageField zoom and preview_image options
This commit fixes the behavior of the tooltip
enabled by the zoom option which displays
the full image when the field is hovered.

Before the commit, the preview_image option was
not used by the field and the full value was used
for both the field image and the tooltip.

A test has been introduced to check that the
field uses the right images sources when both
attributes are present.

closes odoo/odoo#95208

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 15:24:11 +02:00
Guillaume (gdi) 2050328a37 [FIX] website: fix footer slideout animations
This commit ensures that the slideout footer is visible by the visitor
before start its animations. Now to start an option in the footer
slideout, you have to scroll enough for the element to be visible.

Steps to reproduce the fixed bug:
 - Enter edit mode
 - click on the footer
 - choose a slideout effect other than "Regular"
 - set an animation to an item inside the footer and select "Everytime"
 in Animation Launch

=> the element is animated only once on page load (because the footer is
actually directly in the viewport but behind the content of the page)

task-2878421

closes odoo/odoo#93133

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-07-04 15:23:59 +02:00
Mathieu Duckerts-Antoine 1d23ebf95e [FIX] web: search model: groupBy not in searchMenuTypes
The search model should always return [] as groupBy if searchMenuTypes
does not contain "groupBy". This allows a kanban view (for instance) to
define easily that it should not never be grouped.

closes odoo/odoo#95179

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 14:08:12 +02:00
Antoine Vandevenne (anv) 66f204ecd3 [PRF] payment_adyen: only load the SDK on pages with a payment form
The SDK of Adyen Checkout is quite large (≲ 1MB) and was always loaded
on all frontend pages before this commit, which hurt the loading
performances.

This commit restricts the loading of the SDK to pages that include one
of the payment forms (either 'checkout' or 'manage').

task-2899271

closes odoo/odoo#95121

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-04 14:08:07 +02:00
Romeo Fragomeli f773ba8a51 [FIX] web: missing/linting ending square brackets
Interrestingly enough, those missing ending square bracketsdoesn't have
consequences on the way the browser interprets these attribute
selectors... Anyway, for consistency sake, let's close them properly.

closes odoo/odoo#95070

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-07-04 14:08:04 +02:00
Romeo Fragomeli 82ee3503a4 [FIX] web: missing/linting semicolon
Interrestingly enough, this missing semicolon doesn't have consequences
in the CSS bundle generated... Anyway, linter will be happy.

Part-of: odoo/odoo#95070
2022-07-04 14:08:03 +02:00
Géry Debongnie 74965b6298 [IMP] web: delay showing loading indicator by 250ms
Before this commit, the loading indicator is shown immediately after
each network request.  But this is distracting, and may cause an
impression of slowness, since it shows that the web client is working.
However, the feedback is very useful.

So, it has been decided that we would only display the loading indicater
after a delay of 250ms. All requests shorter than that duration will
just not show anything.

closes odoo/odoo#95037

Task: 2900450
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-07-04 14:07:54 +02:00
Jeremy Kersten 0943722c32 [FIX] *: use request.redirect instead of werkzeug.utils.redirect
It allows to always have a OdooResponse Object and don't allow redirect
to external except when you allow it explicitly with local=False.

Always return to a local url:
    /website/add
    /slides/slide/<model("slide.slide"):slide>
    /microsoft_outlook/confirm

Allow previously external redirect without reason, now blocked
   /website/lang/<lang> -> open redirect

Allow external redirect for good reason and url is controlled by code.
   /social_facebook/redirect_to_profile/

PS: HTTP Code 303 is a better default for generic redirects. It's not
historically the default for werkzeug.utils, but it is what we want in
general. Contrary to 302, there is no browser-dependent behavior, and
no risk of asking the user whether they want to accept the redirect if
the original method wasn't GET. It's always a non-permanent GET on the
target location.

closes odoo/odoo#95019

X-original-commit: 77f8d9c5d96a9274785ffc2ad83b95ea157d26ad
Related: odoo/enterprise#29000
Signed-off-by: Olivier Dony <odo@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-07-04 14:07:45 +02:00
Romain Derie 13efb309b4 [FIX] website: correct the website editor tour
Introduced with [1] the goal of this tour was to check some lazy loading
stuff regarding the edit mode.
It was then "wrongly" adapted with [2] where the tour actually still
started in the frontend and then clicked on a the new UI button (top
left floating icon of the frontend > backend task) to indirectly enter
edit mode.
While it was working, that's not what the test was aiming to test. The
test should remain as it was, testing the edit mode. While the edit btn
is now in the backend and not the frontend, the tour should just start
there.

Note that this commit is required as the behavior the tour was now
relying on is removed by the previous commit: the Edit button is not
entering edit mode anymore.
Instead of adding a new step to click on the Edit btn, let's just start
the tour as before on the step where you can click on Edit.
It will make the test less dependent of other behavior. This is
especially true since that frontend "Edit" button will most likely
change again or be removed (and introduced back?). We don't want the
tour to rely on this.
If those new UI button need to be tested, it should be in another test.

[1]: https://github.com/odoo/odoo/commit/6f4c60fe1bb6e460ec6da00c59a9825271893729
[2]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35

closes odoo/odoo#95002

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-07-04 14:07:41 +02:00
stefanorigano (SRI) 67b1721c0d [IMP] portal, website: user-dropdown adaptations
As result of moving the "website into the backend" [1], two new entries
have been added in the user-dropdown: one that redirects to the
backend ("Apps") and another one to edit the current page ("Configure
this page").

This commit removes the one to edit, since the same action it's already
in the floating nav (.o_frontend_to_backend_nav) and keeping two
actions would have be redundant.

For the same reason the "Apps" one could have been removed too, but it
has been decided to keep it to ease lambda users' efforts to find their
way to the backend.

This commit refines the design too, adding icons for all entries and
adapting the user-dropdown layout.

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

task-2898212

Part-of: odoo/odoo#95002
2022-07-04 14:07:41 +02:00
stefanorigano (SRI) 2b07d2eb67 [IMP] website: o_frontend_to_backend_nav design adaptations
As result of moving the "website into the backend" [1], a new floating
nav has been introduced allowing the user to go to the apps_switcher
or to edit the current page.

This commit slightly refine the design and changes the animation
behavior that it's now triggered on :hover rather than onClick.
It also changes the "Edit" btn url that it's now pointing to the backend
rather than to the editor.

As positive side-effect, these changes improves mobile's UX, allowing to
toggle-back the navbar by simply touching the outside area.
Also, thanks to the use of SVG, it solves the annoying issue of .fa
icons transformations forced to 'none' on mobile.

note: as a preexisting FIXME note says, an xml template should be
created for this component. This commit is intended to improve the
behavior with the current temporary implementation.

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

task-2898212

Part-of: odoo/odoo#95002
2022-07-04 14:07:41 +02:00
Younn Olivier 9b66ee66cd [FIX] website, web_tour: fix edit_megamenu/edit_menus inconsistent tours
This commit fixes an inconsistent behaviour in tours using the website's
"Edit Menu" dialogs.
When adding a mega menu, two dialogs are displayed:
- The main "Edit Menu" dialog, from which you can open
- The "Menu" dialog with the mega menu label input
When these two dialogs were opened, and closed successively (click on
"Ok" to confirm the menu label, then click on "Save" to save the new
website menu), the tour was sometimes triggering the primary button of
the wrong dialog.

Two issues were leading to this inconsistent behaviour:
1/ Sometimes, the tour would click twice on the same primary button,
and would not wait for the current dialog to close.
To prevent that, extra_triggers are added to the steps to check that the
first click was correctly taken into account (and so, that the upper
dialog, that was the active dialog, was closed).

2/ Other times, the tour would click on the wrong dialog primary button
(it would click on the inactive dialog's button that would save the menu
without validating the label first).
This was coming from the web_tour.TourManager inaccurate
$modal_displayed property, which was defined and used in two different
javascript threads of execution. It could reference modals that were
not the actual modals from the DOM, when used in _check_for_tooltip.
To prevent that, that property is set inside the method it is used in.
It could be defined as a const and not a property, but this way the
commit history is left untouched.

runbot-4000
runbot-4001
runbot-4004
runbot-4005

closes odoo/odoo#94924

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-07-04 14:07:35 +02:00
Odoo's Mergebot f910ad94ad [MERGE] barcodes: simplify and improve barcode implementation
Simplify and improve barcode implementation

This PR rework the way barcode is implemented. It introduces a new `barcode_service`, which basically replaces `barcode_events`. The barcode service is meant to be the reference for all code that needs to detect a barcode.

While we are at it, this PR improves the code, remove dead code, and simplify the implementation. It will be followed by a rework for the barcode widgets and barcode handlers, to make them work with the new owl views.

closes odoo/odoo#93387

Related: odoo/enterprise#28527
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-07-04 14:07:28 +02:00