mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 14:12:02 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -1,11 +0,0 @@
|
|||
<?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>
|
||||
<script type="text/javascript" src="/website_event_sale/static/tests/tours/website_event_sale_last_ticket.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -1,55 +1,106 @@
|
|||
<?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 - ticket.price_reduce) > 1 and website.pricelist_id.discount_policy == 'without_discount'">
|
||||
<del class="text-danger me-1" t-field="ticket.price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"/>
|
||||
<template id="modal_ticket_registration" inherit_id="website_event.modal_ticket_registration">
|
||||
<!-- Change pricelist -->
|
||||
<xpath expr="//div[hasclass('o_wevent_price_range')]" position="after">
|
||||
<div id="o_wevent_tickets_pricelist" class="collapse show">
|
||||
<t t-call="website_sale.pricelist_list">
|
||||
<t t-set="_classes" t-valuef="d-inline p-0 ms-2 my-1"/>
|
||||
</t>
|
||||
<span t-field="ticket.price_reduce"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, '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', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"
|
||||
groups="account.group_show_line_subtotals_tax_included"/>
|
||||
</div>
|
||||
</xpath>
|
||||
<!-- Add style display for price if the ticket is available -->
|
||||
<xpath expr="//div[contains(@t-attf-class, 'o_wevent_registration_multi_select')]" position="attributes">
|
||||
<attribute name="t-attf-class" separator=" " add="{{'' if not ticket.sale_available and not ticket.is_expired and ticket.is_launched else ('mt-1' if ticket.price_reduce == 0 else 'mt-2')}}"/>
|
||||
</xpath>
|
||||
<!-- Add price information on tickets (multi tickets, aka in collapse) -->
|
||||
<xpath expr="//div[contains(@t-attf-class, 'o_wevent_registration_multi_select')]" position="inside">
|
||||
<t t-if="ticket.price">
|
||||
<t t-if="(ticket.price - ticket.price_reduce) > 0">
|
||||
<del t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
|
||||
class="text-danger me-1"
|
||||
t-field="ticket.price"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<del t-else=""
|
||||
class="text-danger me-1"
|
||||
t-field="ticket.price_incl"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
</t>
|
||||
<span t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
|
||||
class="fs-6"
|
||||
t-field="ticket.price_reduce"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<span t-else=""
|
||||
t-field="ticket.price_reduce_taxinc"
|
||||
class="fs-6"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<span itemprop="price" class="d-none" t-out="ticket.price"/>
|
||||
<span itemprop="priceCurrency" class="d-none" t-out="website.pricelist_id.currency_id.name"/>
|
||||
<span itemprop="priceCurrency" class="d-none" t-out="website.currency_id.name"/>
|
||||
</t>
|
||||
<span t-else="" class="fw-bold text-uppercase">Free</span>
|
||||
<span t-else="" class="badge text-bg-success p-2 px-3">Free</span>
|
||||
</xpath>
|
||||
<xpath expr="//div[hasclass('o_wevent_price_range')]" position="inside">
|
||||
<t t-if="event.event_ticket_ids[-1].price_reduce > 0">
|
||||
<span class="text-dark">
|
||||
<t t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'" t-set="all_prices" t-value="event.event_ticket_ids.mapped('price_reduce')"/>
|
||||
<t t-else="" t-set="all_prices" t-value="event.event_ticket_ids.mapped('price_reduce_taxinc')"/>
|
||||
<t t-set="lowest_price" t-value="min(all_prices)"/>
|
||||
<t t-set="highest_price" t-value="max(all_prices)"/>
|
||||
<t t-if="highest_price > 0">
|
||||
<small class="text-muted">
|
||||
From
|
||||
<span t-out="event.event_ticket_ids[0].price_reduce" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"/>
|
||||
<t t-if="event.event_ticket_ids[-1].price_reduce != event.event_ticket_ids[0].price_reduce">
|
||||
<span t-out="lowest_price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<t t-if="lowest_price != highest_price">
|
||||
to
|
||||
<span t-out="event.event_ticket_ids[-1].price_reduce" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"/>
|
||||
<span t-out="highest_price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
</t>
|
||||
</span>
|
||||
</small>
|
||||
</t>
|
||||
</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 d-flex align-items-center align-self-stretch">
|
||||
<xpath expr="//div[hasclass('o_wevent_registration_single_select')]" position="before">
|
||||
<div class="flex-md-grow-1 mt-1 me-2 text-end">
|
||||
<t t-if="tickets.price">
|
||||
<t t-if="(tickets.price - tickets.price_reduce) >1 and website.get_current_pricelist().discount_policy == 'without_discount'">
|
||||
<del class="text-danger me-1" t-field="tickets.price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"/>
|
||||
<t t-if="(tickets.price - tickets.price_reduce) >0">
|
||||
<del t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
|
||||
class="text-danger me-1"
|
||||
t-field="tickets.price"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<del t-else=""
|
||||
class="text-danger me-1"
|
||||
t-field="tickets.price_incl"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
</t>
|
||||
<span t-field="tickets.price_reduce"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, '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', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.pricelist_id.currency_id}"
|
||||
groups="account.group_show_line_subtotals_tax_included"/>
|
||||
<span t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
|
||||
class="badge text-bg-secondary fs-6"
|
||||
t-field="tickets.price_reduce"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<span t-else=""
|
||||
class="badge text-bg-secondary fs-6"
|
||||
t-field="tickets.price_reduce_taxinc"
|
||||
t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
|
||||
<span itemprop="price" class="d-none" t-out="tickets.price"/>
|
||||
<span itemprop="priceCurrency" class="d-none" t-out="website.pricelist_id.currency_id.name"/>
|
||||
<span itemprop="priceCurrency" class="d-none" t-out="website.currency_id.name"/>
|
||||
</t>
|
||||
<span t-else="" class="fw-bold text-uppercase">Free</span>
|
||||
<span t-else="" class="badge text-bg-secondary fs-6 text-uppercase">Free</span>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="registration_attendee_details" inherit_id="website_event.registration_attendee_details">
|
||||
<!-- Change 'continue' button to use the website login settings -->
|
||||
<xpath expr="//div[hasclass('modal-footer')]//button[hasclass('btn-primary')]" position="replace">
|
||||
<t t-if="availability_check and limit_check">
|
||||
<t t-set="has_paying_ticket" t-value="any(ticket.get('price', 0) > 0 for ticket in tickets)"/>
|
||||
<button t-if="website.account_on_checkout == 'mandatory' and website.is_public_user() and has_paying_ticket" class="btn btn-primary" type="submit">
|
||||
<span>Sign In</span>
|
||||
<span class="fa fa-sign-in"/>
|
||||
</button>
|
||||
<button t-else="" type="submit" class="btn btn-primary">
|
||||
<span t-if="has_paying_ticket">Go to Payment</span>
|
||||
<span t-else="">Confirm Registration</span>
|
||||
</button>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="index_topbar" inherit_id="website_event.index_topbar">
|
||||
<xpath expr="//div[hasclass('o_wevent_search')]" position="before">
|
||||
<t t-call="website_sale.pricelist_list">
|
||||
<t t-set="_classes" t-valuef="d-none d-lg-inline me-2"/>
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- 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">
|
||||
|
|
@ -12,72 +20,98 @@
|
|||
</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"/>
|
||||
<template id="cart_summary_inherit_website_event_sale" inherit_id="website_sale.cart_summary_content">
|
||||
<xpath expr="//td[@name='website_sale_cart_summary_product_name']/span" position="after">
|
||||
<span t-if="line.event_slot_id" class="text-muted" t-out="line.event_slot_id.display_name"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="event_confirmation" inherit_id="website_sale.confirmation">
|
||||
<xpath expr="//div[@id='oe_structure_website_sale_confirmation_2']" position="inside">
|
||||
<div id="order_name" position="after">
|
||||
<t t-if="events">
|
||||
<section class="s_title pt40" data-snippet="s_title" data-name="Title">
|
||||
<div class="s_allow_columns container">
|
||||
<h4>
|
||||
We are looking forward to meeting you at the following <t t-if="len(events) == 1">event</t><t t-else="">events</t>:
|
||||
</h4>
|
||||
</div>
|
||||
</section>
|
||||
<section class="pb32 o_cc o_cc2 o_colored_level bg-transparent">
|
||||
<div class="s_nb_column_fixed s_col_no_bgcolor o_wevent_index" t-foreach="events" t-as="event">
|
||||
<div class="col-lg-12 card mt-3 mx-auto item pt16 pb16">
|
||||
<div class="row s_col_no_bgcolor g-0 align-items-center o_cc1">
|
||||
<div class="col-lg-4 align-self-stretch d-block o_wevent_events_list">
|
||||
<t t-call="website.record_cover">
|
||||
<t t-set="_record" t-value="event" />
|
||||
<div class="o_wevent_event_date position-absolute bg-white shadow-sm text-dark">
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'format': 'LLL'}" class="o_wevent_event_month" />
|
||||
<span t-field="event.with_context(tz=event.date_tz).date_begin" t-options="{'format': 'dd'}" class="o_wevent_event_day oe_hide_on_date_edit" />
|
||||
<section class="card" t-foreach="events" t-as="event">
|
||||
<t t-set="attendees" t-value="attendee_ids_per_event.get(event, [])"/>
|
||||
<div class="s_nb_column_fixed s_col_no_bgcolor o_wevent_index o_wevent_sale_event">
|
||||
<t t-set="opt_event_description_cover_top" t-value="is_view_active('website_event.opt_event_description_cover_top')"/>
|
||||
<t t-call="website.record_cover">
|
||||
<t t-set="_record" t-value="event"/>
|
||||
<t t-set="use_filters" t-value="True"/>
|
||||
<t t-set="use_size" t-value="True"/>
|
||||
<t t-set="use_text_align" t-value="True"/>
|
||||
<t t-set="additionnal_classes" t-value="'o_wevent_event_main_cover o_wevent_event_main_cover_top overflow-hidden h-auto'"/>
|
||||
|
||||
<a class="text-decoration-none" t-att-href="event.event_url or event.website_url">
|
||||
<div t-if="not event.is_multi_slots" t-attf-class="o_wevent_event_date position-absolute shadow-sm o_not_editable">
|
||||
<span t-out="event.date_begin" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'LLL'}" class="o_wevent_event_month"/>
|
||||
<span t-out="event.date_begin" t-options="{'widget': 'datetime', 'tz_name': event.date_tz, 'format': 'dd'}" class="o_wevent_event_day oe_hide_on_date_edit"/>
|
||||
</div>
|
||||
|
||||
<div class="container d-flex flex-grow-1 h-100 w-100">
|
||||
<div id="o_wevent_event_main_cover_content" class="d-flex flex-column align-items-baseline w-100 p-3">
|
||||
<span t-if="event.is_participating" class="badge text-bg-success o_wevent_badge">
|
||||
<i class="fa fa-check me-2" role="img"/>Registered
|
||||
</span>
|
||||
<div class="w-100 mt-auto">
|
||||
<h2 t-field="event.name" itemprop="name" placeholder="Event Title" class="mt-3"/>
|
||||
<p class="lead" t-field="event.subtitle" placeholder="Event Subtitle"/>
|
||||
</div>
|
||||
<small class="o_wevent_participating text-bg-success">
|
||||
<i class="fa fa-check me-2" />
|
||||
Registered
|
||||
</small>
|
||||
<small t-if="not event.website_published" class="o_wevent_unpublished text-bg-danger">
|
||||
<i class="fa fa-ban me-2" />
|
||||
Unpublished
|
||||
</small>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8 p-4">
|
||||
<h3 t-esc="event.name" />
|
||||
<a class="btn btn-primary mb-2" t-attf-href="/event/#{ slug(event) }">Go to Event</a>
|
||||
</a>
|
||||
</t>
|
||||
<t t-set="event_attendees" t-value="attendee_ids_per_event.get(event, [])"/>
|
||||
<div t-if="event_attendees or not event.is_multi_slots" class="m-3">
|
||||
<t t-if="event_attendees and not event.is_multi_slots">
|
||||
<t t-call="website_event.registration_ticket_access">
|
||||
<t t-set="attendees" t-value="event_attendees"/>
|
||||
</t>
|
||||
</t>
|
||||
<div t-elif="event_attendees" t-foreach="event_attendees" t-as="slot" class="mb-4">
|
||||
<div t-attf-class="d-flex flex-column flex-md-row justify-content-between mt-2">
|
||||
<div class="mb-3">
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<b>Start</b>
|
||||
</div>
|
||||
<div class="col-auto ps-0">
|
||||
<span t-out="slot.start_datetime"
|
||||
t-options='{"widget": "datetime", "show_seconds": False, "tz_name": event.date_tz, "format": "medium"}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<b>End</b>
|
||||
</div>
|
||||
<div class="col-auto ps-0">
|
||||
<span t-out="slot.end_datetime"
|
||||
t-options='{"widget": "datetime", "show_seconds": False, "tz_name": event.date_tz, "format": "medium"}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span t-if="website_visitor_timezone != event.date_tz" class="small">(<t t-out="event.date_tz"/>)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div t-if="event_attendees[slot]">
|
||||
<t t-call="website_event.registration_ticket_access" attendees="event_attendees[slot]"/>
|
||||
</div>
|
||||
</div>
|
||||
<t t-call="website_event.event_calendar_links">
|
||||
<t t-set="iCal_url" t-value="urls_per_event.get(event.id, {}).get(slot.id, {}).get('iCal_url', '')"/>
|
||||
<t t-set="google_url" t-value="urls_per_event.get(event.id, {}).get(slot.id, {}).get('google_url', '')"/>
|
||||
</t>
|
||||
</div>
|
||||
<div t-if="not event.is_multi_slots" class="row my-3">
|
||||
<t t-call="website_event.event_calendar_links">
|
||||
<t t-set="iCal_url" t-value="urls_per_event.get(event.id, {}).get('iCal_url', '')"/>
|
||||
<t t-set="google_url" t-value="urls_per_event.get(event.id, {}).get('google_url', '')"/>
|
||||
</t>
|
||||
</div>
|
||||
<t t-call="website_event.event_confirmation_end_page_hook"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</t>
|
||||
</xpath>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue