Commit Graph
166 Commits
Author SHA1 Message Date
Christophe Simonis 5dbf7bf357 [MERGE] forward port branch saas-12.1 up to f00c490be8 2019-03-26 10:33:26 +01:00
Christophe Simonis 4eff0af02e [MERGE] forward port branch saas-12.1 up to 6878c9f342 2019-03-21 13:58:37 +01:00
Jorge Pinna Puissant c41d1d2ca8 [FIX] website_event: pricelist in event register
Create an event with a price.
Create a pricelist with a different price for the event.
Add the pricelist to the Public user.
On the website, open the event to register.

Before this commit, the shown price is the one of the event, and not the
one of the pricelist.

Now, the price is shown correctly and take into account the pricelist.

opw-1951252

closes odoo/odoo#31848

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-14 12:46:01 +00:00
Alex Tuyls f7acbf6466 [FIX] website_event,website_event_sale: correction pricelist in event register
A recent fix c41d1d2 was made to select the related pricelist
to show the correct price of an event product.

This fix creates another bug in case of Ecommerce app
not installed, because the method get_current_pricelist
is defined in website_sale module.

We need to move the fix from website_event to website_event_sale module.

closes odoo/odoo#31953

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-03-19 15:57:46 +00:00
RomainLibert a03faab03f [IMP] event, website_event: Make ics file generation available in event
Ics file generation should be possible even when only event is
installed as it is a basic feature of events.

Moreover we need to be able to generate such files in order to replace
the old outlook api used in the event templates, api which is not
supported anymore.

We decided to use ics files because it is supported by most calendar
schedulers hence working with outlook.

Linked to task #1853063

closes odoo/odoo#28477
2018-12-17 11:46:48 +00:00
Romain Derie 75f3d8f1d7 [FIX] website_event, website_sale: _order on is_published
As fbbf24f58a introduced multiwebsite and `website_published` became a
related and/or a computed field (depending of the mixin), we should not order
on this field as it is not on DB anymore.

We now have the field `is_published` that replace `website_published`.
2018-08-14 22:25:36 +02:00
Jeremy KerstenandDerie Romain 066cfc9598 [IMP] website_[blog|event|forum|sale|slide]: make website specific
Set up env & tools for module website multiwebsite (blog, event, sale..)
website_id in modelConverter and ir_rule

add _compute_domain_keys to have a different cache per website
  or rules would not be correctly website_dependant
  eg: blog 1 on website 1, blog 2 on website 2
      access blog 1 from website 1 => can access -> normal
      access blog 1 from website 2 => can access -> should crash because (ir rule)

split mixing website.published.mixin and website.published.multi.mixin to have
website_id only on last one.
 multi mixing will:
     - override website_published compute to take current_website into account (not in backend)
     - force website when clicking on published in backend

- website blog, website_sale, website_event, website_forum, website_slides are now multi website

Co-authored-by: Derie Romain <rde@odoo.com>
Co-authored-by: Kersten Jérémy <jke@odoo.com>
2018-08-13 20:16:34 +02:00
Fabrice Henrion 2bb411a226 [FIX] website_event: wording typo
Closes #25933
2018-07-24 15:24:54 +02:00
Christophe Simonis c8bb02141d [MERGE] forward port branch saas-11.3 up to 3cdcbce93c 2018-06-28 19:01:52 +02:00
Christophe Simonis 12ddec3a76 [MERGE] forward port branch 11.0 up to 152519cd65 2018-06-27 11:37:52 +02:00
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 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis b170a753e1 [MERGE] forward port branch 11.0 up to b05e4d5f95 2018-06-15 10:15:27 +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
RomainLibert 83aa86d658 [IMP] website_event: avoid reading of emails
The new route make_event_ics_file received a list of attendee ids and was sending
the emails associated with these in an ics file, this could potentially
give out some information about the attendees.

(see commit 7862b2b71c)

Also the method get_ics_file had no reason to be public and so is now
private.

Closes #24711
2018-06-05 12:22:30 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Jeremy Kersten 04ce6e84c2 [IMP] website_event: show physical event before online if country specific.
If a country is specified, we show also all our online events to promote it since
they can be followed from anywhere. But we show in priority the physical event.

opw-1845012
2018-05-15 17:24:50 +02:00
Sanjay Jamod 7862b2b71c [IMP] website_event: quick add to Outlook/Google Calendar
In order for the user to easily add the date of the events to his
calendar we need to facilitate the integration with Outlook/ Google
Calendar.

For this we add two buttons at the end of the subscription phase (one
for Google Calendar and one for Outlook [ics file download])

Task ID: 39315
Closes #21854
2018-04-30 10:58:20 +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