Commit Graph
150 Commits
Author SHA1 Message Date
Lucas Perais (lpe) cda2ac9b71 [FIX] event, event_sale, website_event: allow portal access to own registrations
OPW 1859364
2018-06-26 15:07:42 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
RomainLibert 84acd427b8 [FIX] website_event: allow controller to read event.registration
The controller /event/<model("event.event"):event>/registration/confirm
was broken since the portal user cannot read event.registration objects.

In 9.0 this was not an issue as we browsed and sudoed the
event.registration, but since in 10.0 this line disapeared so did the
sudo which this commit reintroduces.
2018-06-14 14:14:50 +02:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Christophe Simonis ab084d580f [MERGE] forward port branch saas-15 up to 98539336a5 2017-11-30 15:27:59 +01:00
Jeremy Kersten ee1d83dc3c [FIX] website_event: display normal 404 for non website editor.
Without this patch, the user will see a button 'create a new page' on the 404
for the controller /event/<event_id>/page/<page>
2017-11-29 16:38:04 +01:00
Christophe Simonis 99bf9e4563 [MERGE] forward port branch saas-16 up to 89df681b45 2017-09-28 13:24:14 +02:00
Christophe Simonis 89df681b45 [MERGE] forward port branch saas-15 up to da15615c45 2017-09-28 11:56:23 +02:00
Jeremy Kersten 1b52b00d2a [IMP] website*: clean sitemap + add method to declare sitemap function.
Don't add useless routes or route that will return 404.
Improve generate function from ModelConverter to have a better management of
query_string.

Now we have an helper sitemap_qs2dom that will analyse the current route and
check if query string is plausible and if yes, generate a domain, when the
query_string don't seems to match the route, we return a Falsy domain.

Before this commit, if qs was /product/ipad, enumerate_page check for each
modelconverter of the route a name ilike '/product/ipad'.

Now we check all routes that contains product and one converter that match ipad
or routes that contains ipad and one converter that match product.

This commit a new way to declare the sitemap for a route.
    def sitemap_xx(env, rule, query_string):
        yield {'loc': '/my_url'}
    @http.route(..., sitemap=sitemap_xx)

    In this case, only the loc returned by this function will be in the sitemap
    for all rules.

    You can pass sitempa=False, if you don't want that route are into the sitemap
2017-09-27 21:33:49 +02:00
Martin Trigaux 88edeeca6a [FIX] preventing context.get('lang')
The lang in the context can be None or False
To avoid similar error as revealed at ede29e6d, correctly retrieve the context
2017-09-26 16:58:59 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
qsm-odoo 2972976962 [REF] web_editor, website, *: complete refactoring
* mass_mailing, payment, point_of_sale, portal, survey, web, web_tour,
  website_blog, website_crm_partner_assign, website_event,
  website_event_questions, website_form, website_forum, website_gengo,
  website_hr_recruitment, website_links, website_mail,
  website_mail_channel, website_mass_mailing, website_quote,
  website_sale, website_sale_options, website_slides, website_twitter

This commit reviews the whole "JS side" of the web_editor and website
apps. This is a first step to be able to improve them with new and
better functionnalities; this commit is not supposed to change any
visual behavior.

The main goal was to achieve a structure similar to the backend one.
Now, the frontend side also has a root widget (like the WebClient)
and all other widgets are attached to it one way or another. This allows
the benefits of using the 'trigger_up' functionnality for example.

As RPC are now mainly done with the `this._rpc` functionnality (being
possible thanks to the parent hierarchy), the frontend will also be
possible to test thanks to QUnit in a future update (besides the "text"
editor side which still requires a refactoring to be able to do that).

---

Here are some of the changes:

(-) conventions and documentation

The code has been updated to follow JS conventions and a lot of code has
been commented (around +2000 lines of comment). This also means that
lots of functions have been renamed to use camelCase or simply to make
their name understandable.
See https://github.com/odoo/odoo/wiki/Javascript-coding-guidelines.

(-) deprecated: web_editor.base

