forked from alaguraj/odoo-testing-addons
Customize checkout address form by removing company/VAT, renaming zip, and adding a delivery/pickup toggle with dynamic address field management.
This commit is contained in:
parent
7ba83d0d15
commit
614a2641f3
@ -218,8 +218,21 @@
|
||||
|
||||
<!-- Change Billing & Shipping Label on Payment Page -->
|
||||
<template id="chennora_address_on_payment_custom" inherit_id="website_sale.address_on_payment" name="Chennora Address Label Custom" priority="99">
|
||||
<xpath expr="//div[@id='shipping_and_billing']//b[contains(., 'Billing')]" position="replace">
|
||||
<b>Billing: </b>
|
||||
<!-- Customize address display for Pickup orders -->
|
||||
<xpath expr="//div[@id='shipping_and_billing']" position="replace">
|
||||
<div id="shipping_and_billing" class="mt-4">
|
||||
<div>
|
||||
<b t-if="not order.partner_id.street == 'In-Store Pickup'">Billing: </b>
|
||||
<b t-else="">Customer: </b>
|
||||
|
||||
<t t-if="order.partner_id.street == 'In-Store Pickup'">
|
||||
<span t-out="order.partner_id" t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<span t-out="order.partner_id" t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@ -253,4 +266,12 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Custom Address Kanban - Hide address for Pickup in the cards -->
|
||||
<template id="chennora_address_kanban_custom" inherit_id="website_sale.address_kanban" name="Chennora Address Kanban Custom" priority="99">
|
||||
<xpath expr="//*[@t-options]" position="attributes">
|
||||
<attribute name="t-options">
|
||||
{'widget': 'contact', 'fields': contact.street == 'In-Store Pickup' and ['name', 'phone'] or ['address', 'name', 'phone'], 'no_marker': True}
|
||||
</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
26
check_pos.py
Normal file
26
check_pos.py
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
from odoo.api import Environment
|
||||
|
||||
def check_pos_online():
|
||||
# Attempt to find Cheese Burger
|
||||
burger = env['product.template'].search([('name', 'ilike', 'Cheese Burger')], limit=1)
|
||||
if burger:
|
||||
print(f"PRODUCT_FOUND: {burger.name}, is_kitchen_item: {burger.is_kitchen_item}")
|
||||
else:
|
||||
print("PRODUCT_NOT_FOUND")
|
||||
|
||||
config = env['pos.config'].search([('module_pos_restaurant', '=', True), ('active', '=', True)], limit=1)
|
||||
if config:
|
||||
session = env['pos.session'].search([('config_id', '=', config.id), ('state', '=', 'opened')], limit=1)
|
||||
print(f"CONFIG_FOUND: {config.name}, OPEN_SESSION: {session.id if session else 'NONE'}")
|
||||
else:
|
||||
print("REST_CONFIG_NOT_FOUND")
|
||||
|
||||
online_orders = env['pos.order'].search([('is_online_order', '=', True)])
|
||||
print(f"ONLINE_ORDERS_COUNT: {len(online_orders)}")
|
||||
|
||||
pending_online = env['pos.order'].search([('is_online_order', '=', True), ('online_order_status', '=', 'pending')])
|
||||
print(f"PENDING_ONLINE_ORDERS: {len(pending_online)}")
|
||||
|
||||
check_pos_online()
|
||||
17
check_pos_config.py
Normal file
17
check_pos_config.py
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
from odoo.api import Environment
|
||||
|
||||
def check_pos_config():
|
||||
config = env['pos.config'].browse(2)
|
||||
if config:
|
||||
print(f"CONFIG: {config.name}")
|
||||
print(f"RESTAURANT: {config.module_pos_restaurant}")
|
||||
print(f"EPOS_PRINTER: {config.iface_print_skip_screen}")
|
||||
print(f"KDS_GROUPS: {len(config.printer_ids)}")
|
||||
for printer in config.printer_ids:
|
||||
print(f" - PRINTER: {printer.name}, TYPE: {printer.printer_type}")
|
||||
else:
|
||||
print("CONFIG_2_NOT_FOUND")
|
||||
|
||||
check_pos_config()
|
||||
Loading…
x
Reference in New Issue
Block a user