Commit Graph
335 Commits
Author SHA1 Message Date
Rohan Patel 4d1cef1b1f [IMP] website: improve dashboard header to have a website-related dashboard
This header displays icons that proposes to install other website related
applications.
2017-03-03 16:57:06 +01:00
fwi-odoo 44182fe1b8 [FIX] website: Keep url query when redirecting to /page/website.* 2017-03-03 14:11:00 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Christophe Simonis eddefc9948 [MERGE] forward port branch 10.0 up to 8c55e57c7f 2017-03-01 16:14:41 +01:00
Christophe Simonis 7abeace770 [MERGE] forward port branch saas-11 up to 5c4744cd1f 2017-03-01 15:17:55 +01:00
Christophe Simonis 5c4744cd1f [MERGE] forward port branch 9.0 up to 5f9f4f4d9d 2017-03-01 14:07:15 +01:00
Jeremy Kersten 2bf6eab609 [FIX] website: fix sitemap for multi website if more than one page
Template "sitemap_index_xml":
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="page"/>.xml</loc>
should be:
    <loc><t t-esc="url_root"/>sitemap-<t t-esc="website_id"/>-<t t-esc="page"/>.xml</loc>

The fix in python is not elegant but allow to fix without -u of website.
2017-02-24 20:52:22 +01:00
qsm-odoo 7751c1bfb9 [REF] web_editor, website: split customize_template_get
Commit a2ae219d4e fixed the customize_template_get
function(s) which had been modified for the 10.0 web_studio release.
While the fix also reorganized the structure to make it more efficient
and understandable, it promised that the function would be refactored
in master. This is what this commit does.

The customize_template_get route of the website module was also removed
with commit 5a030db3eb as it was an useless
duplicate of the web_editor customize_template_get route.

The old route handled two totally different features of odoo: getting
all the page-related views to allow their edition with the HTML editor
and getting the "toggable views" which appear in the "Customize"
website menu. The parameter "full" allowed to determine which one the
route was supposed to do and was useless until website was installed to
add its feature (by extending the route behavior). In both cases, views
informations are returned, only the number of views differs. The
above-mentionned fix already did part of the refactoring by returning
the same info structure for each view in both cases.

Now, the function has been split. The web_editor customize_template_get
route is renamed as get_assets_editor_resources and returns the info the
HTML editor needs to work (the "assets" term is in prevision of the
new LESS editor).
A new website route "get_switchable_related_views" has been created to
return the info the "Customize" website menu needs.
Both use the renamed ir.ui.view function "get_related_views" (old
ir.ui.view customize_template_get function) which now returns a
recordset and not a list of dictionnaries.
2017-02-14 16:32:15 +01:00
Christophe Simonis b33f919e3d [MERGE] forward port branch 10.0 up to aec8e25 2016-12-06 17:38:40 +01:00
Christophe Simonis aec8e2582f [MERGE] forward port branch saas-11 up to 345755e 2016-12-06 17:24:37 +01:00
Christophe Simonis 5301951931 [MERGE] forward port branch 9.0 up to 1f3f155 2016-12-06 15:18:45 +01:00
Jeremy Kersten 8f48baeda6 [FIX] website: fix sitemap for multi website 2016-12-02 15:31:06 +01:00
qsm-odoo 5a030db3eb [REF] website, web_editor: refactor ace editor
Stop using ugly code for ace editor.

* Really close the ace editor by changing its display property thanks
    to the dedicated do_show and do_hide method.
* Make the common part of ace editors (website, web_studio) consistent
    so that the extensions are really small.
* Do not do RPC to retrieve data already retrieved (now, there is only
    one unique RPC when the editor starts an one RPC per view changed
    on save).
* Fix born-dead code so that the website editor starts automatically
    if the URL contains its associated hash and loads the correct view
* Better handle errors (previous behavior only worked partially and
    only on chrome):
    - Jump to the error line and make it red.
    - Do not open a Dialog with mostly incomprehensible message but
        allow to open it on click of the error marker.
    - Do not save any changed file if one contains an error.
    - Do not allow formatting a file if it contains an error (show the
        error instead).
