Commit Graph

77 Commits

Author SHA1 Message Date
Fabien Pinckaers 642fce4a5b [IMP] speed improvement + small bug
bzr revid: fp@tinyerp.com-20131203171033-oe6pkzb9jal3ril8
2013-12-03 18:10:33 +01:00
Xavier Morel 87b5c7990a [FIX] unused check_groups call, preprocess_request style
bzr revid: xmo@openerp.com-20131203080055-wgja1zraygglo767
2013-12-03 09:00:55 +01:00
Xavier Morel 278316ef9f [FIX] broken call to (ir.model.access).check
bzr revid: xmo@openerp.com-20131203075715-xsmueut0n3g9ggd6
2013-12-03 08:57:15 +01:00
Xavier Morel 0271062a80 [FIX] clear cache on method with a cache
bzr revid: xmo@openerp.com-20131203073429-g8vqg1dqltgtc4r6
2013-12-03 08:34:29 +01:00
Fabien Meghazi b78f196362 [IMP] cached website's default_lang and language_ids
bzr revid: fme@openerp.com-20131202172110-h7s023xv4ohq31tw
2013-12-02 18:21:10 +01:00
Fabien Meghazi a5ed3f8b42 [ADD] slug() helper to rendering context
bzr revid: fme@openerp.com-20131202125652-5e30xd3ym6nww44o
2013-12-02 13:56:52 +01:00
Fabien Pinckaers b51daf482b [IMP] 2SQL Queries less per query
bzr revid: fp@tinyerp.com-20131202122233-m9y37fr6nhh03a08
2013-12-02 13:22:33 +01:00
Xavier Morel a108af5cb8 [FIX] website: endpoint_is_enumerable
old version of @website.route would wrap the base method within a
decorator, and endpoint_is_enumerable had to dig into the decorator to
get the original function (and be able to inspect it).

@website.route has been simplified and no longer wraps the function,
just adds a pair of attributes to it (and so does the base
@http.route), so don't dig into anymore, inspect rule.endpoint
directly.

bzr revid: xmo@openerp.com-20131202102525-8jsondrr1649c8t8
2013-12-02 11:25:25 +01:00
Fabien Pinckaers 660b420696 [FIX] public user
bzr revid: fp@tinyerp.com-20131202090239-a4b1kkg5pni8ye3d
2013-12-02 10:02:39 +01:00
Fabien Pinckaers d4fc95f1fe [FIX] small fixes
bzr revid: fp@tinyerp.com-20131130205834-ilds41gcktv7vchg
2013-11-30 21:58:34 +01:00
Fabien Pinckaers cf3ecb9ff0 [IMP] Huge speed improvements 64 SQL queries to render '/' --> 10 Queries
bzr revid: fp@tinyerp.com-20131130193739-095yd4p9llmj0kt1
2013-11-30 20:37:39 +01:00
Fabien Pinckaers ed7623fc45 [IMP] Performance improvement: improved cache with context, better get_object
bzr revid: fp@tinyerp.com-20131130154659-uqis34x2cemmocly
2013-11-30 16:46:59 +01:00
Fabien Meghazi 07eaace3ee [ADD] custom website ir.http#dispatch and rerouting
bzr revid: fme@openerp.com-20131127170432-z7d1w4ck03d7wwia
2013-11-27 18:04:32 +01:00
Xavier Morel 44af6d1e09 [IMP] significantly improve handling of trying to create a new page which already exists
# Through the menu

Rather than output a generic error (500 due to an IntegrityError),
return a templated 409 letting the user either visit the
page-which-already-exists-with-the-name-he'd-picked or open the page
creation dialog again for a second round.

An alternative would be to promote the website.prompt use to
full-blown dialog as a result of selecting "New Page" and handle the
"page already exists" case without even closing the dialog.

# Through the link dialog

Added an RPC call to check if a page already exists (essentially a
cheaper version of opening /page/whatever and checking whether it's a
200 over JSON-RPC), if the page matching the completion term already
exists, do *not* add the choice of creating the page, only provide
completions from existing pages.

