Commit Graph
137094 Commits
Author SHA1 Message Date
Odoo's Mergebot affa40bc21 [FW][MERGE] website: improve visitor synchronization and tests
RATIONALE

Event will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff and have a smooth integration in a stable
version (13.3).

PURPOSE

Purpose of this merge is to clean visitor synchronization and tests. It
prepares further improvements to visitor model linked to Event Online.

SPECIFICATIONS

Clean existing visitor tests. Use HttpCaseWithUserDemo. Make tests
independent from existing database data, notably existing visitors.
Currently if any visitor is present in db tests crash as they are badly
designed.

Introduce a mock for visitor from request allowing to shortcut some visitor /
user synchronization and test directly expected results without too much
boilerplate in tests.

Add anchor methods to somehow merge visitors and update partner linked
to visitors and their sub records. In this stable we cannot remove current
unlink of duplicate visitors due to constraint of partner_id / visitor_id.
However those methods allow to tweak behavior by override. This will be
done in future tasks.

Introduce a new configuration parameter in website allowing to set number of
days before de-activating visitors: ``website.visitor.live.days`` . It is
set to 30 days instead of 7 as before.

See sub commits for more details

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares  Task ID 2284043 (Visitor-based track wishlist)
PR odoo/odoo#54036

closes odoo/odoo#54078

Forward-port-of: odoo/odoo#54036
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-22 11:45:03 +02:00
8ae4544b76 [REF] website: improve visitor / user synchronization at authenticate
RATIONALE

Event will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff and have a smooth integration in a stable
version (13.3).

PURPOSE

Purpose of this merge is to clean visitor synchronization and tests. It
prepares further improvements to visitor model linked to Event Online.

SPECIFICATIONS

Add anchor methods to somehow merge visitors and update partner linked
to visitors and their sub records.

Main idea would be to be able to

  * avoid unlinking visitors, notably because we have keys linked to them
    allowing push notifications. As a given user may be linked to several
    devices (different keys / different visitors) keeping them in database
    improves push efficiency;
  * allow to link sub-records to a main visitor, like tracked pages history,
    even if multiple visitors are linked to the same identity;

In this stable we cannot remove current unlink of duplicate visitors due
to constraint of partner_id / visitor_id. However those methods allow to
tweak behavior by override. This will be done in future tasks.

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares Task ID 2284043 (Visitor-based track wishlist)
PR #54036

X-original-commit: 8a8d2d4412d1b58545ee4f0240cca5114e541b6a
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-07-22 09:02:55 +00:00
2648840624 [REF] website: allow to configure delay before archiving visitors
RATIONALE

Event will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff and have a smooth integration in a stable
version (13.3).

PURPOSE

Purpose of this merge is to clean visitor synchronization and tests. It
prepares further improvements to visitor model linked to Event Online.

SPECIFICATIONS

Introduce a new configuration parameter in website allowing to set number of
days before de-activating visitors: ``website.visitor.live.days`` . It is
set to 30 days instead of 7 as before.

Purpose of extending delay is to be able to use visitor information a bit
longer in business flows. For example one could contact visitors 2 weeks
after an event to get their feedback. Adding a bit of delay allow to keep
those visitors alive a bit longer by default. Allowing to configure it gives
more flexibility to admins and deployment.

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares Task ID 2284043 (Visitor-based track wishlist)
PR #54036

X-original-commit: f83af1d53716499dcad94f363aff609a2f8e55d9
Co-authored-by: Aurélien Warnon <awa@odoo.com>
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-07-22 09:02:55 +00:00
Thibault Delavallée 17d83775db [IMP] website: improve visitor tests
RATIONALE

Event will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff and have a smooth integration in a stable
version (13.3).

PURPOSE

Purpose of this merge is to clean visitor synchronization and tests. It
prepares further improvements to visitor model linked to Event Online.

SPECIFICATIONS

