mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-21 10:26:30 +00:00
fix: change shipping address fetching condition
(cherry picked from commit 0b4add2f2b)
This commit is contained in:
@@ -931,12 +931,16 @@ def get_party_shipping_address(doctype: str, name: str) -> str | None:
|
|||||||
["is_shipping_address", "=", 1],
|
["is_shipping_address", "=", 1],
|
||||||
["address_type", "=", "Shipping"],
|
["address_type", "=", "Shipping"],
|
||||||
],
|
],
|
||||||
pluck="name",
|
fields=["name", "is_shipping_address"],
|
||||||
limit=1,
|
|
||||||
order_by="is_shipping_address DESC",
|
order_by="is_shipping_address DESC",
|
||||||
)
|
)
|
||||||
|
|
||||||
return shipping_addresses[0] if shipping_addresses else None
|
if shipping_addresses and shipping_addresses[0].is_shipping_address == 1:
|
||||||
|
return shipping_addresses[0].name
|
||||||
|
if len(shipping_addresses) == 1:
|
||||||
|
return shipping_addresses[0].name
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_partywise_advanced_payment_amount(
|
def get_partywise_advanced_payment_amount(
|
||||||
|
|||||||
Reference in New Issue
Block a user