From 4888a5dc0d1c0677405ae76aa34836a6619eddf7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 21 May 2015 16:50:25 +0530 Subject: [PATCH 1/4] [patch][fix] party model - create debtors and creditors only if parent account exists --- erpnext/patches/v4_2/party_model.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/erpnext/patches/v4_2/party_model.py b/erpnext/patches/v4_2/party_model.py index cbb00cf031..03eec1682f 100644 --- a/erpnext/patches/v4_2/party_model.py +++ b/erpnext/patches/v4_2/party_model.py @@ -19,20 +19,21 @@ def create_receivable_payable_account(): receivable_payable_accounts = frappe._dict() def _create_account(args): - account_id = frappe.db.get_value("Account", - {"account_name": args["account_name"], "company": args["company"]}) - if not account_id: - account = frappe.new_doc("Account") - account.is_group = 0 - account.update(args) - account.insert() + if args["parent_account"]: + account_id = frappe.db.get_value("Account", + {"account_name": args["account_name"], "company": args["company"]}) + if not account_id: + account = frappe.new_doc("Account") + account.is_group = 0 + account.update(args) + account.insert() - account_id = account.name + account_id = account.name - frappe.db.set_value("Company", args["company"], ("default_receivable_account" - if args["account_type"]=="Receivable" else "default_payable_account"), account_id) + frappe.db.set_value("Company", args["company"], ("default_receivable_account" + if args["account_type"]=="Receivable" else "default_payable_account"), account_id) - receivable_payable_accounts.setdefault(args["company"], {}).setdefault(args["account_type"], account_id) + receivable_payable_accounts.setdefault(args["company"], {}).setdefault(args["account_type"], account_id) for company in frappe.db.sql_list("select name from tabCompany"): _create_account({ From 3b0adc5246950575216d8104d2035a3bedc1dad9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 21 May 2015 16:51:15 +0530 Subject: [PATCH 2/4] [fix] ignore share permission while creating events on the background --- erpnext/config/accounts.py | 2 +- erpnext/utilities/transaction_base.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py index 1b29002257..a5a4024215 100644 --- a/erpnext/config/accounts.py +++ b/erpnext/config/accounts.py @@ -114,7 +114,7 @@ def get_data(): { "type": "doctype", "name": "POS Profile", - "label": _("Point-of-Sale Setting"), + "label": _("Point-of-Sale Profile"), "description": _("Rules to calculate shipping amount for a sale") }, { diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 9c73c60b14..60889c5415 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -51,7 +51,8 @@ class TransactionBase(StatusUpdater): event.insert(ignore_permissions=True) if frappe.db.exists("User", self.contact_by): - frappe.share.add("Event", event.name, self.contact_by) + frappe.share.add("Event", event.name, self.contact_by, + flags={"ignore_share_permission": True}) def validate_uom_is_integer(self, uom_field, qty_fields): validate_uom_is_integer(self, uom_field, qty_fields) From 1d08304ba5daeaffe65ec43fffa25b8198e48635 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 22 May 2015 11:48:47 +0530 Subject: [PATCH 3/4] added total row in stock balance report --- erpnext/stock/report/stock_balance/stock_balance.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.json b/erpnext/stock/report/stock_balance/stock_balance.json index ab331dc3c2..5f7fde0e3a 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.json +++ b/erpnext/stock/report/stock_balance/stock_balance.json @@ -1,12 +1,12 @@ { - "add_total_row": 0, + "add_total_row": 1, "apply_user_permissions": 1, "creation": "2014-10-10 17:58:11.577901", "disabled": 0, "docstatus": 0, "doctype": "Report", "is_standard": "Yes", - "modified": "2014-10-10 17:58:11.577901", + "modified": "2015-05-22 02:16:24.614986", "modified_by": "Administrator", "module": "Stock", "name": "Stock Balance", From 08e04ef01a62cdaa6bcab44c0fd93b1cad73ca39 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Fri, 22 May 2015 17:22:25 +0600 Subject: [PATCH 4/4] bumped to version 5.0.8 --- erpnext/__version__.py | 2 +- erpnext/hooks.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/__version__.py b/erpnext/__version__.py index 76a0d5780d..84aceadcf8 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.0.7' +__version__ = '5.0.8' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 4a2e60d31a..750f8112fc 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.0.7" +app_version = "5.0.8" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index fb71b6230e..58be999f6d 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.0.7" +version = "5.0.8" with open("requirements.txt", "r") as f: install_requires = f.readlines()