Commit Graph
107 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 6441ea28b3 [MERGE] forward port branch 10.0 up to cc7ae17bd5 2017-05-02 18:12:09 +02:00
Christophe Simonis cc7ae17bd5 [MERGE] forward port branch saas-11 up to 73527d0fc6 2017-05-02 17:05:42 +02:00
Christophe Simonis 73527d0fc6 [MERGE] forward port branch 9.0 up to c66e454f06 2017-05-02 16:17:35 +02:00
Christophe Simonis c66e454f06 [MERGE] forward port branch saas-6 up to 671864e72b 2017-05-02 12:07:05 +02:00
Christophe Simonis 671864e72b [MERGE] forward port branch 8.0 up to 0b4d01f1d3 2017-05-02 11:40:48 +02:00
Richard Mathot eefd0de541 [FIX] safer company name as email sender
In some email templates of Odoo, the From: field is generated from the
company name. If this name contains an "&" character, this will lead in
an escaping eg; &amp;

Sender header will look like:
From: Machin &amp; Brol <machinbrol@toto.com>

This case is not well handled by email providers like Gmail, that
splits the line on the ";" and considers there are 2 senders, and then
discards the email.

We then fix the templates, waiting for a better fix in master.
2017-04-28 10:19:06 +02:00
Raphael Collet d0ca2d115e [REF] ir_config_parameter: remove group_ids and simplify
Add `sudo()` to call `get_param` where necessary, and make the web client use a
controller instead of directly accessing parameters.
2017-01-03 16:52:49 +01:00
Raphael Collet 7543afb070 [IMP] base, *: tighten ir.config_parameter access rights
Add `base.group_system` on existing parameters:
 - `auth_signup.allow_uninvited`,
 - `auth_signup.reset_password`,
 - `auth_signup.template_user_id`,
 - `google_redirect_uri`,
 - `mail.bounce.alias`,
 - `mail.catchall.alias`,
 - `mail.catchall.domain`.
2017-01-03 16:52:49 +01:00
qsm-odoo fb363b572b [FIX] *: adapt odoo interface violet
Change color #a24689 to #875A7B

Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).

Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
2016-10-05 10:29:00 +02:00
Denis Vermylen (dve) e9426b03e7 Revert "[IMP] website, doc: replace eCommerce by e-Commerce"
This reverts commit b4d7b7e6dc.
Odoo always uses term eCommerce
2016-09-06 13:55:12 +02:00
Denis Vermylen (dve) b4d7b7e6dc [IMP] website, doc: replace eCommerce by e-Commerce 2016-09-02 17:42:42 +02:00
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Xavier Morel 13e2fda203 [REM] website_forum: commented challenges 2016-08-05 10:18:02 +02:00
Thibault Delavallée 9f904d9d8e [IMP] website_forum: better email for validation
More new odoo style.
2015-11-26 15:15:18 +01:00
Martin Trigaux a2f6e77b08 [FIX] English
Typos, unclear, rephrase, harmonise terms.
Thanks Transifex reporters!
2015-11-17 16:54:18 +01:00
Thibault Delavallée 9e69e5229a [IMP] website_*: template update
Website modules templates are updated :

- website_slides: published and shared templates updated
- forum: confirm email updated
2015-11-02 11:51:09 +01:00
Julien Louette 205ce98656 [IMP] website_forum: moderation & anti spam 2015-09-05 14:44:06 +02:00
Yenthe 291cb7e3dd [FIX] website_forum: typo in data
closes #8291
2015-08-31 09:35:21 +02:00
Thibault Delavallée 4b122ad41d [MIGR] mail: migration to the new API 2015-04-27 10:36:15 +02:00
Parth Gajjar f76ca21b15 [IMP] website_forum : improve tag ordering, add 'in menu' checkox when create a forum, customize welcome_message on a forum, better fetch link title when insert it, display answers of a question on form view, ans some changes in faq 2015-03-12 15:41:10 +01:00
Mitesh Savani cf925c2a58 [TEST] website_forum: add testing tour for the forum. 2015-03-11 14:58:20 +01:00
Christophe Simonis aec02cb493 [MERGE] forward port of branch 8.0 up to d350f5b 2015-02-20 18:16:01 +01:00
Christophe Simonis a5735e7891 [FIX] website_forum{,_doc}: noupdate for website.menu 2015-02-20 14:55:07 +01:00
Jaysinh Shukla 5f987f8745 [IMP] website_forum: added social sharing on questions.
A widget based on website share widget has been added that allows to share
questions and answers on social networks. Old posts can also be bumped
through sharing.

New fields have been added on forum model allowing to disable the old
question bump and social sharing modals.

