d4fe919db5 [MERGE][REF] web: new RelationalModel
Before this PR, we had several implementations of a relational
model. The form view used the BasicRelationalModel, which was a
wrapper around the BasicModel. The list view used the
RelationalModel (a simpler version that didn't support complex
usecases of x2many fields). The kanban view used the KanbanModel,
an extension of RelationalModel.

This PR removes all these, and replaces them by a single model.
It is called RelationalModel, and as a similar structure as its
predecessor (with datapoints). It now handles tricky x2many usecases
of the form view though.

This PR also comes with several important changes:
 1) The new model is based on unity reads [1]. This means that all
 data required by the view is fetched at once, and datapoints are
 created with their data (whereas before, they were responsible to
 fetch their data). There's an exception for special data: they are
 no longer handler by the model. A hook "useSpecialData" has been
 created, and it allows fields (components) to fetch additional
 data they require.

 2) The new model uses onchange2 [2]. With onchange2, we send and
 receive a diff, instead of the whole state of the record. Morever,
 onchange2 uses unity, which means that returned commands for x2manys
 (e.g. command 4, LINK) contain the values of the corresponding
 records, so we don't need to fetch them in a separate call
 afterwards.

 3) The new model no longer triggers deep renderings (render(true)).
 It is instead based on fine-grained reactivity (i.e. only what
 depends on what has changed is re-rendered). We introduced a hook
 "observeRecord" which allows a component to subscribe itself to
 some keys in a record datapoint, and register a callback to
 execute when those keys change (e.g. to fetch data).

[1] odoo/odoo@7d2baaa0c7
[2] odoo/odoo@f5e6494da3

Task~3179751

closes odoo/odoo#114024

Related: odoo/enterprise#43125
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:58 +02: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%