Commit Graph
647 Commits
Author SHA1 Message Date
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Laurent Mignon 273a15ea7d [FIX] website: port of rev a98d60c
The forward-port of the above revision missed
the conversion to the new api

Closes #15064
2017-01-13 14:03:52 +01:00
Denis Ledoux b228f548ca [FIX] website: port of rev a98d60cb11
The forward-port of the above revision missed
the conversion to the new api and that
`context` had to be replaced by `self.env.context`

Fixes #14922
Closes #14923
2017-01-11 11:03:49 +01: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
Christophe Simonis b3a1109372 [MERGE] forward port branch 10.0 up to c08a590bb1 2017-01-02 15:31:58 +01:00
Christophe Simonis 81f59cee2c [MERGE] forward port branch saas-11 up to b844d93889 2017-01-02 14:38:59 +01:00
Christophe Simonis b844d93889 [MERGE] forward port branch 9.0 up to 3805eb620a 2017-01-02 12:49:55 +01:00
Jeremy Kersten d4b2e16fd6 [FIX] website: compress_html is obsolete
This option is no more implemented since the refactoring of ir.qweb
Gzip (in nginx) do the same and better...
2016-12-28 12:56:06 +01:00
kujiu (@angua.kujiu.org) 65a7531c8b [IMP] website*: Improve the settings form view 2016-12-27 17:09:33 +01:00
Denis Ledoux a98d60cb11 [FIX] website: search pages in the menu creation dialog
The revision
8f48baeda6

broke the ability to search pages in the dialog
allowing to add a menu to the website from the website
(From the website, Content > Edit menu)
as `request.website` was not defined in this case

opw-702020
2016-12-21 14:59:29 +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
Christophe Simonis 0b846861b6 [MERGE] forward port branch 10.0 up to 5dc1c57 2016-12-01 17:05:08 +01:00
Christophe Simonis 5dc1c57601 [MERGE] forward port branch saas-11 up to 7842498 2016-12-01 16:59:33 +01:00
Christophe Simonis 7842498934 [MERGE] forward port branch 9.0 up to 5bed95f 2016-12-01 15:33:21 +01:00
Christophe Simonis 5bed95fbd5 [MERGE] forward port branch saas-6 up to 97af232 2016-12-01 14:47:17 +01:00
Christophe Simonis 97af2325cd [MERGE] forward port branch 8.0 up to 0105cbb 2016-12-01 14:39:25 +01:00
Denis Ledoux 0105cbbcf9 [FIX] website: make website default language required
The website `default_lang_id` was not required,
while the algorithm choosing the website language
expects it to be required.

This solves the below issue, when your browser language is en_US:
 - add a second language to the website (e.g. fr_BE or es_VE),
 - in the website settings, remove English from the languages
 - in the website settings, unset the default language
 - try to go on the website

You will have a crash:
```
  File "/home/odoo/src/odoo/saas-11/addons/website/models/ir_http.py", line 193, in _dispatch
    resp.set_cookie('website_lang', request.lang)
  File "/usr/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 992, in set_cookie
    self.charset))
  File "/usr/lib/python2.7/dist-packages/werkzeug/http.py", line 905, in dump_cookie
    value = to_bytes(value, charset)
  File "/usr/lib/python2.7/dist-packages/werkzeug/_compat.py", line 106, in to_bytes
    raise TypeError('Expected bytes')
TypeError: Expected bytes
```

This is because the `request.lang` is set to `False`
because of the below algorithm in `ir_http.py`:
```
    nearest_lang = not func and self.get_nearest_lang(path[1])
    url_lang = nearest_lang and path[1]
    preferred_lang = ((cook_lang if cook_lang in langs else False)
                      or self.get_nearest_lang(request.lang)
                      or request.website.default_lang_code)

    is_a_bot = self.is_a_bot()

    request.lang = request.context['lang'] = nearest_lang or preferred_lang
```
`nearest_lang` is `False`, because there is no nearest language
available for the browser lang (`en_US`)
`cook_lang` is `False` for users who never went on the website
`request.website.default_lang_code`, which is the last feedback,
is also `False` because you removed the default language
in the website settings.

opw-695621
2016-12-01 11:37:03 +01:00
Christophe Simonis e348330b57 [MERGE] forward port branch 10.0 up to 6a18e31 2016-11-22 17:59:41 +01:00
Christophe Simonis 6a18e31cee [MERGE] forward port branch saas-12 up to c56cf85 2016-11-22 17:54:22 +01:00
Christophe Simonis c56cf85a3a [MERGE] forward port branch saas-11 up to 2633bb4 2016-11-22 17:50:41 +01:00
Christophe Simonis 2633bb4853 [MERGE] forward port branch 9.0 up to c7b1712 2016-11-22 17:35:59 +01:00
Christophe Simonis c7b1712592 [MERGE] forward port branch saas-6 up to 9780551 2016-11-22 17:33:38 +01:00
Christophe Simonis 9780551bb7 [MERGE] forward port branch 8.0 up to fbdac9c 2016-11-22 17:23:24 +01:00
Jairo Llopis fbdac9c853 [FIX] website: fix search in existing pages
Previous implementation did not allow the user to search for pages 'name'
but only on the slugified name.

