Commit Graph
475 Commits
Author SHA1 Message Date
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 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
Olivier Dony 0c483d3f43 [FIX] typos in last forward-port 2015-02-24 15:50:13 +01:00
Olivier Dony 95a2f8b121 [MERGE] Forward-port latest bugfixes from 8.0 up to cbb51610ee 2015-02-24 14:47:19 +01:00
Goffin Simon cbb51610ee [FIX] ir.ui.view: qweb translations: allow looking up translation in parent template
- Translations lookup normally uses the namespace of the current
QWeb template, after merging all inherited views.
But when a QWeb template is "cloned" by a child view using
inheritance with `primary` mode, the translations are more
likely to exist for the original (parent) template, and would not
be found when using only the "child" namespace.
This patch adds support for looking up each translation
also in the parent namespace in this case, if none was found
for the child template in the first place.

- ir.translation's _get_source() now supports a list of res_id
to search for, in addition to a single res_id

- Also moved the logic of routes /website/customize_template_get
and /website/get_view_translations to the ir.ui.view model where
it belongs.

opw: 615241

Closes #5325
2015-02-24 14:01:34 +01:00
Christophe Simonis 5446d4ef6c [IMP] website: better error when view not found 2015-02-20 12:07:33 +01:00
Jeremy Kersten 0c7c50b938 [FIX] website: allow to edit a page created by cms.
Without this fix, you cannot use html_editor to edit page create
with the front end.

Since we don't store the new page in field `xml_id´ but in field `key´,
we need to search also into this field.
2015-02-16 10:01:01 +01:00
Jeremy Kersten 165c67e879 [FIX] website: improve delete page
Clear cache after delete view
    Move menu to keep all 'New page', 'New blog', 'New forum', ... together
    Disable continue button from popup while user don't confirm with checkbox
    English typo
2015-02-12 18:19:19 +01:00
Jérome Maes ba827fc6ee [FIX] website_qweb : extract the preparation of qcontext for website. Create a prepare_qcontext method to add variables required to render template extending website.layout (like im_livechat channel, or salorder of ecommerce) 2015-02-12 14:29:07 +01:00
Christophe Matthieu e8526dd013 [IMP] website: menu editor open a modal to select the menu to edit if more of one menu in the page (like event) 2015-02-11 12:31:52 +01:00
Jeremy Kersten 905dd42b87 [IMP] website: allow to delete page - fix 440 - forum Q47292 2015-01-29 11:03:31 +01:00
David Monjoie b84721cb21 [IMP][REF] website: introducing a mixin class to handle website_published
and website_url fields. This will allow to remove custom code in every website
addons that redefine those two fields and the URL getter method.
The published button in backend has also been cleaned. It is now a link button
that redirects to the website_url. It does not change the publish status
anymore. Indeed it makes sense publish and unpublish website documents
directly in the website, while checking that everything is correct, instead
of doing it in the backend.

Next commits will update the Odoo addons to use this mixin and the new button
in the form view.
2015-01-20 17:34:33 +01:00
Christophe Simonis 18e22be138 [MERGE] forward port of branch 8.0 up to 0aab81c 2015-01-19 17:15:56 +01:00
Goffin Simon 9850080eb0 [ADD] Versioning Module.
This module allow to make versioning and A/B testing of the website.
2015-01-16 23:13:58 +01:00
Christophe Matthieu e42995b614 [FIX] website_sale: Unable to customize image from grid of products. Add an option for the image qweb widget to resize and the views can add python data in widget options 2015-01-16 16:38:09 +01:00
Christophe Matthieu 7c10c9ac27 [FIX] website qweb: wrong encoding when a snippet is called by t-snippet 2015-01-16 16:38:09 +01:00
Jeremy Kersten 9d89b179c4 [FIX] website: search a matching route with http method POST
When url_for was looking for a route which match, it was only looking for GET route.
So routes which were restricted to be used only with a POST method, were never found.

The result was that urls in website for route post (form in most cases) was never prefixed with the lang.
So the request.lang was always the default lang from website...

If you was creating a sale order (in ecommerce), the lang used in sale order was wrong and the description not in the current lang.
2015-01-15 23:16:33 +01:00