Make tests independent from existing database data, notably existing visitors.
Use newly-introduced tools and data. Clean tests and make them easier to
understand, notably connection / disconnection effects. Make more tests about
visitor data: name, partner_id, tracks move from visitor to authenticatedf
visitor, ...

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares Task ID 2284043 (Visitor-based track wishlist)
PR #54036

X-original-commit: 015f70dd1ce1394d279f8fbb949948f4845c65fc
2020-07-22 09:02:55 +00:00
Thibault Delavallée 150a24ad81 [IMP] website: use HttpCaseWithUserDemo for tests and clean boostrapping
RATIONALE

Event will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff and have a smooth integration in a stable
version (13.3).

PURPOSE

Purpose of this merge is to clean visitor synchronization and tests. It
prepares further improvements to visitor model linked to Event Online

SPECIFICATIONS

Clean existing visitor tests. Use HttpCaseWithUserDemo and clean bootstrapping
of data.

Introduce a mock for visitor from request allowing to shortcut some visitor /
user synchronization and test directly expected results without too much
boilerplate in tests.

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares Task ID 2284043 (Visitor-based track wishlist)
PR #54036

X-original-commit: 4e0d4e7c315b5a9d880754e02966debd6a59c728
2020-07-22 09:02:55 +00:00
Thibault Delavallée f8b87c959a [IMP] base: have user_admin / partner_admin available in HttpCaseWithUserDemo on self
Purpose is to simplify future tests to have admin data directly available at
hand, both its user and partner. It will ease future test writing.

LINKS

Task ID 2290016 (improve visitor synchronization and tests)
Prepares Task ID 2252655 (main Online Event task)
Prepares Task ID 2284043 (Visitor-based track wishlist)
PR #54036

X-original-commit: f51fd6e54da5ee8aee0df74e6d510dc0b077eba8
2020-07-22 09:02:55 +00:00
Jeremy Kersten 3beb4545c4 [IMP] http_routing: add cache on rewrite computation
Before this commit each url was processed each time, now with have a cache
with the path (withtout query string) as key on each worker.
It reduces drastically the time of the rewrite check on hot. (~10x)