* Do not use different routes to get the same content (remove the
    /website/customize_template_get route as it returns the same
    content as /web_editor/customize_template_get route). Note: in
    a further commit this route will be refactored.
* In a general way, use consistent method names and behaviors /
    comment the code / lint files / ...
* Open the code to extensions (so that it may later load other data
    than XML).

Note: this refactoring allowed to fix bugs in previous odoo versions
but this commit message will not detail them.
2016-11-08 14:18:28 +01:00
Nicolas Martinelli 756262639f [FIX] website: traceback in route '/website/action'
The route `/website/action` crashes since `action` and `action_id` might
not be defined.

opw-691634
2016-10-19 14:38:24 +02:00
qsm-odoo a2ae219d4e [FIX] web_editor, website: fix customize_template_get
Commit e11f23b701 split the website
customize_template_get into web_editor and website ones. This split
was not perfect and commit 20861b482a
tried to make it work... but did not made it totally and added an
indirect dependency to website module in web_editor...

As the final result is wrong and inconsistent and that the previous
9.0 implementation was already ugly, this was not possible to make
a consistent full-stable fix.

This commit tries to make a fix as stable as possible (the main method
name did not change, the arguments did not change, their purpose is
the same, ...) which makes the code work and be less ugly. However,
the function returns are now slightly different (and JS depends on it).
It returns only valid view information (not header stuff which is not
related to anything and the inherit_id value is now a combination of
the inherit view id and name). Also, a new private method has been
created.

Also, the method contained code which was deprecated since saas-6 but
was never removed (and never broke anything "by chance").

In master these methods will be refactored to make more sense.
2016-10-14 13:16:49 +02:00
Jeremy Kersten 274b1dabb9 [FIX] website: reset full to False by default
Studio altered (probably by error) the default value.
We reset the old default value, and by security, add the params in the call
2016-09-30 15:11:58 +02:00
Martin Geubelle e11f23b701 [REF] web_editor, website: move ACE editor to web_editor
The commit e59a7fe3ff has moved
the ACE editor from website to web_editor. As some code on ir_ui_view
was used for this widget, the code has also been moved to web_editor.
2016-09-28 16:55:51 +02:00
Damien Bouvy a9a4863034 [FIX] website: improve ACL support
The dashboard must be visible for non-'group system' users, hence
the sudo call + only display the link to modify the client id
if the user has sufficient access rights.

Small visual correction for live users counter in the dashboard.
2016-09-16 15:48:48 +02:00
Damien Bouvy 904f06f070 [IMP] website: make the website dashboard ACL aware
The Website Admin dashboard displays graphs for sales, analytics,etc.
using a (somewhat easily) extensible js framework.

Unfortunately, this framework is ACL unaware, meaning that it will
completely and silently crash if you are missing any of the required
access rights.

To solve this, extensions must now specify not just a graph name
but a necessary group for it and set the value for this group in
the extension of the backend controller.

This commit also
- make the icon visible for the group 'Website Designer and Editor'
  (not juste the Settings group, which is extremely restrictive)
- make the button to set the Google API key only visible to people
  with sufficient access rights
2016-09-16 11:46:39 +02:00
Aristobulo Meneses 814eae1fbd [FIX] website: avoid redirect to website after login
When logged in a user was redirected to the website instead of the backend.
This was due to a wrong group verification, at that point:
- request.uid = ID of the user authenticating (e.g. admin)
- request.env.uid = ID of the user that rendered the page (public)

As public does not belong to `base.group_user` group, the user was redirected to
the website.

Introduced at fd09ddb6 during migration.

Fixes #13203
Closes #13204
2016-08-19 17:16:30 +02:00
Jeremy Kersten 4cfd86edaa [IMP] website: rename xml_id website.info to website.website_info
After this commit, the end user will be able to create the page /page/info.
2016-08-17 10:24:59 +02:00
Jérome Maes 8a399930f3 [REF] website_*: remove render method on website
Since saas-3, website controllers use `request.website.render`
to render the template of a web page. This was kept for retro
compatibility. It's time to stop using deprecated stuff.
Same for `_render` method on website.