bzr revid: xmo@openerp.com-20131126160148-wrk4zvz9istscwa0
2013-11-26 17:01:48 +01:00
Xavier Morel 6fc69e33d4 [FIX] correctly rollback savepoint in new_page
bzr revid: xmo@openerp.com-20131126102321-35wmxcncl3pp4mhw
2013-11-26 11:23:21 +01:00
Fabien Meghazi cc424c1a55 [IMP] http errors refactoring
bzr revid: fme@openerp.com-20131125165958-0k84rp9rbsxvav77
2013-11-25 17:59:58 +01:00
Xavier Morel 3542a27f9c [FIX] force url enumeration/generation to be performed as 'public' user
bzr revid: xmo@openerp.com-20131125100813-fln1j714m2h85h09
2013-11-25 11:08:13 +01:00
Fabien Pinckaers d19b85f873 [IMP] new featuers for complex events
bzr revid: fp@tinyerp.com-20131124223802-20rpekho195fu2l5
2013-11-24 23:38:02 +01:00
Fabien Pinckaers 5ee03592cf [FIX] misc fixes in new event devs
bzr revid: fp@tinyerp.com-20131124214257-pg9bsbzzydoz6z1a
2013-11-24 22:42:57 +01:00
Fabien Pinckaers 105fc16c11 [IMP] events improvements
bzr revid: fp@tinyerp.com-20131124210221-hwalp7983olmrhew
2013-11-24 22:02:21 +01:00
Fabien Meghazi a337d0dc2c [FIX] kanban broken by lazyrenderer
bzr revid: fme@openerp.com-20131121154213-71hb70c9326gtafb
2013-11-21 16:42:13 +01:00
Fabien Meghazi 7d43b226ab [IMP] Use LazyResponse for website.render()
bzr revid: fme@openerp.com-20131120202842-zethge8jykzlzjjy
2013-11-20 21:28:42 +01:00
Xavier Morel a1463c60b3 [CHG] **kw don't prevent url searching/listing anymore
After discussion and addition of support for the methods parameter (on
@route), it's been determined that:

* POST endpoint must set up method correctly

* **kw on GET endpoints must be completely optional, mandatory query
    arguments should be added as formal parameters without a default
    values

* URLs can thus be generated for methods with **kw, simply by ignoring
  it entirely

bzr revid: xmo@openerp.com-20131119154254-vp0zfnzjvi451vv0
2013-11-19 16:42:54 +01:00
Fabien Meghazi 8e68c33a4b [MOV] Moved methods filtering support from @website.route to @http.route
bzr revid: fme@openerp.com-20131119135428-fm3bfbp83anoxgo6
2013-11-19 14:54:28 +01:00
Xavier Morel 86a0f67a69 [ADD] note about leftover task
bzr revid: xmo@openerp.com-20131119122906-9meh7ubye952o67j
2013-11-19 13:29:06 +01:00
Christophe Matthieu 910c2657a9 [IMP] website: add a group_website_publisher to Display Editor Bar on Website and other editable option
bzr revid: chm@openerp.com-20131119103042-stdyd6r00e1zgli5
2013-11-19 11:30:42 +01:00
Xavier Morel 5723b1588e [MERGE] from trunk
bzr revid: xmo@openerp.com-20131119102552-f8d03meddylwseyr
2013-11-19 11:25:52 +01:00
Xavier Morel 986b4c49d1 [IMP] url generation & filtering
* add filtering in enumerate_pages directly
* make ModelConverter use name_search for generation

todo: per-request name_get caching/coalescing?

bzr revid: xmo@openerp.com-20131119102117-p7de3t93qex1n28q
2013-11-19 11:21:17 +01:00
Xavier Morel 5bab419967 [IMP] add page converter to get pages listing out of enumeration/search itself, restrict to single converter
bzr revid: xmo@openerp.com-20131115154840-psfns4datw5l1lr4
2013-11-15 16:48:40 +01:00
Christophe Matthieu b958ece1df [IMP] website_sale: access rights
bzr revid: chm@openerp.com-20131115152716-86wb7yxq2s4hr633
2013-11-15 16:27:16 +01:00
Xavier Morel 780c35598d [MERGE] from trunk
bzr revid: xmo@openerp.com-20131115132903-epi3321e4uxjqtn2
2013-11-15 14:29:03 +01:00
Christophe Matthieu cc574fa2c4 [IMP] website: catch exception of controller error to return a 401 or 500 error page (and log this exception).
bzr revid: chm@openerp.com-20131114144652-7ta05hrssx22cuiv
2013-11-14 15:46:52 +01:00
Christophe Matthieu 8ae07d4cba [FIX] website: helper google_map for res.company
bzr revid: chm@openerp.com-20131114090223-2gl6y7shh6f7fplm
2013-11-14 10:02:23 +01:00
Xavier Morel d15a6f426d [IMP] replace selection list of existing CMS pages by FAYT via select2
bzr revid: xmo@openerp.com-20131113143934-je7dusgzj15f7li0
2013-11-13 15:39:34 +01:00
Xavier Morel 122ddb8e31 [IMP] rename list_pages to enumerate_pages, add a search method and a basic non-contiguous substring match
bzr revid: xmo@openerp.com-20131113101824-uqatvqokkzhvi0ei
2013-11-13 11:18:24 +01:00
Fabien Meghazi 9ca2b8e8e0 [ADD] methods arg to @website.route() until the feature hit the server
bzr revid: fme@openerp.com-20131113101319-tvamyl0ikqmsqh18
2013-11-13 11:13:19 +01:00
Xavier Morel b1b29acd4b [ADD] pages to pages listing
I don't see a good way to reverse `/page/<path:path>` for Website.page
during pages listing, so reintoduce explicit handling of that crap.

