From 945aff14686e6ce7efadbe22f2bb84e8419e1415 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Aug 2013 11:28:45 +0530 Subject: [PATCH 1/5] [fix] [minor] fiscal year deleted from serial no --- stock/doctype/serial_no/serial_no.txt | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/stock/doctype/serial_no/serial_no.txt b/stock/doctype/serial_no/serial_no.txt index c3746eb296..e07ab28253 100644 --- a/stock/doctype/serial_no/serial_no.txt +++ b/stock/doctype/serial_no/serial_no.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-16 10:59:15", "docstatus": 0, - "modified": "2013-08-16 10:16:00", + "modified": "2013-08-21 11:22:50", "modified_by": "Administrator", "owner": "Administrator" }, @@ -446,17 +446,6 @@ "reqd": 1, "search_index": 1 }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, { "cancel": 1, "create": 1, From 4284024accfd4876618c1043eddca33ed64ff222 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 21 Aug 2013 12:27:26 +0530 Subject: [PATCH 2/5] [fix] [patch] fixes bad stock entries due to a bug introduced in commit c46d044efe8f696cf411b69864046dc0e26e776f --- .../p06_fix_sle_against_stock_entry.py | 16 +++++++--------- patches/patch_list.py | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/patches/august_2013/p06_fix_sle_against_stock_entry.py b/patches/august_2013/p06_fix_sle_against_stock_entry.py index dbc2c94ecf..02588bec6d 100644 --- a/patches/august_2013/p06_fix_sle_against_stock_entry.py +++ b/patches/august_2013/p06_fix_sle_against_stock_entry.py @@ -4,10 +4,9 @@ cancelled = [] uncancelled = [] def execute(): - from stock.stock_ledger import update_entries_after - + global cancelled, uncancelled stock_entries = webnotes.conn.sql("""select * from `tabStock Entry` - where docstatus >= 1 and date(modified) >= "2013-08-16" and date(modified) <= "2013-08-21" + where docstatus >= 1 and date(modified) >= "2013-08-16" and ifnull(production_order, '') != '' and ifnull(bom_no, '') != '' order by modified desc, name desc""", as_dict=True) @@ -18,7 +17,6 @@ def execute(): where voucher_type='Stock Entry' and voucher_no=%s and is_cancelled='No'""", entry.name, as_dict=True) if res: - print entry make_stock_entry_detail(entry, res) if cancelled or uncancelled: @@ -98,11 +96,11 @@ def send_email(): if cancelled else "" subject = "[ERPNext] [Important] Cancellation undone for some Stock Entries" - content = """Dear user, + content = """Dear System Manager, -An error got introduced into the code that cleared the item table in Stock Entry associated to a Production Order. +An error got introduced into the code that cleared the item table in a Stock Entry associated to a Production Order. -Hence, +To undo its effect, %s %s @@ -114,6 +112,6 @@ Sorry for the inconvenience this has caused. Regards, Team ERPNext.""" % (uncancelled, cancelled) - print subject, content + # print subject, content - # sendmail_to_system_managers(subject, content) \ No newline at end of file + sendmail_to_system_managers(subject, content) \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index c7ec0c9d25..3dc6c76401 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -256,5 +256,5 @@ patch_list = [ "patches.august_2013.p05_update_serial_no_status", "patches.august_2013.p05_employee_birthdays", "execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-08-16", - # "patches.august_2013.p06_fix_sle_against_stock_entry", + "patches.august_2013.p06_fix_sle_against_stock_entry", ] \ No newline at end of file From 4cfb779d9372bc1c42ef7a9cf702e8ff5a3db69d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 21 Aug 2013 13:37:55 +0530 Subject: [PATCH 3/5] [fix] [permissions] Serial No - Read, Write permission for Accounts User --- stock/doctype/serial_no/serial_no.txt | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/stock/doctype/serial_no/serial_no.txt b/stock/doctype/serial_no/serial_no.txt index e07ab28253..2eba0f4fa6 100644 --- a/stock/doctype/serial_no/serial_no.txt +++ b/stock/doctype/serial_no/serial_no.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-16 10:59:15", "docstatus": 0, - "modified": "2013-08-21 11:22:50", + "modified": "2013-08-21 13:37:01", "modified_by": "Administrator", "owner": "Administrator" }, @@ -35,8 +35,7 @@ "parenttype": "DocType", "permlevel": 0, "read": 1, - "report": 1, - "submit": 0 + "write": 1 }, { "doctype": "DocType", @@ -450,23 +449,22 @@ "cancel": 1, "create": 1, "doctype": "DocPerm", - "role": "Material Master Manager", - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", + "report": 1, "role": "Material Manager", - "write": 0 + "submit": 0 }, { "amend": 0, "cancel": 0, + "create": 1, + "doctype": "DocPerm", + "report": 1, + "role": "Material User", + "submit": 0 + }, + { "create": 0, "doctype": "DocPerm", - "role": "Material User", - "write": 0 + "role": "Accounts User" } ] \ No newline at end of file From e98ab7a2f4f069660e3d78a0c14f3b6fb4d92ce6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Aug 2013 16:56:12 +0530 Subject: [PATCH 4/5] [fix] [minor] fixes in updating warranty period of serial no --- controllers/selling_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/selling_controller.py b/controllers/selling_controller.py index db2d6212e6..320ad2f8eb 100644 --- a/controllers/selling_controller.py +++ b/controllers/selling_controller.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, flt, comma_or, _round +from webnotes.utils import cint, flt, comma_or, _round, add_days from setup.utils import get_company_currency from selling.utils import get_item_details from webnotes import msgprint, _ @@ -291,7 +291,7 @@ class SellingController(StockController): sr.doc.customer = self.doc.customer sr.doc.customer_name = self.doc.customer_name if sr.doc.warranty_period: - sr.doc.warranty_expiry_date = add_days(cstr(self.doc.delivery_date), + sr.doc.warranty_expiry_date = add_days(cstr(self.doc.posting_date), cint(sr.doc.warranty_period)) sr.doc.status = 'Delivered' From 040d1f3a0e40cda9317d2653139528b579922a7f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Aug 2013 17:04:33 +0530 Subject: [PATCH 5/5] [minor] imported cstr in selling_controller --- controllers/selling_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/selling_controller.py b/controllers/selling_controller.py index 320ad2f8eb..086c42e398 100644 --- a/controllers/selling_controller.py +++ b/controllers/selling_controller.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, flt, comma_or, _round, add_days +from webnotes.utils import cint, flt, comma_or, _round, add_days, cstr from setup.utils import get_company_currency from selling.utils import get_item_details from webnotes import msgprint, _