summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMitali Patel <mpa@odoo.com>2017-02-13 12:04:21 +0100
committerThibault Delavallée <tde@odoo.com>2017-03-03 13:09:17 +0100
commit5d4dd98af2672ccdde37d9587653c80a0ec7c661 (patch)
treeab9a4109398cfc51a120f859849832151d800a57 /addons
parent531d641375f5cee7d3a5e629f6b1eaceee8b2739 (diff)
[IMP] website_event: apply checkout / buy process improvements
* reword various texts in website_event to avoid references to a sell or checkout process as website_event does not handle sakes; * if there is only one ticket available, propose to take one by default. Display Register Now instead of Order Now if tickets are free. Display an error if the user chooses no tickets in its registration.; * link in cart for event tickets redirects to event, not product; * confirm attendees only at invoice payment; * improve wording, use schedule instead of agenda.
Diffstat (limited to 'addons')
-rw-r--r--addons/event/views/event_config_settings_views.xml6
-rw-r--r--addons/event_sale/models/__init__.py1
-rw-r--r--addons/event_sale/models/account_invoice.py17
-rw-r--r--addons/event_sale/models/sale_order.py6
-rw-r--r--addons/event_sale/wizard/event_edit_registration.py2
-rw-r--r--addons/website_event/README.md2
-rw-r--r--addons/website_event/__manifest__.py2
-rw-r--r--addons/website_event/static/description/index.html26
-rw-r--r--addons/website_event/static/src/js/website_event.js20
-rw-r--r--addons/website_event/views/event_templates.xml7
-rw-r--r--addons/website_event_sale/__manifest__.py2
-rw-r--r--addons/website_event_sale/models/sale_order.py2
-rw-r--r--addons/website_event_sale/views/event_templates.xml24
-rw-r--r--addons/website_event_track/views/event_track_views.xml4
14 files changed, 83 insertions, 38 deletions
diff --git a/addons/event/views/event_config_settings_views.xml b/addons/event/views/event_config_settings_views.xml
index 6b18bb9d71d..67601b1274d 100644
--- a/addons/event/views/event_config_settings_views.xml
+++ b/addons/event/views/event_config_settings_views.xml
@@ -24,14 +24,14 @@
</div>
</div>
</div>
- <div class="col-xs-12 col-md-6 o_setting_box" title="Add a navigation menu to your event web pages with an agenda, tracks, a track proposal form, etc.">
+ <div class="col-xs-12 col-md-6 o_setting_box" title="Add a navigation menu to your event web pages with schedule, tracks, a track proposal form, etc.">
<div class="o_setting_left_pane">
<field name="module_website_event_track"/>
</div>
<div class="o_setting_right_pane">
- <label string="Agenda &amp; Tracks" for="module_website_event_track"/>
+ <label string="Schedule &amp; Tracks" for="module_website_event_track"/>
<div class="text-muted">
- Manage &amp; publish an agenda with tracks
+ Manage &amp; publish a schedule with tracks
</div>
</div>
</div>
diff --git a/addons/event_sale/models/__init__.py b/addons/event_sale/models/__init__.py
index 988d9523f9b..a55c87dd5a6 100644
--- a/addons/event_sale/models/__init__.py
+++ b/addons/event_sale/models/__init__.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
+import account_invoice
import sale_order
import product
import event
diff --git a/addons/event_sale/models/account_invoice.py b/addons/event_sale/models/account_invoice.py
new file mode 100644
index 00000000000..b8f4e309bb4
--- /dev/null
+++ b/addons/event_sale/models/account_invoice.py
@@ -0,0 +1,17 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo. See LICENSE file for full copyright and licensing details.
+
+from odoo import api, models
+
+
+class AccountInvoice(models.Model):
+ _inherit = 'account.invoice'
+
+ @api.multi
+ def action_invoice_paid(self):
+ """ When an invoice linked to a sales order selling registrations is
+ paid confirm attendees. Attendees should indeed not be confirmed before
+ full payment. """
+ res = super(AccountInvoice, self).action_invoice_paid()
+ self.mapped('invoice_line_ids.sale_line_ids')._update_registrations(confirm=True)
+ return res
diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py
index d917254fb34..ec9bbe2ffae 100644
--- a/addons/event_sale/models/sale_order.py
+++ b/addons/event_sale/models/sale_order.py
@@ -10,7 +10,7 @@ class SaleOrder(models.Model):
def action_confirm(self):
self.ensure_one()
res = super(SaleOrder, self).action_confirm()
- self.order_line._update_registrations(confirm=True)
+ self.order_line._update_registrations(confirm=False, cancel_to_draft=False)
if any(self.order_line.filtered(lambda line: line.event_id)):
return self.env['ir.actions.act_window'].with_context(default_sale_order_id=self.id).for_xml_id('event_sale', 'action_sale_order_event_registration')
return res
@@ -35,7 +35,7 @@ class SaleOrderLine(models.Model):
return res
@api.multi
- def _update_registrations(self, confirm=True, registration_data=None):
+ def _update_registrations(self, confirm=True, cancel_to_draft=False, registration_data=None):
""" Create or update registrations linked to a sales order line. A sale
order line has a product_uom_qty attribute that will be the number of
registrations linked to this line. This method update existing registrations
@@ -46,7 +46,7 @@ class SaleOrderLine(models.Model):
existing_registrations = registrations.filtered(lambda self: self.sale_order_line_id.id == so_line.id)
if confirm:
existing_registrations.filtered(lambda self: self.state != 'open').confirm_registration()
- else:
+ if cancel_to_draft:
existing_registrations.filtered(lambda self: self.state == 'cancel').do_draft()
for count in range(int(so_line.product_uom_qty) - len(existing_registrations)):
diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py
index 0ae579bc693..f03623d91ad 100644
--- a/addons/event_sale/wizard/event_edit_registration.py
+++ b/addons/event_sale/wizard/event_edit_registration.py
@@ -55,7 +55,7 @@ class RegistrationEditor(models.TransientModel):
self.env['event.registration'].create(values)
if self.env.context.get('active_model') == 'sale.order':
for order in self.env['sale.order'].browse(self.env.context.get('active_ids', [])):
- order.order_line._update_registrations(confirm=True)
+ order.order_line._update_registrations(confirm=False)
return {'type': 'ir.actions.act_window_close'}
diff --git a/addons/website_event/README.md b/addons/website_event/README.md
index 862c44a685c..e4691d2619b 100644
--- a/addons/website_event/README.md
+++ b/addons/website_event/README.md
@@ -10,7 +10,7 @@ Create Awesome Event Pages
### Get rid of old WYSIWYG editors
-Create beautiful event pages by drag & droping well designed *'Building Blocks'*. Publish event photos, speakers, agenda, etc.
+Create beautiful event pages by drag & droping well designed *'Building Blocks'*. Publish event photos, speakers, schedule, etc.
Odoo's unique *'edit inline'* approach makes website creation surprisingly easy. "Want to introduce a speaker? to change the price of a ticket? to update a banner? promote sponsors?" just click and change.
diff --git a/addons/website_event/__manifest__.py b/addons/website_event/__manifest__.py
index bd467c9b02a..6811d586e16 100644
--- a/addons/website_event/__manifest__.py
+++ b/addons/website_event/__manifest__.py
@@ -4,7 +4,7 @@
'name': 'Online Events',
'category': 'Marketing',
'sequence': 135,
- 'summary': 'Schedule, Promote and Sell Events',
+ 'summary': 'Publish Events and Manage Online Registrations on your Website',
'website': 'https://www.odoo.com/page/website-builder',
'description': """
Online Events
diff --git a/addons/website_event/static/description/index.html b/addons/website_event/static/description/index.html
index 8ef92f0377c..5648a814172 100644
--- a/addons/website_event/static/description/index.html
+++ b/addons/website_event/static/description/index.html
@@ -1,7 +1,7 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="color:#875A7B;">Create your own events</h2>
- <h3 class="oe_slogan">Organize, publish, promote and sell.</h3>
+ <h3 class="oe_slogan">Organize, publish and promote.</h3>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="event_sc_00.png">
@@ -15,7 +15,7 @@
<h2 class="oe_slogan" style="color:#875A7B;">Host events that resonates with your audience</h2>
<h3 class="oe_slogan">Easily create live or online events</h3>
<p class="oe_mt32">
- One platform to manage it all. Odoo Events covers all aspects of an event manager's work: organization, visibility, promotion and sale. Use it with any kind of event, including conferences, meetings, seminars, training and webinars.
+ One platform to manage it all. Odoo Events covers all aspects of an event manager's work: organization, visibility, promotion. Use it with any kind of event, including conferences, meetings, seminars, training and webinars.
</p>
</div>
</section>
@@ -51,7 +51,7 @@
</div>
<div class="oe_span3 text-center">
<span class="fa fa-2x fa-calendar"/>
- <p class="oe_mt16">Automatically display your event&apos;s agenda in a clear, classy design on your website.</p>
+ <p class="oe_mt16">Automatically display your event&apos;s schedule in a clear, classy design on your website.</p>
</div>
<div class="oe_span3 text-center">
<span class="fa fa-2x fa-search"/>
@@ -69,9 +69,9 @@
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="sponsors.png" style="margin-left: -1px;">
<h2 class="oe_slogan oe_mt32" style="text-align: left; color:#875A7B;">Get sponsors to come to you</h2>
- <h3 class="oe_slogan" style="text-align: left;">Sell sponsorship, promote your sponsors</h3>
+ <h3 class="oe_slogan" style="text-align: left;">Promote your sponsors</h3>
<p class="oe_mt32 text-justify">
- Easily manage existing and new sponsors with Odoo Events. Add sponsors to your events and publish sponsors per level (e.g., gold) on the bottom of every page of the event. Sell sponsorship packages online through Odoo eCommerce.</p>
+ Easily manage existing and new sponsors with Odoo Events. Add sponsors to your events and publish sponsors per level (e.g., gold) on the bottom of every page of the event.</p>
</div>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="website_seo.png" style="margin-left: -1px;">
@@ -83,22 +83,16 @@
</div>
</section>
-<section class="oe_container oe_dark">
+<section class="oe_container">
<div class="oe_row oe_spaced">
+ <h2 class="oe_slogan" style="color:#875A7B;">Total promotion tools</h2>
+ <h3 class="oe_slogan">Promote events efficiently on all channels</h3>
<div class="oe_span6">
- <img class="oe_picture oe_screenshot" src="event_promote.png" style="margin-left: -1px;">
- <h2 class="oe_slogan oe_mt32" style="text-align: left; color:#875A7B;">Total promotion tools</h2>
- <h3 class="oe_slogan" style="text-align: left;">Promote events efficiently on all channels</h3>
- <p class="oe_mt32 text-justify">
- Segment your audience, leverage social media and email marketing to promote your events to the right audience. Odoo Events&apos; smooth integration with countless Odoo apps simplifies promotion to the extreme. Setup automated campaigns for attendees, or automatically send timely emails to registrants. Optimize conversions with ad-hoc landing pages for your different marketing campaigns.
- </p>
+ <img class="oe_picture oe_screenshot" src="event_promote.png">
</div>
<div class="oe_span6">
- <img class="oe_picture oe_screenshot" src="event_sell.png" style="margin-left: -1px;">
- <h2 class="oe_slogan oe_mt32" style="text-align: left; color:#875A7B;">Sell tickets online</h2>
- <h3 class="oe_slogan" style="text-align: left;">Automate the registration and payment process</h3>
<p class="oe_mt32 text-justify">
- Manage registrations and sell tickets online to your events. Choose whether it is a free event or whether attendees need to register for a fee. Pick the paying method -pay online with a credit card or with the invoice. Define special conditions such as early-bird prices, member benefits or extra services with multiple tickets. All you need to boost your event attendance.
+ Segment your audience, leverage social media and email marketing to promote your events to the right audience. Odoo Events&apos; smooth integration with countless Odoo apps simplifies promotion to the extreme. Setup automated campaigns for attendees, or automatically send timely emails to registrants. Optimize conversions with ad-hoc landing pages for your different marketing campaigns.
</p>
</div>
</div>
diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js
index cb531d0035a..2df7642c1a3 100644
--- a/addons/website_event/static/src/js/website_event.js
+++ b/addons/website_event/static/src/js/website_event.js
@@ -26,13 +26,21 @@ var EventRegistrationForm = Widget.extend({
$("#registration_form select").each(function() {
post[$(this).attr('name')] = $(this).val();
});
- return ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
- var $modal = $(modal);
- $modal.appendTo($form).modal();
- $modal.on('click', '.js_goto_event', function () {
- $modal.modal('hide');
+ var tickets_ordered = _.some(_.map(post, function(value, key) { return parseInt(value) }));
+ if (! tickets_ordered) {
+ return $('#registration_form table').after(
+ '<div class="alert alert-info">Please select at least one ticket.</div>'
+ );
+ }
+ else {
+ return ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
+ var $modal = $(modal);
+ $modal.appendTo($form).modal();
+ $modal.on('click', '.js_goto_event', function () {
+ $modal.modal('hide');
+ });
});
- });
+ }
},
});
diff --git a/addons/website_event/views/event_templates.xml b/addons/website_event/views/event_templates.xml
index ea714ef45b5..a06e81e5ccb 100644
--- a/addons/website_event/views/event_templates.xml
+++ b/addons/website_event/views/event_templates.xml
@@ -438,7 +438,12 @@
<td>
<select t-if="event.seats_available or event.seats_availability == 'unlimited'" name="nb_register-0" class="form-control">
<t t-foreach="range(0, (event.seats_availability == 'unlimited' or event.seats_available > 9) and 10 or event.seats_available+1)" t-as="nb">
- <option t-esc="nb"/>
+ <t t-if="nb == 1">
+ <option t-esc="nb" selected="selected"/>
+ </t>
+ <t t-if="nb != 1">
+ <option t-esc="nb"/>
+ </t>
</t>
</select>
<span t-if="event.seats_availability == 'limited' and not event.seats_available">Sold Out</span>
diff --git a/addons/website_event_sale/__manifest__.py b/addons/website_event_sale/__manifest__.py
index 4311b952800..67beb8a1d41 100644
--- a/addons/website_event_sale/__manifest__.py
+++ b/addons/website_event_sale/__manifest__.py
@@ -3,7 +3,7 @@
{
'name': "Online Event's Tickets",
'category': 'Marketing',
- 'summary': "Sell Your Event's Tickets",
+ 'summary': "Manage Events and Sell Tickets Online",
'website': 'https://www.odoo.com/page/events',
'description': """
Online Event's Tickets
diff --git a/addons/website_event_sale/models/sale_order.py b/addons/website_event_sale/models/sale_order.py
index edfb30e7e62..3cf2d253182 100644
--- a/addons/website_event_sale/models/sale_order.py
+++ b/addons/website_event_sale/models/sale_order.py
@@ -92,7 +92,7 @@ class SaleOrder(models.Model):
# adding attendees
elif ticket and new_qty > old_qty:
line = OrderLine.browse(values['line_id'])
- line._update_registrations(confirm=False, registration_data=kwargs.get('registration_data', []))
+ line._update_registrations(confirm=False, cancel_to_draft=True, registration_data=kwargs.get('registration_data', []))
# add in return values the registrations, to display them on website (or not)
values['attendee_ids'] = self.env['event.registration'].search([('sale_order_line_id', '=', line.id), ('state', '!=', 'cancel')]).ids
return values
diff --git a/addons/website_event_sale/views/event_templates.xml b/addons/website_event_sale/views/event_templates.xml
index d0005892fd6..adcacf2ccb9 100644
--- a/addons/website_event_sale/views/event_templates.xml
+++ b/addons/website_event_sale/views/event_templates.xml
@@ -25,6 +25,7 @@
</xpath>
<xpath expr="//tbody" position="replace">
<tbody>
+ <t t-set="ticket_count" t-value="len([ticket for ticket in event.event_ticket_ids if not ticket.is_expired])"/>
<t t-foreach="event.event_ticket_ids" t-as="ticket">
<tr itemscope="itemscope" itemtype="http://data-vocabulary.org/Offer" t-if="not ticket.is_expired">
<td itemscope="itemscope" itemtype="http://data-vocabulary.org/Product">
@@ -74,7 +75,12 @@
<t t-set="seats_max_event" t-value="(event.seats_availability == 'unlimited' or event.seats_available > 9) and 10 or event.seats_available + 1"/>
<t t-set="seats_max" t-value="min(seats_max_ticket, seats_max_event)"/>
<t t-foreach="range(0, seats_max)" t-as="nb">
- <option t-esc="nb"/>
+ <t t-if="ticket_count == 1 and nb == 1">
+ <option t-esc="nb" selected="selected"/>
+ </t>
+ <t t-if="ticket_count != 1 or nb != 1">
+ <option t-esc="nb"/>
+ </t>
</t>
</select>
<span t-if="(not event.seats_available and event.seats_availability == 'limited') or (ticket.seats_availability == 'limited' and not ticket.seats_available)">Sold Out</span>
@@ -84,8 +90,16 @@
</tbody>
</xpath>
<xpath expr="//button[@type='submit']" position="replace">
+ <t t-set="ticket_buy" t-value="any(ticket for ticket in event.event_ticket_ids if not ticket.is_expired and ticket.price)"/>
<button type="submit" t-if="event.state == 'confirm' and (event.seats_available or event.seats_availability == 'unlimited')"
- class="btn btn-primary btn-lg pull-right a-submit" t-attf-id="#{event.id}">Order Now</button>
+ class="btn btn-primary btn-lg pull-right a-submit" t-attf-id="#{event.id}">
+ <t t-if="ticket_buy">
+ Order Now
+ </t>
+ <t t-if="not ticket_buy">
+ Register Now
+ </t>
+ </button>
</xpath>
<xpath expr="//form[@id='registration_form']" position="attributes">
<attribute name="t-if">event.event_ticket_ids</attribute>
@@ -93,6 +107,12 @@
</template>
<template id="cart" inherit_id="website_sale.cart_lines" name="Hide product reduction for event tickets">
+ <xpath expr="//td[@class='td-product_name']/div/a" position="attributes">
+ <attribute name="t-attf-href"/>
+ <attribute name="t-att-href">
+ line.event_id and ('/event/%s/register' % slug(line.event_id)) or ('/shop/product/%s' % slug(line.product_id.product_tmpl_id))
+ </attribute>
+ </xpath>
<xpath expr="//del" position="attributes">
<attribute name="t-attf-class" separator=" " add="#{line.event_id and 'hidden' or ''}"/>
</xpath>
diff --git a/addons/website_event_track/views/event_track_views.xml b/addons/website_event_track/views/event_track_views.xml
index 7a9e740a673..47fb7db19b9 100644
--- a/addons/website_event_track/views/event_track_views.xml
+++ b/addons/website_event_track/views/event_track_views.xml
@@ -190,7 +190,7 @@
<p class="oe_view_nocontent_create">
Click to add a track.
</p><p>
- Tracks define the agenda of your event. These can bea talk, a round table, a meeting, etc.
+ Tracks define the schedule of your event. These can bea talk, a round table, a meeting, etc.
</p>
</field>
</record>
@@ -205,7 +205,7 @@
<p class="oe_view_nocontent_create">
Click to add a track.
</p><p>
- Tracks define the agenda of your event. These can be a talk, a round table, a meeting, etc.
+ Tracks define the schedule of your event. These can be a talk, a round table, a meeting, etc.
</p>
</field>
</record>