[hotfix] multicurrency patch
This commit is contained in:
parent
a8de61e24b
commit
c439b87ccc
@ -69,6 +69,7 @@ def execute():
|
|||||||
parties = frappe.get_all(dt)
|
parties = frappe.get_all(dt)
|
||||||
for p in parties:
|
for p in parties:
|
||||||
party = frappe.get_doc(dt, p.name)
|
party = frappe.get_doc(dt, p.name)
|
||||||
|
party_accounts = []
|
||||||
|
|
||||||
for company in company_list:
|
for company in company_list:
|
||||||
# Get party GL Entries
|
# Get party GL Entries
|
||||||
@ -83,7 +84,6 @@ def execute():
|
|||||||
|
|
||||||
# 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
|
||||||
party_accounts = []
|
|
||||||
if party.party_account_currency and party.party_account_currency != company.default_currency:
|
if party.party_account_currency and party.party_account_currency != company.default_currency:
|
||||||
party_account_exists_for_company = False
|
party_account_exists_for_company = False
|
||||||
for d in party.get("accounts"):
|
for d in party.get("accounts"):
|
||||||
@ -112,6 +112,7 @@ def execute():
|
|||||||
"company": company.name,
|
"company": company.name,
|
||||||
"account": party_account
|
"account": party_account
|
||||||
})
|
})
|
||||||
|
|
||||||
party.set("accounts", party_accounts)
|
party.set("accounts", party_accounts)
|
||||||
party.flags.ignore_mandatory = True
|
party.flags.ignore_mandatory = True
|
||||||
party.save()
|
party.save()
|
Loading…
x
Reference in New Issue
Block a user