From 2e47654f436be8b07ff435600d36579e03b897e2 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 3 Apr 2017 17:25:55 +0530 Subject: [PATCH] [fix] demo script for setup data --- erpnext/demo/setup/setup_data.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py index c1a8bed64b..3675f0f4ea 100644 --- a/erpnext/demo/setup/setup_data.py +++ b/erpnext/demo/setup/setup_data.py @@ -64,8 +64,11 @@ def complete_setup(domain='Manufacturing'): }) company = erpnext.get_default_company() - company.db_set('default_payroll_payable_account', - frappe.db.get_value('Account', dict(account_name='Payroll Payable'))) + + if company: + company_doc = frappe.get_doc("Company", company) + company_doc.db_set('default_payroll_payable_account', + frappe.db.get_value('Account', dict(account_name='Payroll Payable'))) def setup_demo_page(): # home page should always be "start"