Patch fixed
This commit is contained in:
parent
11a746d363
commit
34fe81f7eb
@ -65,7 +65,7 @@ def execute():
|
|||||||
|
|
||||||
# Set party account if default currency of party other than company's default currency
|
# Set party account if default currency of party other than company's default currency
|
||||||
for dt in ("Customer", "Supplier"):
|
for dt in ("Customer", "Supplier"):
|
||||||
parties = frappe.get_all(dt, ["name", "default_currency"])
|
parties = frappe.get_all(dt)
|
||||||
for p in parties:
|
for p in parties:
|
||||||
# Get party GL Entries
|
# Get party GL Entries
|
||||||
party_gle = frappe.db.get_value("GL Entry", {"party_type": dt, "party": p.name,
|
party_gle = frappe.db.get_value("GL Entry", {"party_type": dt, "party": p.name,
|
||||||
@ -73,15 +73,13 @@ def execute():
|
|||||||
|
|
||||||
party = frappe.get_doc(dt, p.name)
|
party = frappe.get_doc(dt, p.name)
|
||||||
|
|
||||||
# set default currency and party account currency
|
# set party account currency
|
||||||
if not party.default_currency:
|
if party_gle or not party.party_account_currency:
|
||||||
party.default_currency = company.default_currency
|
party.party_account_currency = company.default_currency
|
||||||
|
|
||||||
party.party_account_currency = company.default_currency if party_gle else party.default_currency
|
|
||||||
|
|
||||||
# Add default receivable /payable account if not exists
|
# Add default receivable /payable account if not exists
|
||||||
# and currency is other than company currency
|
# and currency is other than company currency
|
||||||
if party.default_currency != company.default_currency:
|
if party.party_account_currency and party.party_account_currency != company.default_currency:
|
||||||
party_account_exists = False
|
party_account_exists = False
|
||||||
for d in party.get("accounts"):
|
for d in party.get("accounts"):
|
||||||
if d.company == company.name:
|
if d.company == company.name:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user