'json' route don't use `request.render` since
`JsonRequest` has no `render` method.
2016-08-04 12:02:14 +02:00
Ravi Gadhia fd09ddb6f3 [MIG] website: migration to new api
Migration of website module to new API.
The tricky phase is ir_http.py : we need to use `request.env`
only when the authenfication phase is done. Normally by
calling `super` of `_dispatch` method, but website module
required it to be done before. This is important since
`env`is a lazy property of `request` object.

Some hack were kept since this commit is a migration ('RequestUID'
in ir.http, ...)

Some docstrings were added.
2016-08-04 12:02:14 +02:00
fwi-odoo d4e813b873 [REF] web, *: change deprecated import openerp.addons.web.http to odoo.http
We also remove the mock in web as there is no need for it anymore.
2016-08-03 13:42:05 +02:00
Christophe Matthieu 70a69bf9bc [FIX] website/im_livechat: use new api to get asset
Issue: can't get asset content, self don't have env attribute, wrong attributes send.
2016-07-05 18:44:58 +02:00
Christophe Matthieu f1e3ac88f8 [FIX] ir_qweb/website: must adapt AssetsBundle call to nex new syntax
AssetsBundle receive the files list instead of to load the xml content itself (speed up because the file list is cached).
2016-07-05 11:31:03 +02:00
Jeremy Kersten e11a836c10 [REF] website, website_blog, website_sale: move QueryURL to be common 2016-07-04 15:48:15 +02:00
Jeremy Kersten 15fe3d43b4 [IMP] base: add required state for address
Some address have required state.
We add by default moreover 500 new states.

We try also to merge duplicated states
wich have the same country and code.

Once merge is done, we try to had the unicity constraint
to avoid futur duplicates.

Merge code, should be removed in v11.
2016-07-04 15:48:15 +02:00
Christophe Simonis 79976bd779 [MERGE] forward port of branch saas-10 up to 6e95659 2016-04-01 19:10:34 +02:00
Christophe Simonis 6e95659a08 [MERGE] forward port of branch saas-9 up to f4d1adc 2016-04-01 18:51:55 +02:00
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00
Denis Ledoux 69fa2d5662 [MERGE] forward port of branch saas-6 up to 8f1782b 2016-03-30 11:23:18 +02:00
Denis Ledoux e9bcaad09e [FIX] website: partial revert of 6207644
Before this revision, it was possible to use the
`/website/image` controller using kwargs only
e.g.
`/website/image?field=datas&model=ir.attachment&id=718207`

After, it's no longer possible.

It was assumed `/website/image` without any argument
in the route itself (`<xmlid>`, `<field>`, ...)
could simply never be called,
but this is not the case.

We therefore restore it by retro-compability purposes.
2016-03-24 18:05:31 +01:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
Christophe Simonis 42e3ed9ed3 [MERGE] forward port of branch saas-6 up to 0a1de99 2016-03-23 12:11:39 +01:00
Denis Ledoux 6207644c00 [FIX] website*: remove technical routes in sitemap
Multiple technical routes were listed in the sitemap,
and it's pointless to list them in the sitemap.

There is currently no way to exclude routes
from the sitemap using a specifc argument
(e.g. sitemap=False on the route).

Therefore, in order to remove them from the sitemap,
we play with the current conditions to exclude
these routes from the sitemap:
 - routes with `auth` other than `none` and  'public`
   are excluded. Technical routes marked as `auth="public"`
   for no reasons are changed to `auth="user" so they
   are excluded from the sitemap
 - routes with required arguments are excluded as well.
   the route `website/image` cannot work without any argument,
   `website/image` has therefore been removed from the possible
   routes for the method `website_image`, so it's no longer
   listed in the sitemap.

For an exhaustive list of the conditions to exclude
a route from the sitemap, check the method
`rule_is_enumerable` in `website/models/website.py`

opw-670865
2016-03-22 18:01:41 +01:00
Raphael Collet 4ddc323139 [FIX] base: fix and complete migration of base/ir
- add or fix decorators on methods
- fix most compute methods (wrong dependencies)
- revert changes in `eval_context` of `ir.actions`
- various code simplifications and improvements
- migrate methods that were not
- ir_qweb: modify `QWebContext` to take an environment instead of `cr`, `uid`, `context`
- ir_qweb: convert `AssetsBundle` to use new API `env`
- ir_ui_view: use decorator `multi` on method `read_combined`
- ir_ui_view: ensure that method `render` is never called with an xml_id
- ir_ui_view: factor out part of the `ormcache` key of method `_read_template`
2016-03-21 13:46:44 +01:00
Martin Geubelle 42c82d57de [ADD] website, website_sale, website_crm: new dashboard 2016-03-10 13:41:10 +01:00
Christophe Simonis c9751aff03 [MERGE] forward port of branch 8.0 up to c3a05d0 2016-02-26 16:23:12 +01:00
Jeremy Kersten 9ecd80eaeb [FIX] website: sitemap fix length
Iterator was consuming the first 45k records.
So don't need to specify an offset, because that will ignore the next 45k.

Eg: if step of 5, and range(1,13),
it will only use [1, 2, 3, 4, 5, 11, 12, 13]

Cherry-pick/backport of de8296c3a8
2016-02-25 09:26:56 +01:00
qsm-odoo 88c2b6843a [REF] web,web_editor,website(_*),report,pos,mass_mailing: assets
* Remove recursive assets inclusions (i.e. assets_editor was including
assets_common, summernote, ...)
* Better construct the assets (link, then script + type attribute)
* Better include the assets (split js / css, always use t-call-assets)
* Simplifies the number of assets
* Move bootstrap js to assets common
* assets_frontend is now created by web module to allow using it on the
connexion page but also in the web_editor, where colors have to be
bootstrap/theme ones. Note: if a module depends on website, then keep
using the inherit_id="WEBSITE.assets_frontend"
2016-02-24 13:47:06 +01:00
Jeremy Kersten 1f6412a0a4 [FIX] website: sitemap render content at first call
Bug from 0c37a8d
At regeneration of sitemap, content was not set
2016-02-02 12:33:54 +01:00
Jeremy Kersten 0c37a8d523 [FIX] website: rename sitemap-1 to sitemap if only one file.
Old code was duplicating the sitemap if less than LOC_PER_SITEMAP urls
2016-02-01 19:07:18 +01:00
Jeremy Kersten de8296c3a8 [FIX] website: sitemap fix length
Iterator was consuming the first 45k records.
So don't need to specify an offset, because that will ignore the next 45k.

Eg: if step of 5, and range(1,13),
it will only use [1, 2, 3, 4, 5, 11, 12, 13]
2016-02-01 17:12:14 +01:00
Jeremy Kersten ce3f797068 [FIX] website_event: avoid traceback when page doesn't exists
The controller /event/<event_id>/page/<page> raise exception if page is not existing.

Allow to pass the template reference when user are creating a new page.
Without it, it is impossible for the end user to create a website_event page without
change manually the xml id because the xml id is based on the module from the template.

This fix is retro compatible, because from_template will be ignored until next update
of website. And during update from website, website_event will be updated because it's a
dependance and so the default_page template created.
2016-01-08 23:19:29 +01:00
Martin Trigaux a9ec2894de [MERGE] forward port of branch saas-6 up to 19fe77b 2015-12-01 08:41:52 +01:00
Denis Ledoux b27fc372f4 [MERGE] forward port of branch 8.0 up to adf6d0e 2015-11-26 11:24:15 +01:00
Denis Ledoux b459c4dc03 [FIX] website: possibility to set no url for the home menu
Unsetting the URL of the menu `Home`,
in Settings > Configuration > Website Settings > Configure Website,
leaded to the unavailability of the website.

opw-657572
2015-11-26 10:02:41 +01:00
Christophe Simonis 56a442e205 [MERGE] forward port of branch saas-6 up to dade7e3 2015-11-25 13:26:02 +01:00
David Monjoie c016078f7b [FIX] website: no login_success on oauth redirect
It seems like nobody other than me ever had issues with this line
since its introduction in January 2015, so I just swapped the
conditions, since this param is seemingly always present, unless
you are using oauth with redirect.
2015-11-18 10:58:44 +01:00