diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index b427b940666..61ec78c6516 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -31,10 +31,14 @@ def get_cart_quotation(doc=None): doc = quotation set_cart_count(quotation) + addresses = get_address_docs(party=party) + return { "doc": decorate_quotation_doc(doc), - "addresses": [{"name": address.name, "display": address.display} - for address in get_address_docs(party=party)], + "shipping_addresses": [{"name": address.name, "display": address.display} + for address in addresses if address.address_type == "Shipping"], + "billing_addresses": [{"name": address.name, "display": address.display} + for address in addresses if address.address_type == "Billing"], "shipping_rules": get_applicable_shipping_rules(party) } diff --git a/erpnext/templates/includes/cart/cart_address.html b/erpnext/templates/includes/cart/cart_address.html index 29d4f4b6065..d83f6092a11 100644 --- a/erpnext/templates/includes/cart/cart_address.html +++ b/erpnext/templates/includes/cart/cart_address.html @@ -7,7 +7,7 @@
{{ _("Shipping Address") }}
- {% for address in addresses %} + {% for address in shipping_addresses %} {{ show_address(address, doc, "shipping_address_name", select_address) }} {% endfor %}
@@ -18,7 +18,7 @@
Billing Address
- {% for address in addresses %} + {% for address in billing_addresses %} {{ show_address(address, doc, "customer_address", select_address) }} {% endfor %}