implement unified checkout address UI with fulfillment selection and custom validation logic

This commit is contained in:
Alaguraj0361 2026-04-09 17:56:25 +05:30
parent f3999ef122
commit 2a6f31faf0
2 changed files with 18 additions and 1 deletions

View File

@ -423,4 +423,16 @@
</script>
</xpath>
</template>
<!-- 5. FINAL POLISH: Hide Shipping Info using CSS (Safest method) -->
<template id="chennora_hide_shipping_on_payment" inherit_id="website.layout" name="Chennora Hide Shipping on Payment">
<xpath expr="." position="inside">
<style>
/* Hide any row or div that contains shipping info in the checkout */
.js_shipping, .shipping_address, #shipping_and_billing {
display: none !important;
}
</style>
</xpath>
</template>
</odoo>

View File

@ -12,7 +12,12 @@ class SaleOrder(models.Model):
# 1. Ensure fulfillment type is set
if hasattr(self, 'fulfilment_type'):
self.write({'fulfilment_type': 'delivery'})
self.write({
'fulfilment_type': 'delivery',
'partner_shipping_id': self.partner_id.id
})
else:
self.write({'partner_shipping_id': self.partner_id.id})
# 2. Find or Create the Uber Delivery carrier
Carrier = self.env['delivery.carrier'].sudo()