Ideally it would be possible to plug in new converters per db and
create some sort of PageConverte, *or* add a reverse operation to
controllers on top of converters (-> controller-specific url
generation even with un-generable converters).

bzr revid: xmo@openerp.com-20131112120814-ekt1rzlzj06pzypw
2013-11-12 13:08:14 +01:00
Fabien Meghazi 91ac20c28c [FIX] Remove lang_code from kwargs
bzr revid: fme@openerp.com-20131112112150-ka9ner1bkqx6ioeg
2013-11-12 12:21:50 +01:00
Xavier Morel 5b0e0a343b [IMP] use pair unpacking rather than indexing + comment
bzr revid: xmo@openerp.com-20131112101559-s280ffmmc06vq23a
2013-11-12 11:15:59 +01:00
Xavier Morel 92b0539d1d [IMP] remove unused local variable in list_pages
bzr revid: xmo@openerp.com-20131112100411-r4va4xpcovnawuzr
2013-11-12 11:04:11 +01:00
Xavier Morel 8c786b7aab [IMP] move slugify to server, use slugified url as page name
bzr revid: xmo@openerp.com-20131108154842-ts1nnd40jusa92h6
2013-11-08 16:48:42 +01:00
Xavier Morel 01a414fb7c [ADD] initial route introspection + fix pair of routes/controllers
* most controllers turn out to be complete cork and thus can't be
  reversed

* fixup a pair of simple controllers

TODO:
* fixup more controllers
* how can labels/page names be produced?
* grouping/categories of links?

At a high level, workings are pretty simple:
* iterate on all rules (every url pattern produces a werkzeug rule)
* check if the url can make sense as a link: GET, http, no auth or
  public auth, coming from the CMS (no web client links) and all
  converters can generate values for themselves (e.g. a url with an
  `int` converter can't be generated as there is no finite set of
  integers, let alone one small enough to make sense to show to users)
* check if the controller function bound to the URL can use the URLs
  we can generate (no **kwargs as that means arbitrary get|post
  parameter, no query param without a default value (a query param is
  a parameter which does not come from a URL/rule converter))
* use rule converter(s) to generate a matrix of values, and build urls
  from these

bzr revid: xmo@openerp.com-20131108132615-2n7t1vj8hz9v9eis
2013-11-08 14:26:15 +01:00
Fabien Meghazi 01a28b6e03 [FIX] Can't translate menus
context was not passed while setting request.website
forced to refactor a bit in order to make true model methods but stopped
because it will be duplicated work when migrating to the new api

bzr revid: fme@openerp.com-20131107151400-9dmtgz7xs34qmbmq
2013-11-07 16:14:00 +01:00
Fabien Meghazi 1aaf0eaa4c [FIX] Multiple fixes to url_for
url_for now accepts a path or an uri
correctly handling shemeless uri's
url params are shadowed by keep_query

bzr revid: fme@openerp.com-20131106151752-sdov6zynz2g80uro
2013-11-06 16:17:52 +01:00
Fabien Meghazi 6ba57343da [WIP] Trying to use t-fields for menus
Not working quite well
Working it out

bzr revid: fme@openerp.com-20131105151651-8jn1po2fhyojum2c
2013-11-05 16:16:51 +01:00
Christophe Matthieu 49384720c0 [FIX] website contact us: add google_map_img on res.company insead of use partner_id field
bzr revid: chm@openerp.com-20131104165954-o77oi2miksvvt81r
2013-11-04 17:59:54 +01:00
Fabien Meghazi 5f2dc489b2 [MERGE] upstream
bzr revid: fme@openerp.com-20131104114431-dhjp6iy1sfxq4cg1
2013-11-04 12:44:31 +01:00
Xavier Morel 49381094a8 [IMP] error handling in website.render
Return responses with the correct status code instead of always
returning 200 on rendering errors from website.

bzr revid: xmo@openerp.com-20131104111021-inrsbawnakhsva1q
2013-11-04 12:10:21 +01:00
Antony Lesuisse c0dc6c81dc [FIX] qweb exception hiding
bzr revid: al@openerp.com-20131102171656-j4lqrx1gfosi8ofd
2013-11-02 18:16:56 +01:00
Fabien Meghazi 90814d781a [MERGE] upstream
bzr revid: fme@openerp.com-20131030144813-xmjb6i9ayv23aqyi
2013-10-30 15:48:13 +01:00