From 8be895091e293d6525ec072339609e4cff8f1151 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 30 Apr 2018 11:13:06 +0530 Subject: [PATCH] Set is_pos to 0 in Opening Invoice Tool (#13810) --- .../opening_invoice_creation_tool.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py index 930375d491..f726ec6b80 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py @@ -138,7 +138,8 @@ class OpeningInvoiceCreationTool(Document): income_expense_account_field = "expense_account" item = get_item_dict() - return frappe._dict({ + + args = frappe._dict({ "items": [item], "is_opening": "Yes", "set_posting_time": 1, @@ -150,6 +151,11 @@ class OpeningInvoiceCreationTool(Document): "currency": frappe.db.get_value("Company", self.company, "default_currency") }) + if self.invoice_type == "Sales": + args["is_pos"] = 0 + + return args + @frappe.whitelist() def get_temporary_opening_account(company=None): if not company: