Odoo's Mergebot f42c56def2 [MERGE][IMP] web_editor: Implement collaborative for Knowledge
# Editor changes to enable the collaborative mode in Knowledge
Here are the necessary changes to make it possible to enable the collaborative
mode in Knowledge. Knowledge commands introduce a new kind of editor blocks:
`Behaviors`, which are OWL `Component` which need to be mounted. This mounting
is asynchronous and this has to be supported, while not all nodes are observed
by the editor, meaning that parts of a `Behavior` can be collaborative while
others may not.

The following is a brief introduction for every commit in this PR, check them
out individually for more detail.

### [FIX] web_editor: notify current step when joining a collaborator
- Inserting an embedded view from a module in an automated process happens as
  soon as the first collaborator connect. This commit notifies the step for the
  embedded view during the following collaborators connections (to be sure they
  actually received it).

### [IMP] web_editor: fully implement oeProtected and oeTransientContent
- Those attributes will allow a fine control on which nodes are NOT observed by
  the editor (`oeProtected="true"`), and which nodes are NOT saved/serialized
  for collaboration by the editor (`oeTransientContent="true"`). It can be a
  better choice than using `observerUnactive` which stops the observer for all
  nodes of the editor, in case a node should never be observed.

### [IMP] web_editor: prevent 'insert' command unwrapping in root
- Modify the 'insert' command of the editor so that it does not unwrap nodes
  when the selection is directly inside the editable ('root'). Unwrapping a
  paragraph in that case would put text nodes as direct childs of the editable,
  which is not desirable with the current implementation.

### [IMP] web_editor: add a hook for historyResetFromSteps
- When joining an `html_field` in collaborative mode, there is no way to know if
  there are connected collaborators before actually making said connection. This
  is a problem when we want to automate the insertion of an embedded view from
  another module in Knowledge. With the hook, it is now possible to execute a
  specific action as soon as a collaborator is joined.

### [IMP] web_editor: force load collaborative on form view
- The collaborative mode loads lazily with the focus by default. In Knowledge it
  should start as soon as possible, therefore this commit adds an option to do
  so.

### [IMP] web_editor: make mocha tests odoo modules
- Since `web_editor` tests were not odoo modules, it was not possible to import
  dependencies from i.e. `web`. This commit addresses that.

### [IMP] web_editor: buffer external steps during Component rendering
- In a collaboration, when applying a step requiring a custom OWL `mount`
  (which is asynchronous), further external steps should be buffered while the
  rendering is done, in case those following external steps should concern
  "rendered" nodes which are not yet present in the editor. Once all nodes are
  rendered and present in the editor, further steps can be applied safely.

See odoo/enterprise#33483
See odoo/upgrade#4384

closes odoo/odoo#104680

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-04-20 10:51:23 +02:00
2023-04-13 17:57:45 +02:00
…
…
…
…
2023-01-03 13:16:02 +01:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%