Commit Graph
1626 Commits
Author SHA1 Message Date
qsm-odoo 2972976962 [REF] web_editor, website, *: complete refactoring
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour,
  website_blog, website_crm_partner_assign, website_event,
  website_event_questions, website_form, website_forum, website_gengo,
  website_hr_recruitment, website_links, website_mail,
  website_mail_channel, website_mass_mailing, website_quote,
  website_sale, website_sale_options, website_slides, website_twitter

This commit reviews the whole "JS side" of the web_editor and website
apps. This is a first step to be able to improve them with new and
better functionnalities; this commit is not supposed to change any
visual behavior.

The main goal was to achieve a structure similar to the backend one.
Now, the frontend side also has a root widget (like the WebClient)
and all other widgets are attached to it one way or another. This allows
the benefits of using the 'trigger_up' functionnality for example.

As RPC are now mainly done with the `this._rpc` functionnality (being
possible thanks to the parent hierarchy), the frontend will also be
possible to test thanks to QUnit in a future update (besides the "text"
editor side which still requires a refactoring to be able to do that).

---

Here are some of the changes:

(-) conventions and documentation

The code has been updated to follow JS conventions and a lot of code has
been commented (around +2000 lines of comment). This also means that
lots of functions have been renamed to use camelCase or simply to make
their name understandable.
See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines.

(-) deprecated: web_editor.base

The "web_editor.base" module has been split and does not force the
modules which require it to wait for DOM ready anymore. This was indeed
slowing loading times, but also prevented to use some modules in some
contexts (see the LESS editor use in web_studio which is the subject of
another task).
Now the "editor context" can be got thanks to the "web_editor.context"
JS module with its "get" function.
The "web_editor.base" module should probably not be used anymore (see
its code and recent updates).

(-) new: web.dom_ready

If a JS module should wait for the DOM to be ready to be executed, a
new JS module has been created: "web.dom_ready". This should always
be used in a module which only want to instantiate stuff. Do not
extend (or worst, include) classes after DOM ready.

(-) website.website

The "website.website" module has been split. "website.website" does not
return anything useful anymore, it just initialize some miscellaneous
stuff, without waiting for the DOM to be ready. You might want to check
"website.utils", "website.content.compatibility" or `WebsiteRoot`. Also
`website.form` has been deleted (use `this._rpc`), so has been
`website.error`. `website.prompt` will be removed in a future update to
be replaced by `Dialog.prompt`.

(-) widgets are great

Many classes which were not widgets are now widgets. This allows them to
use the 'events', the 'xmlDependencies' and the 'this._rpc' features for
example. Here are some of the main ones:

- Snippet options: these were classes with a `$el` for the menu element
    and `$target` for the customized element. This is still the case
    but following standard `Widget` structure (one exception: using
    `this.$(...)` searches in the `$target` as before this update).

- Snippet animations: instead of class instances with a `$target`
    element which can be `start` and `stop`, these are now standard
    widgets which can be `start` and `destroy`. `this.$target` is
    an alias to `this.$el` for ease of compatibility.

- Snippet editors: instead of class instances in charge of an editor
    overlay, these are now widgets. Each "child" snippet editor is
    properly attached as a "child", which allows editors to communicate
    and to be properly destroyed.

(-) root widgets and website navbar

The frontend is different of the backend. In the backend, the page has
an empty <body/> element and all the components are instantiated from
parent to children (i.e. the `WebClient` is instantiated and is in
charge of instantiating the `ControlPanel`, etc). The frontend cannot
work like that on page loadings as they are way more frequent than in
the backend and we do not want them to flicker. A frontend page is
loaded as a <body/> element which already contains the website navbar
and its menus and the whole content page. JS code has to be "attached"
to these existing elements. This is possible thanks to the `RootWidget`
instances and the specialized `WebsiteRoot`, `IframeRoot` and
`WebsiteNavbar` (see code for details).

(-) lazy loading

No more (or at least a lot less) XML/JS has to be loaded on page
loading, thanks to the use of the `Widget.xmlDependencies` feature.
XML which have to be lazy loaded is loaded only on related Widget
instantiation if necessary, which allows to execute a lot of JS code
before the DOM is ready and to start many widgets on DOM ready (not
later). A visual benefit of this is clicking on the 'edit' button as
soon as it is possible: before this commit, this was sometimes not
doing anything as event handlers were not binded yet.

