forked from alaguraj/odoo-testing-addons
add delivery/pickup toggle to checkout, customize address form, and update docker container configurations
This commit is contained in:
parent
808ade4636
commit
6d67ae9f47
@ -379,6 +379,39 @@
|
||||
<xpath expr="//t[@groups='account.group_delivery_invoice_address']" position="replace"/>
|
||||
</template>
|
||||
|
||||
<!-- 2. CART SUMMARY OVERRIDES FOR UBER -->
|
||||
<!-- Hide Uber fee from the list of items in the sidebar summary -->
|
||||
<template id="chennora_cart_summary_uber_hide" inherit_id="website_sale.cart_summary" name="Chennora Cart Summary Uber Hide">
|
||||
<xpath expr="//table[.//div[@name='website_sale_cart_summary_line_name']]" position="attributes">
|
||||
<attribute name="t-if">website_sale_order and website_sale_order.website_order_line</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tr[contains(@class, 'o_wsale_cart_summary_line') or .//div[@name='website_sale_cart_summary_line_name']]" position="attributes">
|
||||
<attribute name="t-if">line.product_id.name != 'Uber Delivery Fee'</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Display Uber fee in the 'Delivery' row of the total summary -->
|
||||
<template id="chennora_total_uber_display" inherit_id="website_sale.total" name="Chennora Total Uber Display">
|
||||
<!-- Intercept Subtotal to subtract Uber fee if it was included -->
|
||||
<xpath expr="//tr[@id='order_total_untaxed']//span[@t-field='website_sale_order.amount_untaxed']" position="replace">
|
||||
<t t-set="uber_line" t-value="website_sale_order.order_line.filtered(lambda l: l.product_id.name == 'Uber Delivery Fee')"/>
|
||||
<t t-set="uber_fee" t-value="sum(uber_line.mapped('price_subtotal')) if uber_line else 0.0"/>
|
||||
<span t-esc="website_sale_order.amount_untaxed - uber_fee" t-options='{"widget": "monetary", "display_currency": website_sale_order.currency_id}' class="monetary_field"/>
|
||||
</xpath>
|
||||
|
||||
<!-- Add/Update Delivery Row -->
|
||||
<xpath expr="//tr[@id='order_total_untaxed']" position="after">
|
||||
<t t-set="uber_line" t-value="website_sale_order.order_line.filtered(lambda l: l.product_id.name == 'Uber Delivery Fee')"/>
|
||||
<tr t-if="uber_line">
|
||||
<td class="border-0 pb-2 ps-0 pt-0 text-start text-muted" colspan="2">Delivery</td>
|
||||
<td class="text-end border-0 pb-2 pe-0 pt-0">
|
||||
<span t-field="uber_line[0].price_subtotal" t-options='{"widget": "monetary", "display_currency": website_sale_order.currency_id}' class="monetary_field"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
<!-- Custom Wizard - Rename Shipping step to Billing safely without python errors -->
|
||||
<template id="chennora_wizard_checkout_custom" inherit_id="website_sale.wizard_checkout" name="Chennora Wizard Custom" priority="99">
|
||||
<xpath expr="//*[@t-call='website.step_wizard']" position="after">
|
||||
|
||||
@ -18,6 +18,5 @@ class SaleOrder(models.Model):
|
||||
'name': fee_product.name,
|
||||
'price_unit': amount,
|
||||
'product_uom_qty': 1,
|
||||
'is_delivery': True, # Mark as delivery line if possible
|
||||
})]})
|
||||
return True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user