cosmetic
This commit is contained in:
parent
f5a689bcc8
commit
c308d538a3
3 changed files with 217 additions and 419 deletions
2
.github/copilot-instructions.md
vendored
2
.github/copilot-instructions.md
vendored
|
|
@ -83,7 +83,7 @@ Este repositorio contiene addons personalizados y modificados de Odoo 18.0. El p
|
|||
Pedir al usuario generar a través de UI, no sabemos el método correcto para exportar SÓLO las cadenas del addon sin incluir todo el sistema.
|
||||
```
|
||||
|
||||
Usar sólo polib para trataer los archivos .po, msmerge corrompe los archivos.
|
||||
Usar sólo polib y apend cadenas en los archivos .po, msmerge corrompe los archivos.
|
||||
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"summary": "Add default price category to suppliers and bulk update products",
|
||||
"author": "Odoo Community Association (OCA), Criptomart",
|
||||
"license": "AGPL-3",
|
||||
"website": "https://git.criptomart.net/criptomart/addons-cm",
|
||||
"depends": ["product_price_category", "sales_team", "product_main_seller"],
|
||||
"data": [
|
||||
"security/ir.model.access.csv",
|
||||
|
|
|
|||
|
|
@ -2,32 +2,22 @@
|
|||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- Template: Group Orders Page (Eskaera) -->
|
||||
<template id="eskaera_page" name="Eskaera Page">
|
||||
<t t-call="website.layout">
|
||||
<div
|
||||
id="wrap"
|
||||
class="eskaera-page oe_structure oe_empty"
|
||||
data-name="Eskaera Orders"
|
||||
>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1>Available Orders</h1>
|
||||
<p
|
||||
class="text-muted"
|
||||
role="status"
|
||||
>Browse and select an order to view its products.</p>
|
||||
<!-- Template: Group Orders Page (Eskaera) -->
|
||||
<template id="eskaera_page" name="Eskaera Page">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap" class="eskaera-page oe_structure oe_empty" data-name="Eskaera Orders">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1>Available Orders</h1>
|
||||
<p class="text-muted" role="status">Browse and select an order to view its products.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-lg-12">
|
||||
<!-- Editable area: Above orders list -->
|
||||
<div
|
||||
class="oe_structure oe_empty"
|
||||
data-name="Before Orders"
|
||||
/>
|
||||
<!-- Editable area: Above orders list -->
|
||||
<div class="oe_structure oe_empty" data-name="Before Orders" />
|
||||
|
||||
<t t-if="active_orders">
|
||||
<div
|
||||
|
|
@ -315,18 +305,13 @@
|
|||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="eskaera-empty-state">
|
||||
<div
|
||||
class="alert alert-info"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
<p
|
||||
>No group orders available this week.</p>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="eskaera-empty-state">
|
||||
<div class="alert alert-info" role="status" aria-live="polite">
|
||||
<p>No group orders available this week.</p>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<!-- Editable area: Below orders list -->
|
||||
<div
|
||||
|
|
@ -379,89 +364,58 @@
|
|||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Small QWeb snippets used to render translated confirmation strings
|
||||
Rendered via ir.ui.view._render_template() with lang in context
|
||||
to ensure server-side translation regardless of call stack. -->
|
||||
<template id="confirm_message_snippet" name="Confirm Message Snippet">
|
||||
<t t-esc="_('Thank you! Your order has been confirmed.')" />
|
||||
</template>
|
||||
<!-- Small QWeb snippets used to render translated confirmation strings
|
||||
Rendered via ir.ui.view._render_template() with lang in context
|
||||
to ensure server-side translation regardless of call stack. -->
|
||||
<template id="confirm_message_snippet" name="Confirm Message Snippet">
|
||||
<t t-esc="_('Thank you! Your order has been confirmed.')" />
|
||||
</template>
|
||||
|
||||
<template
|
||||
id="confirm_pickup_label_snippet"
|
||||
name="Confirm Pickup Label Snippet"
|
||||
>
|
||||
<t t-esc="_('Pickup Day')" />
|
||||
</template>
|
||||
<template id="confirm_pickup_label_snippet" name="Confirm Pickup Label Snippet">
|
||||
<t t-esc="_('Pickup Day')" />
|
||||
</template>
|
||||
|
||||
<!-- Shared template: Order Header -->
|
||||
<template id="order_header" name="Order Header">
|
||||
<div t-att-class="header_class or 'eskaera-order-header'">
|
||||
<div class="d-flex gap-5 align-items-center mb-4">
|
||||
<t
|
||||
t-set="image_to_show"
|
||||
t-value="group_order.image or (group_order.group_ids[0].image_1920 if group_order.group_ids else False)"
|
||||
/>
|
||||
<t t-if="image_to_show">
|
||||
<img
|
||||
t-att-src="image_data_uri(image_to_show)"
|
||||
alt="Order image"
|
||||
class="order-thumbnail-md"
|
||||
/>
|
||||
</t>
|
||||
<div class="flex-grow-1">
|
||||
<h1 class="mb-2"><t
|
||||
t-esc="header_title or group_order.name"
|
||||
/></h1>
|
||||
<t t-if="group_order.description">
|
||||
<p class="text-muted mb-0 order-desc-full"><t
|
||||
t-esc="group_order.description"
|
||||
/></p>
|
||||
</t>
|
||||
<!-- Shared template: Order Header -->
|
||||
<template id="order_header" name="Order Header">
|
||||
<div t-att-class="header_class or 'eskaera-order-header'">
|
||||
<div class="d-flex gap-5 align-items-center mb-4">
|
||||
<t t-set="image_to_show" t-value="group_order.image or (group_order.group_ids[0].image_1920 if group_order.group_ids else False)" />
|
||||
<t t-if="image_to_show">
|
||||
<img t-att-src="image_data_uri(image_to_show)" alt="Order image" class="order-thumbnail-md" />
|
||||
</t>
|
||||
<div class="flex-grow-1">
|
||||
<h1 class="mb-2"><t t-esc="header_title or group_order.name" /></h1>
|
||||
<t t-if="group_order.description">
|
||||
<p class="text-muted mb-0 order-desc-full"><t t-esc="group_order.description" /></p>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Template: Group Order Shop (Eskaera) -->
|
||||
<template id="eskaera_shop" name="Eskaera Shop">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap" class="eskaera-shop-page oe_structure oe_empty" data-name="Eskaera Shop">
|
||||
<div class="container">
|
||||
<!-- Order Header Info Panel -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-lg-12">
|
||||
<t t-call="website_sale_aplicoop.order_header">
|
||||
<t t-set="header_class" t-value="'eskaera-order-header'" />
|
||||
</t>
|
||||
<div class="eskaera-order-header">
|
||||
<div class="order-info-grid">
|
||||
<div class="info-item">
|
||||
<span t-att-class="'info-label'">Consumer Groups</span>
|
||||
<span class="info-value"><t t-esc="', '.join(group_order.group_ids.mapped('name'))" /></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Template: Group Order Shop (Eskaera) -->
|
||||
<template id="eskaera_shop" name="Eskaera Shop">
|
||||
<t t-call="website.layout">
|
||||
<div
|
||||
id="wrap"
|
||||
class="eskaera-shop-page oe_structure oe_empty"
|
||||
data-name="Eskaera Shop"
|
||||
>
|
||||
<div class="container">
|
||||
<!-- Order Header Info Panel -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-lg-12">
|
||||
<t t-call="website_sale_aplicoop.order_header">
|
||||
<t
|
||||
t-set="header_class"
|
||||
t-value="'eskaera-order-header'"
|
||||
/>
|
||||
</t>
|
||||
<div class="eskaera-order-header">
|
||||
<div class="order-info-grid">
|
||||
<div class="info-item">
|
||||
<span
|
||||
t-att-class="'info-label'"
|
||||
>Consumer Groups</span>
|
||||
<span class="info-value"><t
|
||||
t-esc="', '.join(group_order.group_ids.mapped('name'))"
|
||||
/></span>
|
||||
</div>
|
||||
<t t-if="group_order.cutoff_day">
|
||||
<div class="info-item">
|
||||
<span
|
||||
t-att-class="'info-label'"
|
||||
>Cutoff Day</span>
|
||||
<span class="info-value"><t
|
||||
t-esc="day_names[int(group_order.cutoff_day) % 7]"
|
||||
/> (<t
|
||||
t-esc="group_order.cutoff_date.strftime('%d/%m/%Y')"
|
||||
/>)</span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="group_order.cutoff_day">
|
||||
<div class="info-item">
|
||||
<span t-att-class="'info-label'">Cutoff Day</span>
|
||||
<span class="info-value"><t t-esc="day_names[int(group_order.cutoff_day) % 7]" /> (<t t-esc="group_order.cutoff_date.strftime('%d/%m/%Y')" />)</span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="group_order.pickup_day">
|
||||
<div class="info-item">
|
||||
<span
|
||||
|
|
@ -516,38 +470,21 @@
|
|||
<!-- Search and Filter Bar (Full Width, Above Products/Cart) -->
|
||||
<div class="mb-3" id="realtimeSearch-filters">
|
||||
<div class="row g-2">
|
||||
<div class="col-md-7">
|
||||
<!-- CRITICAL: This input is NOT inside a form to prevent Odoo from transforming it -->
|
||||
<!-- It must remain a pure HTML input element for realtime_search.js to detect value changes -->
|
||||
<input
|
||||
type="text"
|
||||
id="realtime-search-input"
|
||||
class="form-control realtime-search-box search-input-styled"
|
||||
placeholder="Search products..."
|
||||
autocomplete="off"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<select
|
||||
name="category"
|
||||
id="realtime-category-select"
|
||||
class="form-select"
|
||||
>
|
||||
<option
|
||||
value=""
|
||||
>Browse Product Categories</option>
|
||||
<!-- Macro para renderizar categorías recursivamente -->
|
||||
<t
|
||||
t-call="website_sale_aplicoop.category_hierarchy_options"
|
||||
>
|
||||
<t
|
||||
t-set="categories"
|
||||
t-value="category_hierarchy"
|
||||
/>
|
||||
<t t-set="depth" t-value="0" />
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<!-- CRITICAL: This input is NOT inside a form to prevent Odoo from transforming it -->
|
||||
<!-- It must remain a pure HTML input element for realtime_search.js to detect value changes -->
|
||||
<input type="text" id="realtime-search-input" class="form-control realtime-search-box search-input-styled" placeholder="Search products..." autocomplete="off" />
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<select name="category" id="realtime-category-select" class="form-select">
|
||||
<option value="">Browse Product Categories</option>
|
||||
<!-- Macro para renderizar categorías recursivamente -->
|
||||
<t t-call="website_sale_aplicoop.category_hierarchy_options">
|
||||
<t t-set="categories" t-value="category_hierarchy" />
|
||||
<t t-set="depth" t-value="0" />
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<t t-if="available_tags">
|
||||
<div class="row mt-3">
|
||||
|
|
@ -606,11 +543,8 @@
|
|||
<div class="row g-2">
|
||||
<!-- Products Column -->
|
||||
<div class="col-lg-9">
|
||||
<!-- Editable area: Above search/filter -->
|
||||
<div
|
||||
class="oe_structure oe_empty"
|
||||
data-name="Before Products Filter"
|
||||
/>
|
||||
<!-- Editable area: Above search/filter -->
|
||||
<div class="oe_structure oe_empty" data-name="Before Products Filter" />
|
||||
|
||||
<t t-if="products">
|
||||
<div class="products-grid">
|
||||
|
|
@ -826,15 +760,11 @@
|
|||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div
|
||||
class="alert alert-warning"
|
||||
role="status"
|
||||
aria-live="polite"
|
||||
>
|
||||
<p>No products available in this order.</p>
|
||||
</div>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div class="alert alert-warning" role="status" aria-live="polite">
|
||||
<p>No products available in this order.</p>
|
||||
</div>
|
||||
</t>
|
||||
<!-- Editable area: Below products list -->
|
||||
<div
|
||||
class="oe_structure oe_empty mt-4"
|
||||
|
|
@ -851,26 +781,11 @@
|
|||
<div
|
||||
class="card-header d-flex justify-content-between align-items-center gap-1"
|
||||
>
|
||||
<h6
|
||||
class="mb-0 cart-title-sm"
|
||||
id="cart-title"
|
||||
>My Cart</h6>
|
||||
<div
|
||||
class="btn-group cart-btn-group gap-0"
|
||||
role="group"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary cart-btn-compact"
|
||||
id="save-cart-btn"
|
||||
t-attf-data-order-id="{{ group_order.id }}"
|
||||
data-bs-title="Save Cart"
|
||||
data-bs-toggle="tooltip"
|
||||
>
|
||||
<i
|
||||
class="fa fa-save cart-icon-size"
|
||||
/>
|
||||
</button>
|
||||
<h6 class="mb-0 cart-title-sm" id="cart-title">My Cart</h6>
|
||||
<div class="btn-group cart-btn-group gap-0" role="group">
|
||||
<button type="button" class="btn btn-primary cart-btn-compact" id="save-cart-btn" t-attf-data-order-id="{{ group_order.id }}" data-bs-title="Save Cart" data-bs-toggle="tooltip">
|
||||
<i class="fa fa-save cart-icon-size" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-info cart-btn-compact"
|
||||
|
|
@ -897,63 +812,31 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="card-body cart-body-lg"
|
||||
id="cart-items-container"
|
||||
t-attf-data-order-id="{{ group_order.id }}"
|
||||
aria-labelledby="cart-title"
|
||||
aria-live="polite"
|
||||
aria-relevant="additions removals"
|
||||
>
|
||||
<p class="text-muted">
|
||||
This order's cart is empty
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer bg-white text-center">
|
||||
<a
|
||||
t-attf-href="/eskaera/{{ group_order.id }}/checkout"
|
||||
class="btn btn-success checkout-btn-lg"
|
||||
data-bs-title="Proceed to Checkout"
|
||||
data-bs-toggle="tooltip"
|
||||
>
|
||||
Proceed to Checkout
|
||||
</a>
|
||||
</div>
|
||||
<div class="card-body cart-body-lg" id="cart-items-container" t-attf-data-order-id="{{ group_order.id }}" aria-labelledby="cart-title" aria-live="polite" aria-relevant="additions removals">
|
||||
<p class="text-muted">This order's cart is empty</p>
|
||||
</div>
|
||||
<div class="card-footer bg-white text-center">
|
||||
<a t-attf-href="/eskaera/{{ group_order.id }}/checkout" class="btn btn-success checkout-btn-lg" data-bs-title="Proceed to Checkout" data-bs-toggle="tooltip">
|
||||
Proceed to Checkout
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/i18n_manager.js"
|
||||
/>
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/i18n_helpers.js"
|
||||
/>
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/website_sale.js"
|
||||
/>
|
||||
<!-- UI enhancements -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/checkout_labels.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/home_delivery.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/realtime_search.js"
|
||||
/>
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_manager.js" />
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_helpers.js" />
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/website_sale.js" />
|
||||
<!-- UI enhancements -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/checkout_labels.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/home_delivery.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/realtime_search.js" />
|
||||
|
||||
<!-- Initialize tooltips using native title attribute -->
|
||||
<script type="text/javascript">
|
||||
|
|
@ -993,77 +876,51 @@
|
|||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Sub-template: Checkout Order Summary Table with Translations -->
|
||||
<template id="eskaera_checkout_summary" name="Checkout Order Summary">
|
||||
<div class="checkout-summary-container">
|
||||
<table
|
||||
class="table table-hover checkout-summary-table"
|
||||
id="checkout-summary-table"
|
||||
>
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th class="col-name">Product</th>
|
||||
<th class="col-qty text-center">Quantity</th>
|
||||
<th class="col-price text-right">Price</th>
|
||||
<th class="col-subtotal text-right">Subtotal</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="checkout-summary-tbody">
|
||||
<tr id="checkout-empty-row" class="empty-message">
|
||||
<td colspan="4" class="text-center text-muted py-4">
|
||||
<i class="fa fa-inbox fa-2x mb-2" />
|
||||
<p>This order's cart is empty</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="checkout-total-section">
|
||||
<div class="total-row">
|
||||
<span class="total-label">Total</span>:
|
||||
<span
|
||||
class="total-amount"
|
||||
id="checkout-total-amount"
|
||||
>0.00</span>
|
||||
<span class="currency">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!-- Sub-template: Checkout Order Summary Table with Translations -->
|
||||
<template id="eskaera_checkout_summary" name="Checkout Order Summary">
|
||||
<div class="checkout-summary-container">
|
||||
<table class="table table-hover checkout-summary-table" id="checkout-summary-table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th class="col-name">Product</th>
|
||||
<th class="col-qty text-center">Quantity</th>
|
||||
<th class="col-price text-right">Price</th>
|
||||
<th class="col-subtotal text-right">Subtotal</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="checkout-summary-tbody">
|
||||
<tr id="checkout-empty-row" class="empty-message">
|
||||
<td colspan="4" class="text-center text-muted py-4">
|
||||
<i class="fa fa-inbox fa-2x mb-2" />
|
||||
<p>This order's cart is empty</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="checkout-total-section">
|
||||
<div class="total-row">
|
||||
<span class="total-label">Total</span>:
|
||||
<span class="total-amount" id="checkout-total-amount">0.00</span>
|
||||
<span class="currency">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Template: Group Order Checkout (Eskaera) -->
|
||||
<template id="eskaera_checkout" name="Eskaera Checkout">
|
||||
<t t-call="website.layout">
|
||||
<div
|
||||
id="wrap"
|
||||
class="eskaera-checkout-page oe_structure oe_empty"
|
||||
data-name="Eskaera Checkout"
|
||||
t-attf-data-delivery-product-id="{{ delivery_product_id }}"
|
||||
t-attf-data-delivery-product-name="{{ delivery_product_name }}"
|
||||
t-attf-data-delivery-product-price="{{ delivery_product_price }}"
|
||||
t-attf-data-home-delivery-enabled="{{ 'true' if group_order.home_delivery else 'false' }}"
|
||||
t-attf-data-pickup-day="{{ group_order.pickup_day }}"
|
||||
t-attf-data-pickup-date="{{ group_order.pickup_date.strftime('%d/%m/%Y') if group_order.pickup_date else '' }}"
|
||||
t-attf-data-delivery-notice="{{ (group_order.delivery_notice or '').replace(chr(10), ' ').replace(chr(13), ' ') }}"
|
||||
>
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<!-- Header Section -->
|
||||
<div class="mb-4">
|
||||
<t
|
||||
t-call="website_sale_aplicoop.order_header"
|
||||
>
|
||||
<t
|
||||
t-set="header_class"
|
||||
t-value="'checkout-header'"
|
||||
/>
|
||||
<t
|
||||
t-set="header_title"
|
||||
>Confirm Order: <t
|
||||
t-esc="group_order.name"
|
||||
/></t>
|
||||
</t>
|
||||
</div>
|
||||
<!-- Template: Group Order Checkout (Eskaera) -->
|
||||
<template id="eskaera_checkout" name="Eskaera Checkout">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap" class="eskaera-checkout-page oe_structure oe_empty" data-name="Eskaera Checkout" t-attf-data-delivery-product-id="{{ delivery_product_id }}" t-attf-data-delivery-product-name="{{ delivery_product_name }}" t-attf-data-delivery-product-price="{{ delivery_product_price }}" t-attf-data-home-delivery-enabled="{{ 'true' if group_order.home_delivery else 'false' }}" t-attf-data-pickup-day="{{ group_order.pickup_day }}" t-attf-data-pickup-date="{{ group_order.pickup_date.strftime('%d/%m/%Y') if group_order.pickup_date else '' }}" t-attf-data-delivery-notice="{{ (group_order.delivery_notice or '').replace(chr(10), ' ').replace(chr(13), ' ') }}">
|
||||
<div class="container mt-5">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 offset-lg-1">
|
||||
<!-- Header Section -->
|
||||
<div class="mb-4">
|
||||
<t t-call="website_sale_aplicoop.order_header">
|
||||
<t t-set="header_class" t-value="'checkout-header'" />
|
||||
<t t-set="header_title">Confirm Order: <t t-esc="group_order.name" /></t>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<!-- Order Info Card -->
|
||||
<div
|
||||
|
|
@ -1204,21 +1061,13 @@
|
|||
data-name="After Summary"
|
||||
/>
|
||||
|
||||
<!-- Home Delivery Checkbox -->
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body">
|
||||
<div class="form-check">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-check-input"
|
||||
id="home-delivery-checkbox"
|
||||
name="home_delivery"
|
||||
/>
|
||||
<label
|
||||
class="form-check-label fw-bold"
|
||||
for="home-delivery-checkbox"
|
||||
>Home Delivery</label>
|
||||
</div>
|
||||
<!-- Home Delivery Checkbox -->
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card-body">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="home-delivery-checkbox" name="home_delivery" />
|
||||
<label class="form-check-label fw-bold" for="home-delivery-checkbox">Home Delivery</label>
|
||||
</div>
|
||||
<div
|
||||
id="delivery-info-alert"
|
||||
class="alert alert-info mt-3 d-none"
|
||||
|
|
@ -1294,43 +1143,17 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div
|
||||
class="checkout-actions d-grid gap-3"
|
||||
id="checkout-form-labels"
|
||||
>
|
||||
<button
|
||||
class="btn btn-success btn-lg"
|
||||
id="confirm-order-btn"
|
||||
t-attf-data-order-id="{{ group_order.id }}"
|
||||
data-confirmed-label="Order confirmed"
|
||||
data-pickup-label="Pickup Day"
|
||||
aria-label="Confirm and send order"
|
||||
data-bs-title="Confirm Order"
|
||||
data-bs-toggle="tooltip"
|
||||
>
|
||||
<i
|
||||
class="fa fa-check-circle"
|
||||
aria-hidden="true"
|
||||
t-translation="off"
|
||||
/>
|
||||
<span>Confirm Order</span>
|
||||
</button>
|
||||
<a
|
||||
t-attf-href="/eskaera/{{ group_order.id }}"
|
||||
class="btn btn-outline-secondary btn-lg"
|
||||
aria-label="Back to cart page"
|
||||
data-bs-title="Back to Cart"
|
||||
data-bs-toggle="tooltip"
|
||||
>
|
||||
<i
|
||||
class="fa fa-arrow-left"
|
||||
aria-hidden="true"
|
||||
t-translation="off"
|
||||
/>
|
||||
<span>Back to Cart</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Action Buttons -->
|
||||
<div class="checkout-actions d-grid gap-3" id="checkout-form-labels">
|
||||
<button class="btn btn-success btn-lg" id="confirm-order-btn" t-attf-data-order-id="{{ group_order.id }}" data-confirmed-label="Order confirmed" data-pickup-label="Pickup Day" aria-label="Confirm and send order" data-bs-title="Confirm Order" data-bs-toggle="tooltip">
|
||||
<i class="fa fa-check-circle" aria-hidden="true" t-translation="off" />
|
||||
<span>Confirm Order</span>
|
||||
</button>
|
||||
<a t-attf-href="/eskaera/{{ group_order.id }}" class="btn btn-outline-secondary btn-lg" aria-label="Back to cart page" data-bs-title="Back to Cart" data-bs-toggle="tooltip">
|
||||
<i class="fa fa-arrow-left" aria-hidden="true" t-translation="off" />
|
||||
<span>Back to Cart</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1348,35 +1171,17 @@
|
|||
console.log('[LABELS] Initialized from server:', window.groupOrderShop.labels);
|
||||
})();
|
||||
</script>
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/i18n_manager.js"
|
||||
/>
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/i18n_helpers.js"
|
||||
/>
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/website_sale.js"
|
||||
/>
|
||||
<!-- UI enhancements -->
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/checkout_labels.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/home_delivery.js"
|
||||
/>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="/website_sale_aplicoop/static/src/js/checkout_summary.js"
|
||||
/>
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_manager.js" />
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_helpers.js" />
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/website_sale.js" />
|
||||
<!-- UI enhancements -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/checkout_labels.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/home_delivery.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/checkout_summary.js" />
|
||||
<script type="text/javascript">
|
||||
// Auto-load cart from localStorage when accessing checkout directly
|
||||
(function() {
|
||||
|
|
@ -1412,46 +1217,38 @@
|
|||
</t>
|
||||
</template>
|
||||
|
||||
<!-- Recursive macro to render category hierarchy for select dropdown -->
|
||||
<template
|
||||
id="category_hierarchy_options"
|
||||
name="Category Hierarchy Options"
|
||||
>
|
||||
<!--
|
||||
Macro para renderizar recursivamente la jerarquía de categorías.
|
||||
Todas las categorías son seleccionables, indentadas por profundidad.
|
||||
<!-- Recursive macro to render category hierarchy for select dropdown -->
|
||||
<template id="category_hierarchy_options" name="Category Hierarchy Options">
|
||||
<!--
|
||||
Macro para renderizar recursivamente la jerarquía de categorías.
|
||||
Todas las categorías son seleccionables, indentadas por profundidad.
|
||||
|
||||
Parámetros:
|
||||
- categories: lista de categorías a renderizar
|
||||
- depth: nivel de profundidad actual (para padding/indentación)
|
||||
-->
|
||||
<t t-foreach="categories" t-as="cat">
|
||||
<!-- Calcular padding basado en profundidad: 20px por nivel -->
|
||||
<t t-set="padding_px" t-value="depth * 20" />
|
||||
<!-- Crear prefijo visual con flechas según profundidad -->
|
||||
<t t-set="prefix">
|
||||
<t t-foreach="range(depth)" t-as="i">↳ </t>
|
||||
</t>
|
||||
Parámetros:
|
||||
- categories: lista de categorías a renderizar
|
||||
- depth: nivel de profundidad actual (para padding/indentación)
|
||||
-->
|
||||
<t t-foreach="categories" t-as="cat">
|
||||
<!-- Calcular padding basado en profundidad: 20px por nivel -->
|
||||
<t t-set="padding_px" t-value="depth * 20" />
|
||||
<!-- Crear prefijo visual con flechas según profundidad -->
|
||||
<t t-set="prefix">
|
||||
<t t-foreach="range(depth)" t-as="i">↳ </t>
|
||||
</t>
|
||||
|
||||
<!-- Renderizar como opción indentada y seleccionable -->
|
||||
<option
|
||||
t-att-value="str(cat['id'])"
|
||||
t-attf-style="padding-left: {{ padding_px }}px;"
|
||||
>
|
||||
<t t-esc="prefix" /><t t-esc="cat['name']" />
|
||||
</option>
|
||||
<!-- Renderizar como opción indentada y seleccionable -->
|
||||
<option t-att-value="str(cat['id'])" t-attf-style="padding-left: {{ padding_px }}px;">
|
||||
<t t-esc="prefix" /><t t-esc="cat['name']" />
|
||||
</option>
|
||||
|
||||
<!-- Renderizar hijos recursivamente si existen -->
|
||||
<t t-if="cat['children']">
|
||||
<t
|
||||
t-call="website_sale_aplicoop.category_hierarchy_options"
|
||||
>
|
||||
<t t-set="categories" t-value="cat['children']" />
|
||||
<t t-set="depth" t-value="depth + 1" />
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
<!-- Renderizar hijos recursivamente si existen -->
|
||||
<t t-if="cat['children']">
|
||||
<t t-call="website_sale_aplicoop.category_hierarchy_options">
|
||||
<t t-set="categories" t-value="cat['children']" />
|
||||
<t t-set="depth" t-value="depth + 1" />
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue