Commit Graph
490 Commits
Author SHA1 Message Date
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Goffin Simon 5b554499e8 [IMP] website_version: cache enable
The visitors who have the same sequence of versions for their running experiments must
share the same cache.
2015-09-18 10:31:21 +02:00
Olivier Dony 5ec9079e50 [FIX] website: use CDN only for public requests
The CDN domain will typically be different from the main
website domain, so session cookies cannot be shared.
This means that assets that require elevated privileges
(such as the website editor rights) will not be reachable
from the CDN's proxy server.
This could cause random problems with CSS/JS/images not
being accessible.
The benefits of the CDN are mostly meant for the masses
of new visitors (less workload and less bandwidth consumed
for the main domain) anyway.
Authenticated users are also returning users that have most
of the resources in the browser cache anyway (assets bundles
and images, typically).
2015-09-17 19:39:23 +02:00
Olivier Dony a4d19312c5 [FIX] ir.qweb: context may be an immutable frozendict 2015-09-17 16:40:51 +02:00
Christophe Simonis 6d85a9a4b9 [MERGE] forward port of branch 8.0 up to d744923 2015-08-27 18:30:46 +02:00
Nicolas Lempereur 8c77c711ee [FIX] website: escaping saved html content
Escape text nodes changed via the web editor before sending the content
it to the server controller.

It is done since the content is unescaped one time when being displayed,
and it is not done for inline style and script tags (which may be
injected by dropping a snippet) since that would break them.