closes odoo/odoo#54690

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-22 07:25:00 +00:00
Jeremy Kersten 9577dcbc3a [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Retro-compatibility routes
2020-07-22 06:53:37 +00:00
Jeremy Kersten 01c17707bd [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Url for a product become:
/shop/productname-id instead of /shop/product/productname-id

Url for a blog post become:
/blog/blogname-1/blogpost-1 instead of /blog/blogname-1/post/blogpost-1

Url for a question on forum become:
/forum/forumname-1/title-1 instead of /forum/forumname-1/question/title-1

task-2295016
2020-07-22 06:53:37 +00:00
Samuel Degueldre 2e81f53a2a [FIX] web_editor: add index on original_id to improve delete performance
In #45174, the original_id field was added on ir.attachment, so that
derived images in the web-editor (cropped, resized, optimized, ...)
could keep a trace of the original, such that if the user wanted to
revert it or change the crop/size/optimization parameter, we could do it
from the original again so that for example the quality can be increased
or the crop region made bigger.

The addition of this self-referencing many2one from ir.attachment to
itself however will cause DELETE queries on ir.attachment to do a
sequential scan on the table to update potential records referencing the
deleted record in their original_id field. As the ir.attachment table
tends to be one of the biggest tables in production databases (millions
of records), this scan can take multiple seconds per DELETE operation,
and since attachments are used everywhere in odoo to represent files,
DELETE operations on them are frequent.

Adding an index on the original_id field should make these DELETE
operations substantially faster (scaling with the log of the number of
filled original_id fields, which will be very small, instead of scaling
linearly with number of records)

closes odoo/odoo#54676

X-original-commit: 2b5064a00b7a5c8dc66429869287386f244b1257
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 13:31:22 +00:00
Toufik Ben Jaa d4c1a71bc0 [FIX] website_crm_partner_assign: allow sales to forward leads
- Since the wizards now requires ACLs, the access rights
  set on the lead forward partner and the lead assignation are
  incorrect.

  Only the Sales/Administrator are able to use them.
  With this commit we introduce the intended behavior where
  the sales are able to perform those tasks.

closes odoo/odoo#54568

X-original-commit: 3081ca828e4a7de3861ee5b1fb9600b248c3ea07
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-07-16 11:40:21 +00:00
Christophe Simonis 6d6250050f [FIX] website_sale: browse fiscal position in sudo
The tax mapping is only readable by internal users. As the calling
method can be used by portal routes, we should browse the fiscal position
in sudo mode.

closes odoo/odoo#54524

X-original-commit: 46e9a9683967600c55bf43895740fff1d61eb49b
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-15 14:26:50 +00:00
Nicolas Martinelli 817de24a1e [FIX] purchase_stock: fallback on seller
- Create a product with routes MTO + Buy.
- Create a vendor pricelist with a minimum quantity:
  Min. Qty 1000 for 10 USD
- Create a SO, sell 1000 quantity
  => A PO is created automatically in draft.
- Go back to SO and update quantity to 1200.

The following message pops up: "There is no matching vendor price to
generate the purchase order for product..."

We select the supplier based on the procurement quantity, which is lower
than the minimum quantity of the supplier.

To avoid this situation, we fall back on any supplier like it was the
case in v12.

opw-2297001

closes odoo/odoo#54526

X-original-commit: 4d4913fc366dcd62740b91eda3aa3f81270affda
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-15 14:53:03 +00:00
oco-odoo 6df72a53ec [FIX] account: make assignation of tax repartition and tags work in bank reconciliation widget and on misc operations
Bank reconciliation widget allows creating a writeoff with tax lines, in order to simulate both the invoice and the payment into a single entry, from one statement line. Before this fix, the tax repartition used by this feature was always the one defined for invoices. Also, in some cases, the amounts reported in the tax report had the wrong sign, because of the way the tax report applies the sign multiplicator on lines' balances. This multiplicator cannot be computed properly from a payment or miscellaneous operation, so we need to rather impact the sign of the tags directly.

With this fix, we guess whether or not we are refunding something from the data entered by the user, and modify the signs of the tags accordingly so that the tax has the same impact on the report as it would have had with an invoice doing the same operation.

closes odoo/odoo#54691

X-original-commit: ac2662b67c878eb2ef6e9462a0e6c9f1fbdb6adb
Related: odoo/enterprise#11948
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-07-17 15:53:28 +00:00
yhu-odoo ae2ef4c46b [FIX] mrp: add "minutes" after Expected Duration
This commit add text "minutes" after Expected Duration on the form view
of mrp.workorder.

closes odoo/odoo#54592

X-original-commit: 2ec72fec26a66bd5dc49aa56c4ca44dc3f31ad06
Related: odoo/enterprise#11900
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-07-16 14:48:18 +00:00
yhu-odoo 0554ffb339 [FIX] mrp: Return to previous view and close MO
When launch a consumption warning wizard by clicking the "Mark as done
and close mo" button, always close the MO. And return to tree view if we
open the tablet view from a 'start' button, return to workorder kanban
if we open tablet from that.

Task 2278147

X-original-commit: 4d03cf5e8d29933d5f96099f8f662c9084b20197
2020-07-16 14:48:16 +00:00
Pafnow 216985a180 [FIX] doc: correct active explanations
The record is invisible when active=False, not the field
Correct rst arrow syntax

Sign CLA

closes odoo/odoo#54714

X-original-commit: 055cb50b4e12488266e9f9418788c4057257324f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-07-20 13:31:00 +00:00
Raphael Collet ef01493678 [FIX] core: update of one2many field on new record with origin
When setting the inverse many2one field on a record, the record is not
removed from its inverse relation if the field's current value is not in
cache.  Fix this by setting the field's value in cache before updating.

closes odoo/odoo#54711

X-original-commit: df12c85816dfa59f298c3e6a077bd88e4b7aa6a6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-20 11:42:59 +00:00
Xavier Morel b3761a8cba [FIX] core: fix handling of removals in sub-o2m
Issue is specifically in the case of an onchange removing a record in
an o2m in an o2m (so a sub-o2m) if loading an *existing* record in the
SSF: since the server pretty much only returns a REMOVE_ALL followed
by the records to keep or create, conserving the removal information
requires diffing the value currently stored in the form and the result
fo the onchange.

Diff which was properly done for top-level o2ms, but not for the ones
below that (apparently forgot this bit when improving support for
nested o2ms earlier this year).

X-original-commit: 177d009541cca589c6ebb85fc051b893ec001536
2020-07-20 11:42:58 +00:00
Xavier Morel 8f09ef294a [FIX] doc: rST definition lists must be preceded by an empty line
Otherwise the reStructuredText parser thinks the first definition
title is part of the preceding paragraph, and the definition item is
interpreted as a quote due to the indentation.

closes odoo/odoo#54709

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-20 11:06:31 +00:00
Andrea Grazioso (agr-odoo) 36138916f5 [FIX] l10n_it_edi: fix traceback on fetchmail
When the server execute the job 'Mail: Fetchmail Service'
if it's processed an attachment having a Notes field with None values
the following traceback will occur
AttributeError: 'NoneType' object has no attribute 'split'

//IdentificativoSdI','//DataOraRicezione','//Descrizione','//MessageId','//Note'.
seems to be not mandatory

opw-2277722

closes odoo/odoo#54636

X-original-commit: f96be5eb77a998037bdf0b88f96160b856dfc67a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-07-17 09:15:02 +00:00
Martin Trigaux 49fc197925 [FIX] gamification: use right field on goal domain
There is no field 'ids' on a gamification.goal, but one called 'id'
Without this commit, calling _get_serialized_challenge_lines (or
indirectly, calling report_progress) with a non-empty subset_goals was
failing due to an invalid domain.
This is not supposed to happen on standard flow but can be triggered
with manual modification of date fields and refreshing a challenge.

Fixes odoo/odoo#25913

closes odoo/odoo#54387

X-original-commit: 1e3483d2fc99763940396936758cf99b14d0a118
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-07-13 12:07:19 +00:00
Xavier Dubuc eb99a019ed [FIX] mail: fix inbox mark as read on single message
Clicking on mark as read on a given message would move all messages in
inbox to history instead of only selected message(s). This commit fix
that behaviour so that only the selected message(s) move(s) to history.

task-2284543

closes odoo/odoo#54688

X-original-commit: 3304b89fc799b979b028aa4c7efe902b2f5276c1
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-17 14:49:32 +00:00
Olivier Dony 2e17c0458c [FIX] web: tests: fix typos in :{last,first}-child
Follow-up of odoo/enterprise#11881, in order to eliminate all similar
typos.

The CSS pseudo-class selectors are spelled `:first-child` and
`:last-child`, and never take any argument, as opposed to
`:nth-child(<nth>)` for example.

Ref: https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes

jQuery doesn't care and matches with or without the `()`, but CSS
engines don't, and now libsass SCSS compilation crashes due to the empty
argument list (cfr. opw-2299465)

Better avoid confusion and fix the typo everywhere.

closes odoo/odoo#54685

X-original-commit: 82244e17339615615535073e6f9e1ddbcf0b57d9
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-07-17 14:36:08 +00:00
Jeremy Kersten c580197a20 [FIX] base: handle_exception should never alter json response
Before this commit, in case you were in --dev-mode, if a json request crash,
it was wrongly intercepted and return a Internal Server Error with status 500
and without the JSON Response

For the change of http code, since it is only in dev mode, it could not impact
a production server (in theory) with custom code based on it.

After this commit, if your rpc fails, you will not have anymore a breakpoint in
the code to help the developer to debug. But you will have a status 200 on the
rpc request.

closes odoo/odoo#54668

X-original-commit: 534cca311db1ecf1005a24d5cbd50e166094ba2a
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-17 12:47:59 +00:00
Aaron Bohy 11b1b82c09 [FIX] web: list: do not crush text fields
Before this commit, it might happen that text field columns in list
views were completely crushed, to let space to the other columns.

This commit fixes the issue by preventing text fields from being
wrapped during the ideal column widths computation. Doing so, text
fields will take space they deserve according to their content.
They will then be wrapped if necessary, so that they aren't trimmed,
unlike e.g. char fields.

Task 2275747

closes odoo/odoo#54664

X-original-commit: 5c54111127bd99eedb4e0331aba5a0200feb461c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-07-17 11:58:27 +00:00
Joseph Caburnay b2f8170d88 [IMP] point_of_sale,pos_*: allow users to manage orders in the pos frontend
We now allow invoicing of finalized orders in an open session in this first
iteration of order management in the pos frontend. Additionally, receipt
reprinting is also introduced. With this feature, we can now reprint the
receipt of old orders.

closes odoo/odoo#51141

Task-id: 1981354
Related: odoo/enterprise#11690
Related: odoo/upgrade#1472
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-17 10:00:04 +00:00
Joseph Caburnay 39ff9d95c2 [REM] pos_reprint: this is now part of the point_of_sale module
TASK-ID: 1981354
2020-07-17 09:58:26 +00:00
Martin Trigaux 527991b3b8 [FIX] l10n_ch: remove duplicated translation
A term was present twice in Italian, making the installation of
Italian crash for the Swich CoA
Introduced at a3029a8

Remove some reference to company accounts (it is handled by
l10n_multilang, should not be set manually as working only for company
wiht id 1)

closes odoo/odoo#54658

X-original-commit: fb10cc6d0af59d255c0c3f2dd52c97b2cf31a628
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-07-17 11:05:14 +00:00
jvm-odoo 94625b6598 [FIX] website_sale: fix redirect on wrong coupon code
This commits fixes the case where you click on
edit address in eCommerce payment flow and you
type a wrong coupon code.

Without this commit, you are redirected at
/shop/payment instead of /shop/checkout

OPW-2290188

closes odoo/odoo#54646

X-original-commit: 0d658349483054bf30c8be483e2f42671e0ba024
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-07-17 09:53:04 +00:00
Mohammed ShekhaandIpsita Borisagar e69c72f93b [IMP] web: improve tooltip style/design
Improve tooltip style/design to get rid of black background and purple title,
instead design tooltip like popover design, to have tooltip with white
background and light grey title

task-2266829

closes odoo/odoo#53723

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Ipsita Borisagar <ibo@odoo.com>
2020-07-17 11:34:21 +00:00
qsm-odoo b1c1e454da [IMP] website: adapt some image snippet options to new UI
Use small buttons and icons.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952

closes odoo/odoo#45096

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 11:28:11 +00:00
Benjamin Vray 17e7e754cd [IMP] website: keep the selected image after moving it in gallery
Keep the selected image after moving it in the gallery. So that the
options for moving the current image are always displayed.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Benjamin Vray a2fd2dacd9 [IMP] website: review carousel snippet
Add the width option for each slides in the carousel snippet.
Remove share links from the third slide of the carousel.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Benjamin Vray 316ceaf4d8 [IMP] website: add dots indicators in gallery snippet options
Add dots indicators in gallery snippet options.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Benjamin Vray f626130df9 [IMP] website: split image gallery into 2 different snippets
Snippet image gallery retains only the slideshow mode and a new snippet
called 'image wall' takes the 3 other modes.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Benjamin Vray ef9cc134b6 [IMP] website: review gallery snippet
Review the gallery snippet. It has been improved in multiple ways.
Added new options, etc.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Benjamin Vray 7a36eee043 [IMP] website: remove right/left indicators in gallery in editor
In gallery snippet with slideshow mode, the right/left indicators have
now the same behavior in editor and outside. Before this commit, these
indicators were always visible in editable mode.

Part of https://github.com/odoo/odoo/pull/45096
task-2162952
2020-07-17 11:28:11 +00:00
Paul Morelle 119637cf9e [FIX] models: fix permission check in export_data
The permission check in BaseModel:export_data was checking if the
current user was the administrator user, instead of checking if the
environment was administrator (i.e. it should also check if the sudo bit
is set on the environment).

This commit fixes this and allows to export_data with a simple `sudo()`
instead of needing a `with_user(SUPERUSER_ID)`.

closes odoo/odoo#54647

X-original-commit: f69f47b6ba5c6c462bf617f4876a39233f60034f
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-07-17 10:14:06 +00:00
qsm-odoo 2a19a83762 [FIX] web_editor: fix small memory leak of destroyed snippet editors
In some complex cases, some snippet editors were destroyed but were
still referenced in memory.

E.g.

1) Reorder a snippet gallery image
2) The code is implemented in such a way that reordering create a new
   wrapping column for each image and moves the images in them.