The "web_editor.base" module has been split and does not force the
modules which require it to wait for DOM ready anymore. This was indeed
slowing loading times, but also prevented to use some modules in some
contexts (see the LESS editor use in web_studio which is the subject of
another task).
Now the "editor context" can be got thanks to the "web_editor.context"
JS module with its "get" function.
The "web_editor.base" module should probably not be used anymore (see
its code and recent updates).

(-) new: web.dom_ready

If a JS module should wait for the DOM to be ready to be executed, a
new JS module has been created: "web.dom_ready". This should always
be used in a module which only want to instantiate stuff. Do not
extend (or worst, include) classes after DOM ready.

(-) website.website

The "website.website" module has been split. "website.website" does not
return anything useful anymore, it just initialize some miscellaneous
stuff, without waiting for the DOM to be ready. You might want to check
"website.utils", "website.content.compatibility" or `WebsiteRoot`. Also
`website.form` has been deleted (use `this._rpc`), so has been
`website.error`. `website.prompt` will be removed in a future update to
be replaced by `Dialog.prompt`.

(-) widgets are great

Many classes which were not widgets are now widgets. This allows them to
use the 'events', the 'xmlDependencies' and the 'this._rpc' features for
example. Here are some of the main ones:

- Snippet options: these were classes with a `$el` for the menu element
    and `$target` for the customized element. This is still the case
    but following standard `Widget` structure (one exception: using
    `this.$(...)` searches in the `$target` as before this update).

- Snippet animations: instead of class instances with a `$target`
    element which can be `start` and `stop`, these are now standard
    widgets which can be `start` and `destroy`. `this.$target` is
    an alias to `this.$el` for ease of compatibility.

- Snippet editors: instead of class instances in charge of an editor
    overlay, these are now widgets. Each "child" snippet editor is
    properly attached as a "child", which allows editors to communicate
    and to be properly destroyed.

(-) root widgets and website navbar

The frontend is different of the backend. In the backend, the page has
an empty <body/> element and all the components are instantiated from
parent to children (i.e. the `WebClient` is instantiated and is in
charge of instantiating the `ControlPanel`, etc). The frontend cannot
work like that on page loadings as they are way more frequent than in
the backend and we do not want them to flicker. A frontend page is
loaded as a <body/> element which already contains the website navbar
and its menus and the whole content page. JS code has to be "attached"
to these existing elements. This is possible thanks to the `RootWidget`
instances and the specialized `WebsiteRoot`, `IframeRoot` and
`WebsiteNavbar` (see code for details).

(-) lazy loading

No more (or at least a lot less) XML/JS has to be loaded on page
loading, thanks to the use of the `Widget.xmlDependencies` feature.
XML which have to be lazy loaded is loaded only on related Widget
instantiation if necessary, which allows to execute a lot of JS code
before the DOM is ready and to start many widgets on DOM ready (not
later). A visual benefit of this is clicking on the 'edit' button as
soon as it is possible: before this commit, this was sometimes not
doing anything as event handlers were not binded yet.

Still a possible exception: loading the session and locales. This may
be asynchronous stuff which is still required before widget
instantiations but this will be the subject of another task.

(-) deprecated code and code location

More than reviewing code and organizing it, many apparent dead code was
removed. More importantly, mislocated code was put in the right app.
This is the case for snippet animations which is a concept for website
apps but was defined in the web_editor app, or some translation concepts
which were part of website but should have been part of web_editor.

---

There are probably more things to say about this commit but I will let
the comments speak for those.
2017-08-16 11:04:14 +02:00
Christophe Simonis 1fa8680286 [MERGE] forward port branch saas-17 up to 48b2ce60ed 2017-08-10 18:07:47 +02:00
Christophe Simonis 48b2ce60ed [MERGE] forward port branch saas-16 up to 85571bb78c 2017-08-10 17:01:05 +02:00
Christophe Simonis 85571bb78c [MERGE] forward port branch saas-15 up to dde62073ba 2017-08-10 16:22:36 +02:00
Christophe Simonis 544aa9b04a [MERGE] forward port branch saas-11 up to cfbac106b4 2017-08-10 15:00:33 +02:00
Christophe Simonis cfbac106b4 [MERGE] forward port branch 9.0 up to 1aed433f54 2017-08-10 14:58:24 +02:00
Goffin Simon 1aed433f54 [FIX] website_event: Website Event Error when you encode a 0 value in the registration
The function registration_new must return a type json.

