brotherton-erpnext/erpnext/patches/v11_0/add_expense_claim_default_account.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
403 B
Python
Raw Normal View History

from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc("setup", "doctype", "company")
companies = frappe.get_all("Company", fields=["name", "default_payable_account"])
for company in companies:
if company.default_payable_account is not None:
frappe.db.set_value("Company", company.name, "default_expense_claim_payable_account", company.default_payable_account)