Courtesy of RD India: Ajay Patel (apa@odoo.com), Jaysinh Shukla
(jsh@odoo.com)
Courtesy of use Merge: Damien Bouvy (dbo@odoo.com)
2015-01-22 17:02:17 +01:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Jeremy Kersten 86c634965e [MERGE] forward port of branch 8.0 up to 5ed0739 2014-11-18 10:40:59 +01:00
Jeremy Kersten 86a6619dc8 [FIX] website_forum: add fake tour for people waiting the tour. To remove in master. Without it, localstorage loop to search this unexisting tour after the install... 2014-11-17 16:50:52 +01:00
Parth Gajjar 893d7fa864 [MIGRATE] website_forum: migration to the new API, cleaning and linting of models and controllers.
Main cleaning
- remove introduction_message, introduced in saas-6 with inboung forum, that was quite
a duplicate of description.
- renamed relevancy_option_first and relevancy_option_second, introduced in saas-4
with inbound forum
- renamed type of post to post_type to avoid confusion with the type keyword
- some cleaning in templates
2014-11-04 15:59:55 +01:00
Christophe Simonis 4b6c948be5 [MERGE] forward port of branch 8.0 up to ed92589 2014-10-23 17:14:35 +02:00
ssh-odoo ef8099424d [IMP] [TEST] website_forum: security fixes + tests
- fixed voting, karma check could be avoided
- fixed posting comments, now correctly checking karma (not for
notifications)
- fixed bootstraping of users, now not allowed to ask questions by default;
added validation email that gives the first karma points required to
participate
- added tests
2014-10-23 11:36:03 +02:00
Fabien Pinckaers bdcd76b696 [IMP] name is name (and not URL in case of links 2014-10-05 15:57:37 +02:00
tpa-odoo 95ade32e4d [ADD] website_forum: added demo data for article and discussion. 2014-09-23 14:28:25 +05:30
tpa-odoo 7f2d4f2ce5 [ADD] website_forum: added new funtionality to post Articles and Discussions also on forum insted of only questions. On articles and discussions users kan post multiple reply on each post insted on only one reply per post and users will able to post reply on any other reply. in list posts will be default sorted by relevancy. show introduction message when people not logged in. 2014-09-23 14:28:25 +05:30
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Thibault Delavallée 2a4ec367a9 [IMP] [FIX] website_forum: cleaned and improved the management of available actions based on the user's karma. The karma levels are now stored on the forum itself, allowing customization. The various check of karma are done at model level and not at controller level anymore, leading to a more secure and easier to inherit behavior. 2014-07-01 10:29:37 +02:00
Xavier Morel 46712acaec [FIX] bunch of changes lost in incorrect merge f4d78ae738 2014-05-30 17:00:52 +02:00
Xavier Morel d325c0caef [REV] attempt to revert incorrect removals in f4d78ae738 2014-05-30 16:00:28 +02:00
--global 2649beba97 [IMP] website_forum: make forum;forum inherit from mail.thread. This way we
add the possibility to users to follow a forum and be automatically followers of new
questions, using some new subtypes on the forum.forum model that do the auto subscription.

Also added a profile link on the forum, when logged.

Also added a subscribe button on the forum.
2014-05-22 13:49:41 +02:00
Christophe Simonis a756b82372 [MERGE] forward port of branch saas-4 up to revid bb26dea 2014-05-20 20:19:55 +02:00
Martin Trigaux 70d3652c27 [FIX] remove closing reason 'an answer was accepted', the questions should be left as open to be possible to improve the answer afterward 2014-05-20 14:41:56 +02:00
Martin Trigaux 8da2cb6d4a [FIX] definition of badges 2014-05-20 14:31:55 +02:00
Martin Trigaux dab3557253 [FIX] website_forum: correct the 'Editor' goal definition, the field author_id on a mail_message is a m2o to res.partner and not res.users
bzr revid: mat@openerp.com-20140509134434-6u2ft2gyv0hcryxq
2014-05-09 15:44:34 +02:00
Christophe Simonis 643871c20f [FIX] website_forum: set config parameter via dedicated function
bzr revid: chs@openerp.com-20140507134127-xmp9kza1mvy37jf1
2014-05-07 15:41:27 +02:00
Martin Trigaux f756fa671e [FIX] gamification: remove wrong double quote in xml
website_forum: restrict granting rights on forum badges

bzr revid: mat@openerp.com-20140422090937-l2mxc828hof9u8pi
2014-04-22 11:09:37 +02:00
Martin Trigaux bb8e24d951 [FIX] website_forum: set badges and challenges in noupdate
bzr revid: mat@openerp.com-20140418124112-m97idrklxq8y3e3f
2014-04-18 14:41:12 +02:00
Martin Trigaux 0c32e7241d [IMP] use char_domain widget
bzr revid: mat@openerp.com-20140416152208-1rnyyvr35m0kj5cm
2014-04-16 17:22:08 +02:00
Martin Trigaux 9094a7aab9 [FIX] forum: conversion of incorrect group to domain
bzr revid: mat@openerp.com-20140416151410-d59osro704v2zfdq
2014-04-16 17:14:10 +02:00
Martin Trigaux d79cbd3fb8 [FIX] gamification: convert autojoin_group_id to a domain representing the list of users
bzr revid: mat@openerp.com-20140416151026-lmvyo8k0wo4hw9gn
2014-04-16 17:10:26 +02:00
Martin Trigaux 15306066d0 I love the smell of napalm in the morning.
bzr revid: mat@openerp.com-20140415113545-31efpjddjwqr4ajl
2014-04-15 13:35:45 +02:00