3) This result in having the snippet editor linked to the old columns
   to be explicitely destroyed and removed from memory, but not the ones
   linked to the images as they are still in the DOM (just moved).
4) ... but the snippet editors linked to the images are children of
   the snippet editors linked to the columns. They are thus implicitely
   destroyed... but not removed from memory.

closes odoo/odoo#54643

X-original-commit: e4bf37c7fc892cdba57f0acac8e10f5698184e67
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 09:56:25 +00:00
qsm-odoo 004663f49e [FIX] web_editor: fix editor-lock after gallery image reordering again
The bug was already solved with [1] but was reintroduced later for
another reason. [1] solved the problem by checking that the current
option is not destroyed before asking for an UI update thanks to a
trigger_up (the option was destroyed because of image reordering). The
bug is now reintroduced for the same basic reason: a new trigger_up was
added between the potential option destroy and the destroy check, so
if the option is destroyed, that trigger_up fails to be triggered and
the editor is locked.

This commit solves the problem once and for all, hopefully, with a
more robust solution: only destroy options when none is being
processed. That way we ensure that all trigger_up occuring during an
option activation / update can be properly done.

[1]: https://github.com/odoo/odoo/commit/9eeea4c4107dc15984c475582d5ee58a17cd2568

X-original-commit: 7770430f78ee9e122a732fa042226d362467158e
2020-07-17 09:55:41 +00:00
qsm-odoo a30cc3402d [FIX] web_editor: restore background videos (new imagepicker UI)
Commit [1] broke the background videos feature. This is because the
'we-imagepicker' widget is now a sub-widget of a new 'we-button-group'
widget, acting as a selection choice (same as we-button in a we-select).
When selecting a selection choice, the appropriate option method is
called, with the selection value and params... but the params were
actually the ones of the 'we-button-group' element and not the ones
of the chosen widget 'we-imagepicker'.

