summaryrefslogtreecommitdiff
path: root/addons/website_event_sale/views
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website_event_sale/views')
-rw-r--r--addons/website_event_sale/views/assets.xml10
-rw-r--r--addons/website_event_sale/views/event_event_views.xml13
-rw-r--r--addons/website_event_sale/views/website_event_templates.xml43
-rw-r--r--addons/website_event_sale/views/website_sale_templates.xml40
4 files changed, 106 insertions, 0 deletions
diff --git a/addons/website_event_sale/views/assets.xml b/addons/website_event_sale/views/assets.xml
new file mode 100644
index 00000000..9c43f4d0
--- /dev/null
+++ b/addons/website_event_sale/views/assets.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<template id="assets_tests" inherit_id="web.assets_tests" name="Website Event Sale Assets Tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/website_event_sale/static/tests/tours/website_event_sale.js"></script>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_event_sale/views/event_event_views.xml b/addons/website_event_sale/views/event_event_views.xml
new file mode 100644
index 00000000..521b3ce4
--- /dev/null
+++ b/addons/website_event_sale/views/event_event_views.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="event_form_mandatory_company" model="ir.ui.view">
+ <field name="name">event.event.view.form.inherit.company.mandatory</field>
+ <field name="model">event.event</field>
+ <field name="inherit_id" ref="event.view_event_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='company_id']" position="attributes">
+ <attribute name="required">1</attribute>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/website_event_sale/views/website_event_templates.xml b/addons/website_event_sale/views/website_event_templates.xml
new file mode 100644
index 00000000..ebe72043
--- /dev/null
+++ b/addons/website_event_sale/views/website_event_templates.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<template id="registration_template" inherit_id="website_event.registration_template">
+ <!-- Add price information on tickets (multi tickets, aka in collapse) -->
+ <xpath expr="//div[hasclass('o_wevent_registration_multi_select')]" position="inside">
+ <t t-if="ticket.price">
+ <t t-if="(ticket.price-website.get_current_pricelist().currency_id._convert(ticket.price_reduce, event.company_id.sudo().currency_id, event.company_id, datetime.date.today())) &gt; 1 and website.get_current_pricelist().discount_policy == 'without_discount'">
+ <del class="text-danger mr-1" t-field="ticket.price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.get_current_pricelist().currency_id}"/>
+ </t>
+ <span t-field="ticket.price_reduce" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <span t-field="ticket.price_reduce_taxinc" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}" groups="account.group_show_line_subtotals_tax_included"/>
+ <span itemprop="price" class="d-none" t-esc="ticket.price"/>
+ <span itemprop="priceCurrency" class="d-none" t-esc="website.pricelist_id.currency_id.name"/>
+ </t>
+ <span t-else="" class="font-weight-bold text-uppercase">Free</span>
+ </xpath>
+ <xpath expr="//div[@id='price-range']" position="inside">
+ <span class="text-dark">
+ From
+ <span t-esc="event.event_ticket_ids[0].price_reduce" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}"/>
+ to
+ <span t-esc="event.event_ticket_ids[-1].price_reduce" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}"/>
+ </span>
+ </xpath>
+ <!-- Add price information on tickets (mono ticket, aka not in collapse) -->
+ <xpath expr="//div[hasclass('o_wevent_registration_single')]//h6" position="after">
+ <div class="px-2 text-dark mr-2 border-right d-flex align-items-center align-self-stretch">
+ <t t-if="tickets.price">
+ <t t-if="(tickets.price-website.get_current_pricelist().currency_id._convert(tickets.price_reduce, event.company_id.sudo().currency_id, event.company_id, datetime.date.today())) &gt; 1 and website.get_current_pricelist().discount_policy == 'without_discount'">
+ <del class="text-danger mr-1" t-field="tickets.price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.get_current_pricelist().currency_id}"/>
+ </t>
+ <span t-field="tickets.price_reduce" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <span t-field="tickets.price_reduce_taxinc" t-options="{'widget': 'monetary', 'display_currency': website.pricelist_id.currency_id}" groups="account.group_show_line_subtotals_tax_included"/>
+ <span itemprop="price" class="d-none" t-esc="tickets.price"/>
+ <span itemprop="priceCurrency" class="d-none" t-esc="website.pricelist_id.currency_id.name"/>
+ </t>
+ <span t-else="" class="font-weight-bold text-uppercase">Free</span>
+ </div>
+ </xpath>
+</template>
+
+</odoo>
diff --git a/addons/website_event_sale/views/website_sale_templates.xml b/addons/website_event_sale/views/website_sale_templates.xml
new file mode 100644
index 00000000..04edb134
--- /dev/null
+++ b/addons/website_event_sale/views/website_sale_templates.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <!-- If the sale order line concerns an event, we want the "product" link to point to the event itself and not to the product on the ecommerce -->
+ <template id="cart_line_product_link_inherit_website_event_sale" inherit_id="website_sale.cart_line_product_link" name="Event Shopping Cart Line Product Link">
+ <xpath expr="//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 line.product_id.website_url
+ </attribute>
+ </xpath>
+ </template>
+
+ <!-- If the sale order line concerns an event, we want to show an additional line with the event name even on small screens -->
+ <template id="cart_lines_inherit_website_event_sale" inherit_id="website_sale.cart_lines" name="Event Shopping Cart Lines">
+ <xpath expr="//t[@t-call='website_sale.cart_line_description_following_lines']/t[@t-set='div_class']" position="after">
+ <t t-if="line.event_id">
+ <t t-set="div_class" t-value="''"/>
+ </t>
+ </xpath>
+ <xpath expr="//del" position="attributes">
+ <attribute name="t-attf-class" separator=" " add="#{line.event_id and 'd-none' or ''}"/>
+ </xpath>
+ </template>
+
+ <!-- If the sale order line concerns an event, we want to show an additional line with the event name -->
+ <template id="cart_popover_inherit_website_event_sale" inherit_id="website_sale.cart_popover" name="Event Cart Popover">
+ <xpath expr="//t[@t-call='website_sale.cart_line_product_link']" position="after">
+ <t t-if="line.event_id" t-call="website_sale.cart_line_description_following_lines"/>
+ </xpath>
+ </template>
+
+ <!-- If the sale order line concerns an event, we want to show an additional line with the event name -->
+ <template id="cart_summary_inherit_website_event_sale" inherit_id="website_sale.cart_summary" name="Event Cart right column">
+ <xpath expr="//td[hasclass('td-product_name')]/div/strong" position="after">
+ <t t-if="line.event_id" t-call="website_sale.cart_line_description_following_lines"/>
+ </xpath>
+ </template>
+
+</odoo>