Now we slugify the needles before to find a match.

1. Create a new page: 'The new'
2. add a link on your website and try to find this page...
    - Before this commit, the only ways was to type 'the-new'
    - After this commit 'the new', 'The new', 'The-new', ... will match

This commit closes #10771
2016-11-22 13:47:17 +01:00
Jeremy Kersten 8ea3464231 [IMP] mail, website: remove deprecated code 2016-11-21 13:46:18 +01:00
Jeremy Kersten 962ff5b4bf [FIX] website: compress_html is obsolete
Partial revert of #2013dc38

Schema is not updated, but it can break if views are not updated.
2016-11-18 15:50:28 +01:00
Jeremy Kersten 2013dc387d [FIX] website: compress_html is obsolete
This option is no more implemented since the refactoring of ir.qweb
Gzip (in nginx) do the same and better...
2016-11-18 10:03:49 +01:00
Christophe Simonis ab98523315 [MERGE] forward port branch saas-12 up to 0ca99ff 2016-11-02 17:56:37 +01:00
Christophe Simonis 0ca99ffc1f [MERGE] forward port branch saas-11 up to 0304bf8 2016-11-02 17:53:45 +01:00
Christophe Simonis 0304bf8c59 [MERGE] forward port branch 9.0 up to 92c81dc 2016-11-02 17:40:34 +01:00
Nicolas Lempereur d05136a0b2 [IMP] website: use default language for some bots
Currently when using a language on the website, the following is done in
this order to choose which one will be used:

1) use a language code if present in the url (eg. /fr_BE/),
2) use a language similar to the one in the url,
3) use a previously choosed language (saved in cookie),
4) use the browser language if available on website,
5) use a language similar to the browser language,
6) use the default website language

When a bot is requesting a page, he could either not specify a browser
language (en_US is set as default) or sometimes specify english
erroneously.

In these instance, we will then never use the default website language
if an english language is installed.

This fix changes this behaviour so if a bot is visiting a page, the 4th
and 5th steps are skipped and the default website language is used
instead of using the browser language.

closes #14033
opw-690910
2016-10-31 13:43:01 +01: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
Frédéric Gilson ad8af74477 [FIX] website,account,website_sale: Enhance and clean website and ecommerce planners
Lots of typos, wrong links, outdated content.
2016-10-03 16:59:38 +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
Jérome Maes bd7543f4f7 [FIX] website: migration typo and default method for website.menu 2016-09-27 17:05:34 +02:00
Christophe Simonis 37ea415c99 [FIX] website: remove duplicated field 2016-09-27 13:21:41 +02:00
Christophe Simonis 55d2e4b7cf [MERGE] forward port branch saas-11 up to bde7f88 2016-09-02 17:23:34 +02:00
Christophe Simonis 54e5bbdf35 [MERGE] forward port branch saas-10 up to 897b9b8 2016-09-02 16:28:28 +02:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Christophe Simonis 897b9b8fc0 [MERGE] forward port branch 9.0 up to cb1ae53 2016-09-02 15:19:39 +02:00
Raphael Collet 70dec2d896 [REF] registry: now mapping model name to model class 2016-08-31 17:21:59 +02:00
Raphael Collet 75dc39e042 [REF] openerp.http: make request.context consistent with request.env.context 2016-08-31 17:21:58 +02:00
Denis Vermylen (dve) f90290d1c2 [IMP] website,w_sale: Website Admin settings view
- Add optional products and pricelists to ecommerce section
- add mail template sent when confirming a sale order
- rename and clarify using radio widgets
2016-08-31 17:17:37 +02:00
Christophe Matthieu 50890347c1 [IMP] website: increase in performance using the cache
Avoid the excessive use of with_context method
2016-08-29 15:32:44 +02:00
Nicolas Martinelli 2fda62ebd8 [FIX] website, website_{*}: Google Maps API Key
Partial backport of c82b65c855

opw-686510
2016-08-29 08:48:09 +02:00
Nicolas Martinelli 61f2c90d50 [FIX] website: Google Maps API Key
Move the key field to the website config
2016-08-29 08:32:12 +02:00
Nicolas Martinelli c82b65c855 [IMP] website, website_{*}: Google Maps API Key
As of June 22 2016, the use of API key is required to access the
following:
- Google Maps JavaScript API
- Google Static Maps API
- Google Street View Image API

https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update

For domains accessing the API before June 22, it will still work without
an API key. Since Google advises to use the API key, we hide the Maps if
no API key is defined.
2016-08-25 16:33:23 +02:00