[minor] fixed patch update_companywise_payment_account
This commit is contained in:
parent
f02e142d5d
commit
938ed1a57d
@ -6,6 +6,7 @@ import frappe
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
|
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment')
|
||||||
|
frappe.reload_doc('accounts', 'doctype', 'mode_of_payment_account')
|
||||||
|
|
||||||
mode_of_payment_list = frappe.db.sql("""select name, default_account
|
mode_of_payment_list = frappe.db.sql("""select name, default_account
|
||||||
from `tabMode of Payment`""", as_dict=1)
|
from `tabMode of Payment`""", as_dict=1)
|
||||||
@ -14,7 +15,7 @@ def execute():
|
|||||||
if d.get("default_account"):
|
if d.get("default_account"):
|
||||||
parent_doc = frappe.get_doc("Mode of Payment", d.get("name"))
|
parent_doc = frappe.get_doc("Mode of Payment", d.get("name"))
|
||||||
|
|
||||||
parent_doc.set("mode_of_payment_details",
|
parent_doc.set("accounts",
|
||||||
[{"company": frappe.db.get_value("Account", d.get("default_account"), "company"),
|
[{"company": frappe.db.get_value("Account", d.get("default_account"), "company"),
|
||||||
"default_account": d.get("default_account")}])
|
"default_account": d.get("default_account")}])
|
||||||
parent_doc.save()
|
parent_doc.save()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user