opw:765643
2017-08-10 09:27:05 +02:00
Thibault Delavallée 014b5c9f7c [MOV] website, http_routing: move (un)slug support to http_routing
Slug and unslug API is now available in http_routing. Indeed there is no
link to any website or any reason to not support slufigied URLs when
website is not installed. A new unslug_url method is added as a tool
coming from an embedded method from website. Doing it allows to have all
slug related methods defined at the same point.

Support of slug and unslug in qweb rendering is also moved directly in
http_routing version of ir_ui_view instead of website inheritance. This
is done in order to keep things coherent.

Some code from website about ModelConverter is also moved. Indeed both
versions of ir_http uses some kind of placeholder to store the uid
when converting urls to python. This commit unifies it by using the
website one directly in base to simplify the override.

This commit also updates all module importing slug. Enterprise modules
will have to be updated, see related commit.
2017-08-08 14:23:58 +02:00
Lucas Perais (lpe) 78014ff3ac [FIX] website_event, _sale: protect against inactive products
Commit 14d1f6f6c1 responded to the need to have clean server answers for SEO purposes
and specifically when the products on event tickets have been archived
BUT
it introduced an infinite redirect loop when the event was in state == done

This present commit normalize the behavior in a comprehensive manner and cleans up the code a bit

OPW 757117

Closes #18667
2017-08-07 09:51:15 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Jairo Llopis e7fdd6df73 [IMP] website_event(_sale): make registration form responsive
+ remove redirect that create loop if not child menu and state == 'done'

TODO: make attendees registration popup responsive

This commit closes #15473
2017-03-24 17:03:20 +01:00
Jeremy Kersten 14d1f6f6c1 [FIX] website_event[_sale]: don't allow register when event is done
Some previous links could still point to old register page and so display an
error 500 if product of ticket has been already archived.
2017-02-24 19:18:31 +01:00
Raphael Collet 75dc39e042 [REF] openerp.http: make request.context consistent with request.env.context 2016-08-31 17:21:58 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Jérome Maes 8a399930f3 [REF] website_*: remove render method on website
Since saas-3, website controllers use `request.website.render`
to render the template of a web page. This was kept for retro
compatibility. It's time to stop using deprecated stuff.
Same for `_render` method on website.

'json' route don't use `request.render` since
`JsonRequest` has no `render` method.
2016-08-04 12:02:14 +02:00
Christophe Simonis 53015e11a9 [MERGE] forward port branch saas-11 up to eb83ab2 2016-08-03 16:16:30 +02:00
Jeremy Kersten 944db71f21 [FIX] website_event: fix get_formated_date to avoid traceback
Avoid AttributeError: 'WebsiteEventController (extended by WebsiteEventSa' object has no attribute 'env'
Self is the controller and not the event.
2016-08-02 11:18:05 +02:00
Christophe Simonis c16d5bc750 [MERGE] forward port branch saas-11 up to 87e9639 2016-07-15 16:35:48 +02:00
Olivier Dony 87e9639a97 [FIX] website_event: correct typo in new API conversion
event.event's field is 'country_id', not 'country'

Cfr 616f294786
2016-07-15 14:02:01 +02:00
dut-odoo c83702a36a [IMP] event: change term 'Subscription' to 'Registration'
Changed term 'subscription' to 'registration' in event, event_sale,
website_event, website_event_sale modules
2016-05-13 11:28:28 +02:00
Dharmraj Jhala 616f294786 [MIG] website_event: migrated into new API 2016-04-14 11:56:45 +02:00
Jérome Maes ca8a47c352 [IMP] website_event, website_event_track, website_event_sale : prepare migration
- change method decorator (api.one -> api.multi) for `_set_show_menu`
and `_set_show_menu`
- rename controller class
2016-04-14 11:56:44 +02:00
Jeremy Kersten ce3f797068 [FIX] website_event: avoid traceback when page doesn't exists
The controller /event/<event_id>/page/<page> raise exception if page is not existing.

