Fixed party model patch
This commit is contained in:
parent
789b74257e
commit
1caa1a3708
@ -6,6 +6,9 @@ import frappe
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc("accounts", "doctype", "account")
|
frappe.reload_doc("accounts", "doctype", "account")
|
||||||
|
frappe.reload_doc("setup", "doctype", "company")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "journal_voucher_detail")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "gl_entry")
|
||||||
receivable_payable_accounts = create_receivable_payable_account()
|
receivable_payable_accounts = create_receivable_payable_account()
|
||||||
if receivable_payable_accounts:
|
if receivable_payable_accounts:
|
||||||
set_party_in_jv_and_gl_entry(receivable_payable_accounts)
|
set_party_in_jv_and_gl_entry(receivable_payable_accounts)
|
||||||
@ -76,7 +79,7 @@ def set_party_in_jv_and_gl_entry(receivable_payable_accounts):
|
|||||||
|
|
||||||
for dt in ["Journal Voucher Detail", "GL Entry"]:
|
for dt in ["Journal Voucher Detail", "GL Entry"]:
|
||||||
records = frappe.db.sql("""select name, account from `tab%s` where account in (%s)""" %
|
records = frappe.db.sql("""select name, account from `tab%s` where account in (%s)""" %
|
||||||
(dt, ", ".join(['%s']*len(account_map))), tuple(account_map.keys()))
|
(dt, ", ".join(['%s']*len(account_map))), tuple(account_map.keys()), as_dict=1)
|
||||||
for d in records:
|
for d in records:
|
||||||
account_details = account_map.get(d.account, {})
|
account_details = account_map.get(d.account, {})
|
||||||
account_type = "Receivable" if account_details.get("master_type")=="Customer" else "Payable"
|
account_type = "Receivable" if account_details.get("master_type")=="Customer" else "Payable"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user