From e2f054cc27e716b0a0e73c03fe9d9fb81d57dfa4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 9 Mar 2015 14:54:37 +0530 Subject: [PATCH 1/5] transaction date issue in pricing rule fixed --- erpnext/controllers/accounts_controller.py | 2 ++ erpnext/public/js/transaction.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 5219339476..fcc350a3ee 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -112,6 +112,8 @@ class AccountsController(TransactionBase): if item.get("item_code"): args = parent_dict.copy() args.update(item.as_dict()) + if not args.get("transaction_date"): + args["transaction_date"] = args.get("posting_date") ret = get_item_details(args) for fieldname, value in ret.items(): diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index e1e78a3c01..ebdb136dd4 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -148,7 +148,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ order_type: me.frm.doc.order_type, is_pos: cint(me.frm.doc.is_pos), is_subcontracted: me.frm.doc.is_subcontracted, - transaction_date: me.frm.doc.transaction_date, + transaction_date: me.frm.doc.transaction_date || me.frm.doc.posting_date, ignore_pricing_rule: me.frm.doc.ignore_pricing_rule, doctype: item.doctype, name: item.name, From 081c3ec47606788bd32764d009b3a9e51fb7b76c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 9 Mar 2015 15:11:34 +0530 Subject: [PATCH 2/5] c-form message issue --- erpnext/accounts/doctype/c_form/c_form.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index c18d28ad84..7d879e4d92 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -18,17 +18,17 @@ class CForm(Document): `tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no) if inv and inv[0][0] != 'Yes': - frappe.throw("C-form is not applicable for Invoice: %s" % d.invoice_no) + frappe.throw("C-form is not applicable for Invoice: {0}".format(d.invoice_no)) elif inv and inv[0][1] and inv[0][1] != self.name: - frappe.throw("""Invoice %s is tagged in another C-form: %s. + frappe.throw("""Invoice {0} is tagged in another C-form: {1}. If you want to change C-form no for this invoice, - please remove invoice no from the previous c-form and then try again""" % - (d.invoice_no, inv[0][1])) + please remove invoice no from the previous c-form and then try again"""\ + .format(d.invoice_no, inv[0][1])) elif not inv: - frappe.throw("Row %s: Invoice %s is invalid, it might be cancelled / does not exist. \ - Please enter a valid Invoice" % d.idx, d.invoice_no) + frappe.throw("Row {0}: Invoice {1} is invalid, it might be cancelled / does not exist. \ + Please enter a valid Invoice".format(d.idx, d.invoice_no)) def on_update(self): """ Update C-Form No on invoices""" From 7a31f6aaca9a41e963535f311e7e56e86c6a0a24 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 9 Mar 2015 16:31:11 +0530 Subject: [PATCH 3/5] repost reserved qty if negative --- erpnext/patches.txt | 1 + erpnext/patches/v4_2/repost_reserved_qty.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 erpnext/patches/v4_2/repost_reserved_qty.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 3e4bc81a12..820403706c 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -94,3 +94,4 @@ erpnext.patches.v4_2.discount_amount erpnext.patches.v4_2.update_landed_cost_voucher erpnext.patches.v4_2.set_item_has_batch erpnext.patches.v4_2.update_stock_uom_for_dn_in_sle +erpnext.patches.v4_2.repost_reserved_qty \ No newline at end of file diff --git a/erpnext/patches/v4_2/repost_reserved_qty.py b/erpnext/patches/v4_2/repost_reserved_qty.py new file mode 100644 index 0000000000..04dfb77bfa --- /dev/null +++ b/erpnext/patches/v4_2/repost_reserved_qty.py @@ -0,0 +1,12 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +from erpnext.utilities.repost_stock import update_bin_qty, get_reserved_qty + +def execute(): + for item_code, warehouse in frappe.db.sql("select item_code, warehouse from tabBin where ifnull(reserved_qty, 0) < 0"): + update_bin_qty(item_code, warehouse, { + "reserved_qty": get_reserved_qty(item_code, warehouse) + }) \ No newline at end of file From 11498cac94215a1e0424da4aaf196c987d5629c4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 9 Mar 2015 18:28:35 +0530 Subject: [PATCH 4/5] Repost sle for si without warehouse --- erpnext/patches.txt | 3 +- .../repost_sle_for_si_with_no_warehouse.py | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 erpnext/patches/v4_2/repost_sle_for_si_with_no_warehouse.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 820403706c..e3437a56f5 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -94,4 +94,5 @@ erpnext.patches.v4_2.discount_amount erpnext.patches.v4_2.update_landed_cost_voucher erpnext.patches.v4_2.set_item_has_batch erpnext.patches.v4_2.update_stock_uom_for_dn_in_sle -erpnext.patches.v4_2.repost_reserved_qty \ No newline at end of file +erpnext.patches.v4_2.repost_reserved_qty +erpnext.patches.v4_2.repost_sle_for_si_with_no_warehouse \ No newline at end of file diff --git a/erpnext/patches/v4_2/repost_sle_for_si_with_no_warehouse.py b/erpnext/patches/v4_2/repost_sle_for_si_with_no_warehouse.py new file mode 100644 index 0000000000..44bec0091a --- /dev/null +++ b/erpnext/patches/v4_2/repost_sle_for_si_with_no_warehouse.py @@ -0,0 +1,34 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +from erpnext.stock.stock_ledger import NegativeStockError + +def execute(): + si_list = frappe.db.sql("""select distinct si.name + from `tabSales Invoice Item` si_item, `tabSales Invoice` si + where si.name = si_item.parent and si.modified > '2015-02-16' and si.docstatus=1 + and ifnull(si_item.warehouse, '') = '' and ifnull(si.update_stock, 0) = 1 + order by posting_date, posting_time""", as_dict=1) + + failed_list = [] + for si in si_list: + try: + si_doc = frappe.get_doc("Sales Invoice", si.name) + si_doc.docstatus = 2 + si_doc.on_cancel() + + si_doc.docstatus = 1 + si_doc.set_missing_item_details() + si_doc.on_submit() + frappe.db.commit() + except: + failed_list.append(si.name) + frappe.local.stockledger_exceptions = None + frappe.db.rollback() + + print "Failed to repost: ", failed_list + + + \ No newline at end of file From 21761c204c14bb4b9575b0ce1fdde8be578f93cb Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 10 Mar 2015 11:11:35 +0600 Subject: [PATCH 5/5] bumped to version 4.24.0 --- 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 bcd8ae4166..f7015524bc 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '4.23.0' +__version__ = '4.24.0' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a1b0cc621f..017f80e797 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -5,7 +5,7 @@ app_publisher = "Web Notes 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 = "4.23.0" +app_version = "4.24.0" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index 2dacebe595..44bafc910d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages import os -version = "4.23.0" +version = "4.24.0" with open("requirements.txt", "r") as f: install_requires = f.readlines()