From 67e3e32dd67299af91065be6519c077acdedab9b Mon Sep 17 00:00:00 2001 From: mbauskar Date: Wed, 22 Mar 2017 16:14:43 +0530 Subject: [PATCH] [minor] fixed shipping and billing address issue in cart --- erpnext/shopping_cart/cart.py | 8 ++++++-- erpnext/templates/includes/cart/cart_address.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index b427b94066..61ec78c651 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 29d4f4b606..d83f6092a1 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 %}