This has never been important for we-select widgets but it could have
been. The problem is only solved here in master, generically for all
selection widgets (currently only 'we-select' and 'we-button-group').
The params received are the ones of the active sub-widget combined with
the ones of the selection widget.

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

closes odoo/odoo#54629

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-17 08:45:06 +00:00
fja-odoo 31dd984bea [IMP] mrp: make the MO on the WO readonly
Part of: https://github.com/odoo/odoo/pull/54283
task-2278147

closes odoo/odoo#54607

X-original-commit: b13e7d7bf3565242d1f99c6d9d5dfc7a8aa2929d
Related: odoo/enterprise#11906
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-07-16 16:54:01 +00:00
std-odoo 89a2423c21 [FIX] website_event: fix ACL issue during registration
Bug
===
Register to an event with a public user.
Sometimes an ACL error will be raised.

Technical
=========
Before flushing the environment (after the creation of the event
registration in the endpoint `registration_confirm`), the ORM will
recompute all needed stored fields. As we didn't write on some of them
(`date_closed`, `utm_campaign_id`, `utm_source_id`, `utm_medium_id`)
they are in the list `Environment::all.tocompute`. So, the ORM will recompute
the fields even if the state didn't change (this behavior can be verify
in `BaseModel::recompute`). This is done after the "create" call of the
event registration and so without the SUDO flag.