Still a possible exception: loading the session and locales. This may
be asynchronous stuff which is still required before widget
instantiations but this will be the subject of another task.

(-) deprecated code and code location

More than reviewing code and organizing it, many apparent dead code was
removed. More importantly, mislocated code was put in the right app.
This is the case for snippet animations which is a concept for website
apps but was defined in the web_editor app, or some translation concepts
which were part of website but should have been part of web_editor.

---

There are probably more things to say about this commit but I will let
the comments speak for those.
2017-08-16 11:04:14 +02:00
Christophe Simonis 1fa8680286 [MERGE] forward port branch saas-17 up to 48b2ce60ed 2017-08-10 18:07:47 +02:00
Christophe Simonis 48b2ce60ed [MERGE] forward port branch saas-16 up to 85571bb78c 2017-08-10 17:01:05 +02:00
Christophe Simonis 85571bb78c [MERGE] forward port branch saas-15 up to dde62073ba 2017-08-10 16:22:36 +02:00
Moisés López 0819d3f116 [FIX] doc: Sphinx 1.2 support in html_domain
9a07a459 added "override=True" to silence a Sphinx warning in about
the address node already existing, however the override=True parameter
was added in Sphinx 1.4 (alongside the warning), so this breaks in
1.2.

Only pass in override=True if we're in 1.4 or later.

Closes #18232
2017-08-10 16:18:29 +02:00
Christophe Simonis c3d710d2f6 [MERGE] forward port branch saas-14 up to 80ac087d6e 2017-08-09 17:11:10 +02:00
Christophe Simonis 80ac087d6e [MERGE] forward port branch 10.0 up to f69655829a 2017-08-09 15:53:37 +02:00
Moises Lopez - https://www.vauxoo.com/ cdae67f03a [FIX] doc: remove 'report' dependency
This reverts commit bb7fef79a6.
Because now odoo merge report module into web one

Closes #18530
2017-08-04 15:39:24 +02:00
Timo Talvitie 1be57f2825 [CLA] Corporate CLA for Vizucom Oy
Done at #18591
2017-08-03 11:04:05 +02:00
Christophe Simonis 4d5ff6401c [MERGE] forward port branch saas-16 up to b76109173a 2017-07-28 18:37:10 +02:00
Christophe Simonis b76109173a [MERGE] forward port branch saas-15 up to c0ec09e9d5 2017-07-28 18:11:07 +02:00
Christophe Simonis c0ec09e9d5 [MERGE] forward port branch saas-14 up to be77cf7f5f 2017-07-28 17:25:45 +02:00
Christophe Simonis be77cf7f5f [MERGE] forward port branch 10.0 up to e686385138 2017-07-28 16:56:14 +02:00
Christophe Simonis e686385138 [MERGE] forward port branch saas-11 up to 5e6637a240 2017-07-28 16:26:57 +02:00
Christophe Simonis 5e6637a240 [MERGE] forward port branch 9.0 up to b054902655 2017-07-28 16:24:48 +02:00
Christophe Simonis b054902655 [MERGE] forward port branch saas-6 up to 683a7cb029 2017-07-28 16:23:27 +02:00
Christophe Simonis 683a7cb029 [MERGE] forward port branch 8.0 up to 1644b92fd8 2017-07-28 16:18:08 +02:00
Christophe Simonis fa3e89064a [MERGE] forward port branch saas-16 up to 104dfe3c07 2017-07-20 11:48:49 +02:00
Christophe Simonis 6fa9ea14fa [MERGE] forward port branch saas-15 up to b31cd558e5 2017-07-19 18:48:42 +02:00
Christophe Simonis b31cd558e5 [MERGE] forward port branch saas-14 up to b857fd4c90 2017-07-19 17:04:28 +02:00
Christophe Simonis b857fd4c90 [MERGE] forward port branch 10.0 up to 11270336fa 2017-07-19 16:21:12 +02:00
Vincent Adriaensen 1e3e3b4bbe [CLA] signature for vincentadriaensen
Done at #18332
2017-07-19 13:34:34 +02:00
Timo Talvitie c0dbbe6320 [CLA] signature for timotalvitie
Done at #18314
2017-07-19 11:58:12 +02:00
pashute b237c3e25e [IMP] doc: move demonstration path
To show forward slash in paths are needed and to use path guidelines