replacing the solution in cdb900044.
2015-08-27 17:27:39 +02:00
Denis Ledoux ed214a6681 [FIX] website, website_sale: alternative for images
Images should have an alternative
(the "alt" attribute") in order
to be W3C compliant (accessibility).

opw-648135
2015-08-27 15:46:14 +02:00
Christophe Matthieu d4bae06d08 [IMP] web: use css to display attachment mimetype
Widgets and website display images or display the type with icon like pdf, doc...
2015-08-21 22:06:52 +02:00
Christophe Matthieu 6baf611df1 [IMP] web: create generic controller '/web/content' and '/web/image'
Replace deprecate controllers like /web/binary/image, /web/binary/saveas...
Use ETag for all content with 'unique' option to cache the content if the content is never changed.
2015-08-21 22:06:52 +02:00
Antony Lesuisse 4feb82dd49 [REM] website: kanban helper
website_project has been removed and this helper is now useless.
2015-08-14 13:33:31 +02:00
Christophe Simonis 2922f70de3 [MERGE] forward port of branch 8.0 up to 09ceb9c 2015-08-13 15:24:57 +02:00
Nicolas Lempereur cdb9000449 [FIX] website, base: escaping and unescaping html
When saving a template in version 8.0, html would be saved as it should
be displayed once on the site. In particular, if some text should be
escaped once send to the browser, it will be saved as such.

But when rendering, a text node content is unescaped two times:

* for translation which seems wrong since we already use .text of a node
  which already escaped it, doing it one more time is bad,

* when rendering the template, since the html template is stored in xml,

This commit remove superfluous unescaping for translation, and add an
escaping when saving the changed template content.

closes #7967
opw-646889
2015-08-13 15:15:24 +02:00
Yannick Tivisse ed4137495c [FIX] website: website_publish_button toggle when no url can be found 2015-08-05 21:40:57 +02:00
Gaurav Panchal 0cbf2e596f [IMP] website: Inherit website.seo.metadata model and remove metadata related field 2015-07-31 12:57:24 +02:00
Christophe Matthieu b183817218 [FIX] website: infinite loop in website add page method 2015-07-10 17:00:16 +02:00
Christophe Matthieu 9665882fba [IMP] web_editor: adapt css, js and xml to use web_editor 2015-07-10 17:00:12 +02:00
Christophe Matthieu 8c559044a5 [IMP] web_editor: split website into web_editor (to use editor in backend for html field) and website 2015-07-10 17:00:11 +02:00
Thibault Delavallée c128ddf827 [FIX] website: remove unnecessary dependency from website
to mail. The only use was to update a method of publisher_warranty.contract
model that is defined in mail.

This code has been moved to the bridge module between website and mail
aka website_mail.

Dependency to share has also been removed.
2015-07-01 10:58:20 +02:00
Christophe Matthieu 3e0d7e6664 [FIX] website: can't create twice the same page because there are a infinity loop 2015-06-30 15:13:52 +02:00
Christophe Simonis a304194936 [MERGE] forward port of branch saas-6 up to 81b5c60 2015-06-25 00:26:31 +02:00
Julien Legros b4d66099ca [IMP] website_*: website publish button
When clicking on the publish/unpublish button in a form view, if the
user does not belong to the `base.group_website_publisher` group,
fallback to a simple toggling behavior.
2015-06-19 12:22:46 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Christophe Simonis 45a805c76b [MERGE] forward port of branch 8.0 up to 26e7742 2015-05-21 16:45:05 +02:00
Olivier Dony 8d745f9f50 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 15:26:35 +02:00
Raphael Collet ede4304790 [IMP] adapt all calls to ormcache() to its new API
This fixes a bug on some methods.  Because `ormcache` uses the decorator
`decorator`, the `context` argument is passed positionally to the decorated
lookup method, instead of being passed as a keyword argument.  As a
consequence, the context dictionary is included in the cache key, which makes
the cache lookup fail all the time.

Using the new API of `ormcache` gracefully fixes this issue.
2015-05-19 09:59:42 +02:00
Raphael Collet 1431d9d29d [FIX] ormcache_context: adapt it to the new API and implementation of ormcache 2015-05-19 09:59:42 +02:00
Antony Lesuisse fffaf40617 [FIX] website: geoip restore city file location
And change the warning message with instruction on how to install the database,
debian geoip-database-contrib has a script to easily install it.
2015-05-18 11:46:42 +02:00
Antony Lesuisse 49a5a355c2 [FIX] website: ir.http cache add lang in key 2015-05-18 11:06:34 +02:00
Odoo Online ffd72b7f58 [FIX] website: http cache some handler dont have routing 2015-05-17 17:44:30 +02:00
Antony Lesuisse ceb53fad6d [IMP] website: ir.http route cache for auth public
- remove useless cache clear_prefix
- add a route cache attribute when used it will save the rendered page into the
  ormcache for the specified time, this is only enabled if the user is public
  and reponse code is 200
- enable it on /page controller for 5min
2015-05-17 17:08:13 +02:00
Antony Lesuisse 714aaca03e [FIX] website: ir.http geoip default file
- set the default value to be the debian bundled geoip database.
- split into 2 methods to avoir bloating dispatch
2015-05-17 16:45:22 +02:00
Darshan Kalola 50a043d979 [IMP] website, website_sale, crm, web_planner : add planner for website modules
This commit impact crm, website, website_sale and web_planner modules because it
- add planner for website and website_sale
- improve planner notebook by setting texterea and input size to 100% and using col-md-* class
- split js code into common part (used in backend and frontend) and backend part (only for backend)
- adapt some tour, since every page will have the planner modal in its DOM, the tour selectors msut be more accurate
- introduce some style fixes and adaptations
- ...
2015-05-15 10:59:42 +02:00
Christophe Simonis 2260496879 [MERGE] forward port of branch 8.0 up to a939a27 2015-05-05 18:48:34 +02:00
Jeremy Kersten 9f93a9ae1c [IMP] ir_http: add facebookinternalhit in the list of bot.
Avoid redirect in en_US if lang is installed  when a link is added via Facebook
2015-05-05 10:55:00 +02:00
Olivier Dony c667eb06b8 [FIX] website: only consider valid languages in URL path
Improves aea358ca67 and avoid spurious
redirects for URLs that do not match a controller but do not
have a valid language.

When the URL does not match any controller, the language
matcher tried to strip the leading path component, treating
it as a language code. For example:
    /fr_BE/page/homepage
would not match any route, so it would be rerouted internally
as  /page/homepage, after setting `request.lang` to fr_BE.

This breaks the magical 404 handler that allows ir.attachment
entries to be mapped to static URLs. Due to the internal rerouting,
the mapping of e.g. /website_mycompany/static/src/image/logo.png
would be rerouted to /static/src/image/logo.png and not match
the mapped URL anymore.

Now the stripping of the path component will only occur if
that path component matches an installed language code.

The consequence is that URLs containing uninstalled language codes
will now lead to 404 errors - an acceptable trade-off (e.g.
when an older version of the website is still indexed by a search
engine)
2015-05-05 10:12:22 +02:00
Jeremy Kersten aea358ca67 [FIX] website: ir_http - auto redirect for lang, use cookies to save pref language
Save in cookie the last lang selected to allow to stay consistent at the next visit from visitor
2015-04-29 14:19:52 +02:00
Jeremy Kersten 6ced9780e9 [IMP] ir_http: add facebookinternalhit in the list of bot.
Avoid redirect in en_US if lang is installed  when a link is added via Facebook
2015-04-24 12:31:42 +02:00
Antony Lesuisse 269badc42a [FIX] website: customize fails in a windows cmd
because python is unable to print unicode string to the terminal.
2015-04-23 21:19:46 +02:00
Jeremy Kersten 1e810a5493 [IMP] base: auto redirect if // in url
Redirect odoo.com/page//contactus ==> odoo.com/page/contactus

(only for get method)

Apache don't redirect but search for route with only one slash...
For SEO optimization, Odoo force a redirect permanently
2015-04-14 10:10:16 +02:00
Christophe Simonis 3206a35aed [MERGE] forward port of branch 8.0 up to 8ac8281 2015-04-13 12:07:58 +02:00
Xavier Morel 64a72d3780 [FIX] ir.http: avoid re-authing when not needed
The extra auth blows an environment and causes an extra query
of ``website`` before calling the controller.

The preceding two SQL queries likely can't be avoided: one uses uid1 to fetch
the current website's public user in order to set it, the other one
fetches the current website using the user set beforehand
2015-04-10 18:23:31 +02:00
Jeremy Kersten 99ab640499 [FIX] website: no left strip at minimize html
<b>2</b><p> comments</p>  ==> need to keep the space
2015-04-10 18:02:54 +02:00
Christophe Simonis db23690db3 [FIX] website: json are not multilang by default.
This avoid useless redirection.
2015-04-08 18:31:43 +02:00
Jeremy Kersten a696913364 [FIX] website: ir_http - no redirect for bot and save lang in cookie
Detect most of bots/crawlers to avoid auto redirect. Most bots fetch
with lang en_US, so even if default website lang was not in en_US,
googlebot was redirected to en_US page.

Now we keep also the language selected by user into a cookie.
If cookie exists but lang not in url, we redirect the user into
his preferred language.

Manage special case to allow to change the lang in url to set the
default lang at fly in url and set the cookie...

Many routes are not specified as multilang=False but should be.
With the auto redirection, we need to update these routes to avoid
useless redirects !
2015-04-08 15:39:57 +02:00
Jeremy Kersten 4aa2e52b3d [FIX] website: allow to rename a website page.
Code from delete_page has been spliited (functions, templates, ...)
to be re-usable by rename_page

Change default input type from website.prompt.
Old default value 'text' had no sense, there are no tag <text>.
2015-04-08 13:40:11 +02:00
Raphael Collet 58d6bb30ab [FIX] ormcache: fix calls to ormcache with unexpected context parameter
The implementation of ormcache does not work on methods that take a context
parameter. Because of the decorator decorator, the arguments of the call are
passed positionally to the method ormcache.lookup, and positional arguments
are used in the cache key.

The fix consists in removing the context parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
2015-03-26 18:44:51 +01:00
Christophe Simonis 313acf87a2 [MERGE] forward port of branch 8.0 up to d780014 2015-03-26 18:44:22 +01:00
FalcoBolger 95b921d0f7 [FIX] website: move support for ir.attachment resources to web module
Commit 540b753bf8 introduced
support for resources stored as ir.attachment records in
asset bundles too.
This is specifically useful for customizations.

However the HTTP route for reaching those resources
when they are *not* in a bundle was originally created
in the `website` module (as a special handling for
404 requests)

This means that these dynamic resources would only
be partially supported when `website` is not installed,
causing various problems:
 - missing resources in debug mode where bundles are skipped
 - errors when trying to define new client-side Qweb templates
   via XML resources - which are loaded with a direct request
 - ...

This commit moves back the supporting code to the web module.

The `mimetype` column is not present in ir.attachment without
the `website` module, but sniffing it based on the attachment
name works fine at serving time too.

Closes #6002
2015-03-26 17:33:19 +01:00
Raphael Collet 0beb14f0d2 [FIX] ormcache: fix calls to ormcache with unexpected context parameter
The implementation of `ormcache` does not work on methods that take a `context`
parameter.  Because of the decorator `decorator`, the arguments of the call are
passed positionally to the method `ormcache.lookup`, and positional arguments
are used in the cache key.

The fix consists in removing the `context` parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
2015-03-26 16:42:10 +01:00
Thibault Delavallée 4b649af00d [FIX] website: settings: avoid crashing when no website_id
given in the onchange.
2015-03-02 16:35:31 +01:00