Task-2299227

closes odoo/odoo#54624

X-original-commit: 38f37cd483b7907b20171e2c44e14e69e3e00596
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-07-17 08:34:12 +00:00
Joseph Caburnay ce8cb11054 [FIX] point_of_sale: touch events are passive and allow resize with touch events
1. Methods associated to touchmove and touchstart listeners should not
call preventDefault because they are passive by default. Calling preventDefault
will do nothing but in chrome browser, error message is issued.
2. We now allow resize based on touch events.

closes odoo/odoo#54612

X-original-commit: c6b7133d9c9dc52a8d283124b5a4497940e54682
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-17 00:30:36 +00:00
Joseph Caburnay f6f1ea6fd3 [FIX] point_of_sale: no need for disableRubberbanding
The primary goal of disableRubberbanding is to disable scrolling during
touch event by default and to allow only selected descendants to have scrolling
active during touchstart+touchmove event. Only elements with class="touch-scrollable"
are allowed for touch scrolling. This restriction can be a good idea but it
results to bug-ridden explicitness which is not necessary because scrolling
should be allowed automatic by default in the first place. In this commit, we
allowed scrolling by default by:

1. We remove disableRubberbanding.
2. We set the position property of .pos to fixed. This is to accomplish the
original goal of disableRubberbanding (fixing the root element in its position).
3. We remove the touch-scrollable class as they are not needed anymore and
no style associated to it.

