Commit Graph

204 Commits

Author SHA1 Message Date
Christophe Simonis c6f91facbb [FIX] website: do not restore page views 2014-07-30 15:10:22 +02:00
Olivier Dony a7aa853737 [FIX] website: exception handling: let redirects pass untouched
The website module normally tries to render user-friendly
error pages for any error occurring during the processing
of a website-enabled request.
This happens even for werkzeug's HTTPExceptions that have
their own response, because we want the website layout to
be applied on top of the error page.

One special sort of HTTPException should be preserved
without rewriting: the manually-crafted ones generated
with abort(), and usually wrapping a redirect response,
which bears no alteration.
2014-06-27 13:04:31 +02:00
Fabien Meghazi f988d75035 [FIX] check after openerp's AccessErrors in website's _handle_exception 2014-06-25 12:20:40 +02:00
Fabien Meghazi 4e0799e163 [FIX] _handle_exception() logic amongst requests and ir_http objects
Changes in website's ir_http#_handle_exception():

- exception is mandatory, can't be None anymore
- we don't touch non website_enabled requests
- we don't touch explicits plain responses from parent
- logic flow is now easier to read (I hope so)

Change in website's ir_http#_dispatch():

- In case of real 404, instead of returning self._handle_exception(),
  just let parent do the job (so we call super())
2014-06-25 11:47:44 +02:00
Denis Ledoux 51c7b55da0 [FIX] request.handle_exception: cleanup override logic, fixed chain broken by commit a096ae0
handle_exception() is supposed to try handling an exception and if it cannot,
re-raise it. Overridden methods must therefore call super() within a try/except
block, and only attempt to handle the exception if super() raised.
2014-05-23 13:15:52 +02:00
Martin Trigaux a096ae0080 [FIX] http: force rolleback for failed http request
1st issue:
When an exception was raised, it was badly handled by the website in case of
website_enabled key. The response page was generated without calling super.
The WebRequest object being responsible to rollback the transaction in case
of errors.

2sd issue:
The _failed attribute is required to rollback the transaction in an WebRequest
object. Previously it was only set in the JsonRequest object (which inherit
from WebRequest), replace by call to super. The attribute _failed is now set
in the WebRequest object.
2014-05-21 19:12:37 +02:00
Olivier Dony f120d6ffb7 [FIX] ir.qweb: avoid errors with function fields of type datetime
bzr revid: odo@openerp.com-20140401160623-loj5nsph7tfnn1us
2014-04-01 18:06:23 +02:00
Fabien Meghazi 8435da41bc [MERGE] upstream
bzr revid: fme@openerp.com-20140325103928-ja3bqy6xmyp91gva
2014-03-25 11:39:28 +01:00
Fabien Meghazi 27f38edb25 [FIX] dirty saas-3 fix for url lang switching with model converters
bzr revid: fme@openerp.com-20140325100722-temaci88fowcr2m5
2014-03-25 11:07:22 +01:00
Xavier Morel a56dc53bea [REM] 4-spaces indent for web view pretty-print-before-save routine
Didn't quite work right: on the layout, it would exponentially increase
leading spaces in text nodes. Combined with a bug injecting snippets marks in
the footer (and thus invalidating and re-saving the layout at each snippet
addition) this could blow up the layout template and rendered page to >20MB.

Just keep lxml's standard 2-spaces indent.

LXML is unable to pretty print the layout anyway.

bzr revid: xmo@openerp.com-20140321075419-9w88h232r928xv5f
2014-03-21 08:54:19 +01:00
Xavier Morel a0feb7c3c9 [REV] backout xmo@openerp.com-20140303153855-5f2l8v0jq2mgb26f, schemas should not be altered in saas-3
bzr revid: xmo@openerp.com-20140304132101-qysq310wp1oo859n
2014-03-04 14:21:01 +01:00
Xavier Morel e78a3b18cc [ADD] tentative removal of attachments
Attachments ought be removed only if they are not used in an existing page/web
view.

