Commit Graph
21 Commits
Author SHA1 Message Date
Romain Derie 8fcf930a6b [IMP] web_editor, website, *: introduce popover as edit system for links
*: website_form

This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.

It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860

closes odoo/odoo#64756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 09:49:45 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Nicolas Lempereur 7252713eac [FIX] website: changing menu sequence clear menu cache
As of 02e01dce51 the website menu is prefetched for the user and saved
in cache.

If the sequence of a menu is changed (eg. with the "Edit Menu" modal on
website), the cache was not cleared so it seemed like this did not work.

With this changeset, changing a menu sequence will clear ormcache.

opw-2244908
closes #50683

closes odoo/odoo#50703

X-original-commit: 8da3276e8b641e615e4c436b4f0f79139d158220
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-05-05 18:45:58 +00:00
Jeremy Kersten 94f8f15036 [FIX] website: make handle_visibility private
This commit:
   - make handle_visibility a private function (even if not
     exploitable in rpc easily since it uses request.website)
   - encrypt the password in db (even if not critic, since this
     password could be shared on twitter, ... it doesn't cost anything
     to secure it a bit more)
   - remove useless sudo, since handle_visibility does a sudo itself.

In the future, this notion of visibility should be handled on controller layer,
and no more on the View layer (during rendering)

closes odoo/odoo#48145

X-original-commit: 06e0e48217f25f17dff23331111f5dcb98e8cecd
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-03-21 10:23:32 +00:00
Romain Derie d47f039fd2 [FIX] website: clear cache when menu group is changed
Otherwise, `_get_menu_ids()` won't be recomputed, meaning removing a group from
a menu won't make it appear for restricted user, and adding a group on a menu
won't hide that menu, until a clear cache occurs.

Introduced with 02e01dce516

closes odoo/odoo#48065

X-original-commit: 0131e6d9103f68950ee23c6b0ef1af972370416e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-03-19 18:25:09 +00:00
Romain Derie b98d9c968c [FIX] website: perf - ormcache the website menus
To avoid a SQL Query on hot state, the website menus ids are now prefetch.

Related to #47257
task-2211013

X-original-commit: 73421c27f01e7100403eaa72e027c34dbdf9f720
2020-03-19 15:37:48 +00:00
Sébastien Theys 1d981f22f3 [FIX] website: perf - prefetch website.menu's mega_menu_content
Since this field is not sanitized, it is safe (perf wise) to prefetch it.
It should not be CPU heavy, plus whenever we access a `website.menu`, it is
most likely we will read that field.

with following structure, 5 SQL queries will be avoided:
- Top menu
  - Home
  - Contact us
    - Sub Contact us
      - Sub Sub Contact us

Related to #47257
task-2211013

X-original-commit: 20cddcd899e7a119fa9f365e62527499f8e5ff7d
2020-03-19 15:37:44 +00:00
Jeremy Kersten e239934abe [FIX] website: allow to modify the visibility of a page
Now, you can define a Visibility mode between:
    Public (All poeple)
    Connected (Portal or Employee)
    Restricted Group (Has this group or is Employee)
    With Password (Know password or is Employee)
    Internal Users (Is Employee)

It is a 'fair' feature, but without really warranty that the content is
really unreadable via others methods, ...

It is more for frontend display, that real secret. Dont use this like
a keychain ;)

We only catch the visibility on the main view and not the t-call inside.

Even if it should work on controller too, it is only display now on the
page property menu. (Or on the view directly in backend)

task-2091365
2019-10-29 16:04:47 +00:00
qsm-odooandAndrea Ulliana 1345702258 [IMP] website: add the ability to create mega menus
Allow users to create complex website menus, also known as "mega menus".
Mega menus are enabled individually via the edit menu dialog, then their
content can be customized by dragging snippets in them like any other
snippets area in edit mode.

task-1925319

closes odoo/odoo#36097

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: Andrea Ulliana <aul@odoo.com>
2019-09-03 15:31:42 +00:00
qsm-odoo 3daed421f4 [FIX] website: restore edit menu dialog
Since saas-12.5, with recent ORM changes, writing on non-existing fields
does not trigger a warning anymore but instead crashes. This revealed
that the 12.0 "Edit Menu" dialog was doing some of that. Indeed,
depending on what was edited, we ended up writing on the 'is_homepage'
field, the 'text' field, the 'isNewWindow' field, ... which do not
exist.

This commit takes advantage of the fix to also lint the dialog code and
convert some of it to ES6.

Discovered while working on task-1925319

closes odoo/odoo#36204

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-29 07:24:16 +00:00
Christophe Simonis 3faea8fbf8 [MERGE] forward port branch saas-12.4 up to f26de445e5 2019-08-21 10:10:11 +02:00
Christophe Simonis 168e54d488 [MERGE] forward port branch 12.0 up to 32039b2ab4 2019-08-19 18:57:08 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Adrian Torres 9e71d57d11 [REM] *: remove calls to api.one and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
2019-07-05 09:04:45 +00:00
Romain Derie ea3a2ab678 [IMP] website: show website name in ir.ui.view name_get
Before this commit, it was impossible to know which view was the one searched
if there was COW views.

Indeed, since multiwebsite, views might get duplicated from one website to
another. Then, when searching for an ir.ui.view in a form view, every
duplicated view would be listed next to each other with the exact same name
without a way to identify which one comes from which website.

This commit will suffix the view name by its website_id if there is one.

To do so, we use the context key that has been introduced with 62d73253f3.

task-1920052

closes odoo/odoo#33307

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-01 09:48:57 +00:00
Jeremy Kersten b5091c7017 [ADD] website: ability to restrict groups on website menu
Courtesy of @Yenthe666

This commit closes odoo#32580

closes odoo/odoo#34039

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-11 15:41:25 +00:00
Christophe Simonis cf52a04979 [MERGE] forward port branch saas-12.1 up to d3b8422c9c
closes odoo/odoo#30614
2019-01-28 13:58:11 +00:00
Jeremy Kersten 53faa6206f [REF] website: split class by file and keep history 2019-01-18 10:16:51 +01:00
Jeremy Kersten 7cafe0cd3e [REF] website: add new file for website_menu.py 2019-01-17 15:10:54 +01:00