Removing the disableRubberbanding method also fixes the Intervention error during
touch scrolling event. The reason for that error is we are calling preventDefault
in the event that is passive. touchmove and touchstart events are passive by default
- which means that preventDefault won't work.

X-original-commit: 54f7fb49dae3aab6a005402a1ac60262bbd15edc
2020-07-17 00:30:34 +00:00
Thibault Francois 02d613b565 [FIX] doc: update cloc documentation
After the commit 2a57a156c7b8e81c01afa095b3291361d208611f
Cloc excluded by default one more folder, it should appear
in the documentation of the tools

closes odoo/odoo#54609

X-original-commit: 93261c787d1152c94856ef31a1600a4cdab8b83b
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-16 17:07:33 +00:00
Didier (did) c1b6c066bc [IMP] mail: focus the next chat window when closed by ESC
This allows user to close multiple windows with ESC key.

task-2283891

closes odoo/odoo#54604

X-original-commit: bac3d7792a48f86a39f92e0fcfc18d522ce00d94
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-16 16:24:25 +00:00
Xavier Dubuc 9ba8eb4a83 [FIX] mail: fix activity template (t-if placements)
odoo/enterprise#11836
task-2296875

closes odoo/odoo#54600

X-original-commit: 687628fa35063db5b44abcc758cae0a597df5ffe
Related: odoo/enterprise#11904
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-07-16 15:53:29 +00:00
Jeremy Kersten b9b228f195 [FIX] website_forum: fix traceback on comment
Before this commit, try to post a comment will raise a traceback in front end
because textarea is not found.

Now, we check that we are writing in textarea content and no more in textarea
comment.

closes odoo/odoo#54595

X-original-commit: 867458456b13daf9b5586c17b7475e68d9d008e1
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-16 15:22:14 +00:00