Theoretically this could be set directly in unlink(), but:
* that would make a nice error message significantly harder
* the expenses of performing a text search in all view archs would be a bit expensive

Notes:
* the views set could be reduced to only "web" views
* the search is likely sensible to false negatives e.g. different order of
  query parameters. It *will* remove images still being used.

bzr revid: xmo@openerp.com-20140304110716-u14w6uo8fbkfa42i
2014-03-04 12:07:16 +01:00
Xavier Morel a99a15c960 [ADD] deduplication of website images being uploaded
There is a deduplication in ir.attachment, but it's only for FS-stored content
*and* it only deduplicates storage not models (as there are access rights
issues involved).

The goal here is to always return the same attachment when a user uploads the
exact same image multiple times (because it's simpler or whatever).

Initially tried to use a binary field & digest(), but search() blows up
because it tries to utf-8 encode raw binary data. So use char & hexdigest
instead.

_compute_checksum returns None if the provided attachment data does not look
like a website image attachment.

Unhandled: multiple existing matches, maybe a UNIQUE constraint on the
checksum field would be a good idea just in case.

bzr revid: xmo@openerp.com-20140303153855-5f2l8v0jq2mgb26f
2014-03-03 16:38:55 +01:00
Denis Ledoux 70d3570846 [FIX]website: do not send False value to google map api to retrieve the image. Otherwise, you are in the middle of the ocean.
bzr revid: dle@openerp.com-20140228170900-lagmopkmkb58exqr
2014-02-28 18:09:00 +01:00
Xavier Morel 6b857b6eeb [FIX] whitespace/indent lost by RTE
Didn't manage to find RTE settings to avoid losing leading whitespace of
lines, so reindeint arch after doing all integration, right before saving back
to view's field.

* html.fromstring(parser=HTMLParser(remove_blank_text=True) does not seem to
  work, so serialize to XML, and parse back with
  remove_blank_text. remove_blank_text necessary for lxml's pretty_print to
  work correctly.

* pretty_print only & always uses 2 spaces/indent level. Our files (and the
  HTML editor's Format button) uses 4 spaces -> need a second pass to double
  indents.

bzr revid: xmo@openerp.com-20140227125934-q8j3z440px2ic6kx
2014-02-27 13:59:34 +01:00
Denis Ledoux 50ecb598e7 [FIX] website: website settings should inherit of res.config.settings and not base.config.settings, as it create a new page settings, instead of extending one
bzr revid: dle@openerp.com-20140226171114-jwthykyud66l7o6x
2014-02-26 18:11:14 +01:00
Christophe Matthieu a09b0db51d [FIX] website: Select some text > Click on the link button > Select Page textfield and start typing (e.g. comm) > There is a lot of noise here; Dsiplaying create page for existing page
bzr revid: odo@openerp.com-20140219105502-jg8f2i1gpz5vdarf
2014-02-19 11:55:02 +01:00
Olivier Dony 632182589c [IMP] website: extra safe check for qcontext's flag
bzr revid: odo@openerp.com-20140217093311-wmv6sxtv9aizusvr
2014-02-17 10:33:11 +01:00
Christophe Matthieu 386b2fe70f [IMP] website: add page: change default sequence and layout
bzr revid: chm@openerp.com-20140214103744-dptrytkfbcwti6t8
2014-02-14 11:37:44 +01:00
Christophe Matthieu ed785f0783 [FIX] website_sale: pager and breadcrum keep search and filter. Filter keep search and category. Links for category
bzr revid: chm@openerp.com-20140212115516-3izdv7cszgh2n3l4
2014-02-12 12:55:16 +01:00
Fabien Meghazi 0da8cdda90 [FIX] Set default 'editable' key in website's rendering context
bzr revid: fme@openerp.com-20140210143546-1t82gog330n5x89t
2014-02-10 15:35:46 +01:00
Denis Ledoux 38b7c38e32 [FIX] website: config settings does write the values on the website model
This config contains only related fields of the website_id many2one.
The problem is that applying the change CREATE a res config settings
And the create orm method does not forward and write the values on the related fields.
Write does.
The best fix should be to change all these related fields to char fields, 
and to create the set_ method who will acutally set the value to the website_id.
But, unfortunately, this is a stable branch
And we cannot alter the database structure in stable branches.

bzr revid: dle@openerp.com-20140207172157-6upyhuin93qlkrfa
2014-02-07 18:21:57 +01:00
Xavier Morel 7ac7b2599e [IMP] make page lookup case-insensitive during completion
bzr revid: xmo@openerp.com-20140207150623-vevnuswi9gx0bqeb
2014-02-07 16:06:23 +01:00
Antony Lesuisse cd2bddad46 [FIX] website ir.ui.view render
bzr revid: al@openerp.com-20140207140503-doolcovzuce4m6i4
2014-02-07 15:05:03 +01:00
Christophe Simonis 1b0ce7052e [FIX] website: do not force uneditable templates
bzr revid: chs@openerp.com-20140207122837-ysfss4khpt2hsau1
2014-02-07 13:28:37 +01:00
Christophe Simonis daace48560 [MERGE] fix template rendering
bzr revid: chs@openerp.com-20140206163811-i43srg7hd4yqzzo3
2014-02-06 17:38:11 +01:00
Fabien Meghazi 2d4fb97696 [IMP] Move some qweb rendering context vars from website#ir.qweb to server#ir.ui.view
bzr revid: fme@openerp.com-20140206161316-jw7luqon476widcm
2014-02-06 17:13:16 +01:00
Thibault Delavallée 2f682975bc [FIX] website: fixed call to slugify
- python-slugify: max_length is an optional keyword
- slugify library also exists and does not accepts max_length -> if this very simple library is used, fall
            back on our own implementation

bzr revid: tde@openerp.com-20140206145638-entdcqsawrqf1nnq
2014-02-06 15:56:38 +01:00
Fabien Meghazi b112d5d2f1 [FIX] ir ui view should have rendering context on request.website_enabled
bzr revid: fme@openerp.com-20140206143919-f6vz8rpx9mb4798g
2014-02-06 15:39:19 +01:00
Denis Ledoux f487fbb298 [FIX] website: urljoin from urlparse cannot handle unicode. Therefore, We decode before passing the arg to urljoin then we (re-)encode the result
bzr revid: dle@openerp.com-20140206103929-oe289oilz08n1msk
2014-02-06 11:39:29 +01:00
Fabien Meghazi 5451f5587d [REV] Bring back QWebExceptions
bzr revid: fme@openerp.com-20140131113611-wee3xvnvzw9smq2r
2014-01-31 12:36:11 +01:00
Antony Lesuisse 974c666bcd [REV] website qweb dont change exception types
bzr revid: al@openerp.com-20140131011427-3bome249kut8fs3t
2014-01-31 02:14:27 +01:00
Antony Lesuisse 3124343f04 [IMP] product style model renames, add user_id on website to be used in multiwebsite
bzr revid: al@openerp.com-20140130225853-6fgpmtaa8v1vr25x
2014-01-30 23:58:53 +01:00
Fabien Meghazi 1931c307a2 [IMP] Improved qweb exeptions handling
bzr revid: fme@openerp.com-20140130212053-fkb9ug49qun54ehi
2014-01-30 22:20:53 +01:00
Fabien Meghazi fc979b9a7a [FIX] url_for()
bzr revid: fme@openerp.com-20140130195043-pkfkmqg80c2yk5p5
2014-01-30 20:50:43 +01:00
Fabien Pinckaers a1b95f6823 [FIX] Customize menu
bzr revid: fp@tinyerp.com-20140130194227-b5brj96f8tgc88hf
2014-01-30 20:42:27 +01:00
Olivier Dony 78fefd54f0 [IMP] website tests: unicode test attributes to avoid warnings in auto_init when comparing attr values
bzr revid: odo@openerp.com-20140130162615-nx7f3nhifwqo357u
2014-01-30 17:26:15 +01:00
jke-openerp 1176ef49c1 [FIX] Fix according ODO review : widget image, googlemap, social escape, ...
bzr revid: jke@openerp.com-20140130121244-tv840uvtorg0y3s1
2014-01-30 13:12:44 +01:00
Denis Ledoux 18532330d4 [FIX] *: replace urllib calls by werkzeug calls, as werkzeug handles utf-8 encoding while urllib doesnt
bzr revid: dle@openerp.com-20140130112408-8pdju26jnkyxvlw2
2014-01-30 12:24:08 +01:00
jke-openerp 516a85cecc [Fix] Use maps.google.com and not .be (as for thumbail who use the api .com).
[IMP] Add zoom 10 by default
[FIX] Escape False in address for google search

bzr revid: jke@openerp.com-20140130111349-l90w9larrntv83hh
2014-01-30 12:13:49 +01:00
Christophe Simonis 3d80e31012 [FIX] website: url_for() does not mess up anchor links
bzr revid: chs@openerp.com-20140129195025-i2ey682o6marp8k1
2014-01-29 20:50:25 +01:00
Fabien Meghazi eff61fde93 [FIX] Support for older werkzeug versions
bzr revid: fme@openerp.com-20140129135208-liewqaib50lwbbjy
2014-01-29 14:52:08 +01:00
Denis Ledoux 0306adbfe3 [FIX] *: using werkzeug.url_encode instead of urllib.urlencode because urliblib.encode does not accept unicode
bzr revid: dle@openerp.com-20140129121316-b5f5e4r6fz9l80kq
2014-01-29 13:13:16 +01:00
Antony Lesuisse 6f8d8434dc [FIX] website_hr_recruitment full cleanups
- keep url namespace under /jobs
- public mode fixes
- moved jobs_ids field in hr_recruitment
- simplify code, remove dead code and data

bzr revid: al@openerp.com-20140129051403-cipao0bllxa85gsg
2014-01-29 06:14:03 +01:00
Fabien Meghazi 326c35aecd [IMP] Merge bananas and cumcumbers in order to prepare the t-href|t-action removal
bzr revid: fme@openerp.com-20140128201417-1elmttz8qen9q3ws
2014-01-28 21:14:17 +01:00
Christophe Matthieu 316745250b [FIX] website: public user; website_sale
bzr revid: chm@openerp.com-20140128152136-pqh7oqj4drpjk09z
2014-01-28 16:21:36 +01:00
jke-openerp 20a5ab8ea4 [MERGE] moved public user to base, livechat fix
bzr revid: jke@openerp.com-20140128145023-hthi8f75gq8jo11u
2014-01-28 15:50:23 +01:00
jke-openerp 2c255db1d0 [REF] Move public_user from website_data to module server/addons/base
[REF] Remove _auth_method_public from website/ir_http to become a native auth_method in server/addons/base/ir/ir_http

bzr revid: jke@openerp.com-20140128142824-62ejlnnud4a4m694
2014-01-28 15:28:24 +01:00
Antony Lesuisse 7c90d3afa5 [FIX] website page creation
bzr revid: al@openerp.com-20140128140017-r8yy8tzsvo4y0e92
2014-01-28 15:00:17 +01:00
Christophe Matthieu d588e44d34 [IMP] event,event_sale: refactoring; remove crappy 9999 hardcoded values; remove visibility; add constraints
[FIX] remove module_portal_anonymous ref
[IMP] website: res_config with wizard
[IMP] event: remove related field to res.partner
[FIX] website_sale: change crappy _get_pricelist method (who return a browse record to a function field type many2one)

bzr revid: chm@openerp.com-20140128092037-zrrbz1hrmgat88o4
2014-01-28 10:20:37 +01:00