Allow to pass the template reference when user are creating a new page.
Without it, it is impossible for the end user to create a website_event page without
change manually the xml id because the xml id is based on the module from the template.

This fix is retro compatible, because from_template will be ignored until next update
of website. And during update from website, website_event will be updated because it's a
dependance and so the default_page template created.
2016-01-08 23:19:29 +01:00
Thibault Delavallée 5885e5d9d0 [FIX] website_event: categories display
Indeed the type field has been renamed to event_type_id. However some code
was still relying on the type and type_count names, instead of event_type_id
and event_type_id_count.
2015-09-23 16:22:35 +02:00
Thibault Delavallée 4592be3bfa [RENAME] event: type -> event_type_id
At last I will be able to remember that the type of an event is not
a string, but a m2o to event.type model.
2015-08-20 11:09:43 +02:00
Denis Ledoux fc09d3755a [FIX] website_event: add route alias /events
Having as URL /event (not plural), for the list
of events, is not really user friendly.

opw-644476
2015-07-10 10:11:54 +02:00
Christophe Simonis 4647778758 [MERGE] forward port of branch 8.0 up to ea59856 2015-06-15 12:28:32 +02:00
Goffin Simon eabf7df5f9 [FIX] website_event: format event periode
The format period defined by the start_date and end_date of an event
can be set according to the language.

opw:640011
2015-06-02 10:42:46 +02:00
Goffin Simon 50182d0dfe [FIX] website_event: month in local events
The month inside the local events snippet must be in the user language.
Inspired from def _read_group_format_result in models.py

opw:640011
2015-05-29 16:56:14 +02:00
Thibault Delavallée 09992333f3 [FIX] website_event: call method as current user, not superuser
because this makes no sense.
2015-04-01 10:11:30 +02:00
Richard Mathot 194d95cd47 [ADD] website_event_questions: ask questions to event attendees
[IMP] event,event_sale,website_event_sale: refactoring to be more easily extended

(code portions are courtesy of Thibault Delavallée <tde@odoo.com>)
2015-02-19 11:22:59 +01:00
Paramjit Singh Sahota ca862e7b85 [IMP] event: Split Ticket: registration are now for one attendee only.
Registration are now for one attendee only. When buying several seats for an event
you have now one registration for each attendee.

event: nb_register field is removed; as well as unnecessary user_id and it subscribe /
unsubscribe behavior. Also slighly cleaned some views.
event_sale: do not auto confirm registrations linked to a draft sale order. Note: strange
origin is a char field, not a sale_order_id. Added a small wizard to edit attendees
data when confirming a sale order containing event related lines.
website_event: when buying free tickets, ask for attendee details. Added template,
controllers to handle that behavior.
website_event_sale: when buying tickets, ask for attendee details. Events ecommerce
should be better integrated with online events, using inheritance to add details
instead of being very different.
2014-10-09 10:09:06 +02:00
Thibault Delavallée 9353c101de [CLEAN] website_event: migrate models to the new API + some code cleaning.
Updated some code in website_event_track, inheritance with new API.

Controllers need a major cleaning, but, hey, they are too creepy.
2014-10-03 14:00:28 +02:00
Goffin Simon 5f258c831e [WIP] Multi website 2014-09-16 14:11:08 +02:00
Thibault Delavallée f5c60d482b [FIX] website_event: pager now takes into account the searches performed
by the user. Otherwise it was resetting the search to all events.
2014-08-27 11:41:51 +02:00
Olivier Dony e11eddf753 [MERGE] Forward-port of saas-5 up to 20cc18d 2014-08-13 20:46:47 +02:00
Denis Ledoux fe83c11301 [MERGE] forward port of branch saas-4 up to b49755b
The forward port of the fix 3609ba10f2 will be done separately, as the mrp scheduler has been completely refactored from saas-5.

Conflicts:
	addons/l10n_be_coda/wizard/account_coda_import.py
	addons/point_of_sale/static/src/xml/pos.xml
	addons/procurement/schedulers.py
2014-08-13 10:45:36 +02:00