Closes #17989
2017-07-18 17:25:16 +02:00
Jarmo Kortetjärvi 2550cc08c3 [CLA] signature Oy Tawasta OS Technologies Ltd.
Done at #18301
2017-07-18 16:40:40 +02:00
Rakesh Sindhav f0c9275e35 [CLA] Signature for sindhav
Done at #18000
2017-07-18 16:27:36 +02:00
Moisés López c0bdf81a5b [FIX] doc: correct patch line number
to avoid "WARNING: Hunk"

Closes #18286
2017-07-18 11:14:47 +02:00
Christophe Simonis db2f82d5f1 [MERGE] forward port branch saas-16 up to 4ca3d9cadf 2017-07-14 15:51:59 +02:00
Christophe Simonis 4ca3d9cadf [MERGE] forward port branch saas-15 up to aa19cb61f4 2017-07-14 14:27:38 +02:00
Christophe Simonis aa19cb61f4 [MERGE] forward port branch saas-14 up to f1a5e8214e 2017-07-14 13:54:01 +02:00
Christophe Simonis f1a5e8214e [MERGE] forward port branch 10.0 up to 9150d4c552 2017-07-14 13:18:22 +02:00
Moisés López 1dee64eda8 [FIX] doc: correct diff lines
to highlight the modified line

Closes #18230
2017-07-14 11:45:20 +02:00
Moisés López bb7fef79a6 [IMP] doc: Add 'report' dependency
To be able to correctly use report features.
It is auto-install but a good idea to make sure it is present and to show the
report module

Closes #18220
2017-07-14 10:55:30 +02:00
Martin Trigaux 0323b7154b [FIX] doc: correct diff
The attendee_ids line was highlighted instead of the session_ids
2017-07-14 10:48:13 +02:00
Martin Trigaux 1d3d665f2c [FIX] doc: adapt to removal of workflows
Remove one excerice that was in the workflow section
Adapt the diff
2017-07-14 10:45:16 +02:00
Moisés López ca82c77d48 [IMP] doc: remove <data> tag from xml files
Because now is no longer required

Closes #18144
2017-07-13 17:15:51 +02:00
Moisés López 566968bf99 [FIX] doc: use new URI wkhtmltopdf releases
The old release of wkhtmltopdf are no longer published on the download page.
The developer explicitely asks to use the github link

cf: wkhtmltopdf/wkhtmltopdf#3524
    wkhtmltopdf/wkhtmltopdf#3521
    wkhtmltopdf/wkhtmltopdf#3518
    wkhtmltopdf/wkhtmltopdf#3508

Closes #18146
2017-07-12 10:13:32 +02:00
Martin Trigaux ce11312dba [FIX] doc: remove nonexistant reference
business removed at 411f8208
2017-07-12 09:37:49 +02:00
David McNeill 12131b68ed [CLA] Signature for davemc50
Sign Odoo Contributor License Agreement

Signed and included.
2017-07-10 10:38:51 +02:00
Christophe Simonis bf51fe55a1 [MERGE] forward port branch saas-16 up to 0f2b2c4e2b 2017-07-07 14:30:30 +02:00
Christophe Simonis 0f2b2c4e2b [MERGE] forward port branch saas-15 up to 514a1a76d8 2017-07-07 14:18:07 +02:00
Christophe Simonis 514a1a76d8 [MERGE] forward port branch saas-14 up to 5b28570769 2017-07-07 14:14:55 +02:00
Christophe Simonis 5b28570769 [MERGE] forward port branch 10.0 up to aef7748845 2017-07-07 14:13:07 +02:00
pashute 2454dce7c5 [CLA] signature for pashute
Done at #18082
2017-07-06 17:01:24 +02:00
Olivier Dony 464fe4a185 [FIX] doc: clarify: record[field] is valid/recommended 2017-07-06 15:58:47 +02:00
Miku Laitinen 53762814d8 [CLA] updated CCLA for avoinsystems
Done at #18068
2017-07-06 14:49:06 +02:00
Christophe Simonis 7dc731db83 [MERGE] forward port branch saas-15 up to 1f16d34aaa 2017-07-06 13:54:22 +02:00
Christophe Simonis 1f16d34aaa [MERGE] forward port branch saas-14 up to 5009752dcf 2017-07-06 13:53:17 +02:00
Christophe Simonis 5009752dcf [MERGE] forward port branch 10.0 up to 1206cc3f7d 2017-07-06 13:05:24 +02:00
Christophe Simonis 1206cc3f7d [MERGE] forward port branch saas-11 up to 5f7f3209e0 2017-07-06 12:30:51 +02:00