From 49e8e783e3e1b32f6e1f40dca59c5aef61f9a472 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Mon, 27 Jan 2014 11:12:24 +0530 Subject: [PATCH 1/7] webnotes/erpnext#1353 allow rename for price list --- stock/doctype/price_list/price_list.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stock/doctype/price_list/price_list.txt b/stock/doctype/price_list/price_list.txt index daa89d1cc5..cc70fd897e 100644 --- a/stock/doctype/price_list/price_list.txt +++ b/stock/doctype/price_list/price_list.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-25 11:35:09", "docstatus": 0, - "modified": "2014-01-17 13:29:39", + "modified": "2014-01-27 11:11:08", "modified_by": "Administrator", "owner": "Administrator" }, @@ -11,6 +11,7 @@ "allow_copy": 0, "allow_email": 1, "allow_print": 1, + "allow_rename": 1, "autoname": "field:price_list_name", "description": "Price List Master", "doctype": "DocType", From fa9fabaa49f749b7ec28611998b51d0ddb25ca50 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Jan 2014 12:46:18 +0530 Subject: [PATCH 2/7] Serial no status fix: patch to set status not available where no sle exists --- .../1401/fix_serial_no_status_and_warehouse.py | 17 +++++++++++++++++ patches/patch_list.py | 1 + stock/doctype/serial_no/serial_no.py | 11 +++++++---- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 patches/1401/fix_serial_no_status_and_warehouse.py diff --git a/patches/1401/fix_serial_no_status_and_warehouse.py b/patches/1401/fix_serial_no_status_and_warehouse.py new file mode 100644 index 0000000000..fe43c282d8 --- /dev/null +++ b/patches/1401/fix_serial_no_status_and_warehouse.py @@ -0,0 +1,17 @@ +# 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 webnotes + +def execute(): + serial_nos = webnotes.conn.sql("""select name from `tabSerial No` where docstatus=0 + and status in ('Available', 'Sales Returned') and ifnull(warehouse, '') = ''""") + for sr in serial_nos: + try: + sr_bean = webnotes.bean("Serial No", sr[0]) + sr_bean.make_controller().via_stock_ledger = True + sr_bean.save() + webnotes.conn.commit() + except: + pass \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 89e33091bf..d87d3ad36f 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -267,4 +267,5 @@ patch_list = [ "patches.1401.p01_make_buying_selling_as_check_box_in_price_list", "patches.1401.update_billing_status_for_zero_value_order", "patches.1401.enable_all_price_list", + "patches.1401.fix_serial_no_status_and_warehouse", ] \ No newline at end of file diff --git a/stock/doctype/serial_no/serial_no.py b/stock/doctype/serial_no/serial_no.py index bd2704d8ac..e6557b4284 100644 --- a/stock/doctype/serial_no/serial_no.py +++ b/stock/doctype/serial_no/serial_no.py @@ -87,6 +87,8 @@ class DocType(StockController): self.doc.status = "Sales Returned" else: self.doc.status = "Available" + if not self.doc.warehouse: + self.doc.warehouse = last_sle.warehouse else: if document_type == "Purchase Return": self.doc.status = "Purchase Returned" @@ -94,6 +96,8 @@ class DocType(StockController): self.doc.status = "Delivered" else: self.doc.status = "Not Available" + else: + self.doc.status = "Not Available" def set_purchase_details(self, purchase_sle): if purchase_sle: @@ -185,10 +189,9 @@ class DocType(StockController): def on_stock_ledger_entry(self): if self.via_stock_ledger and not self.doc.fields.get("__islocal"): last_sle = self.get_last_sle() - if last_sle: - self.set_status(last_sle.get("last_sle")) - self.set_purchase_details(last_sle.get("purchase_sle")) - self.set_sales_details(last_sle.get("delivery_sle")) + self.set_status(last_sle.get("last_sle")) + self.set_purchase_details(last_sle.get("purchase_sle")) + self.set_sales_details(last_sle.get("delivery_sle")) def on_communication(self): return From b3d26c08f609f22ca197fd815ccfe0f0f9749b24 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Jan 2014 14:58:55 +0530 Subject: [PATCH 3/7] Fixed planned qty bug and patch to recalculate planned qty --- patches/patch_list.py | 1 + stock/doctype/stock_entry/stock_entry.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/patch_list.py b/patches/patch_list.py index d87d3ad36f..30617205c8 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -268,4 +268,5 @@ patch_list = [ "patches.1401.update_billing_status_for_zero_value_order", "patches.1401.enable_all_price_list", "patches.1401.fix_serial_no_status_and_warehouse", + "patches.1401.fix_planned_qty", ] \ No newline at end of file diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 7dec8785c4..c322a1ac45 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -346,7 +346,8 @@ class DocType(StockController): pro_bean = webnotes.bean("Production Order", self.doc.production_order) _validate_production_order(pro_bean) self.update_produced_qty(pro_bean) - self.update_planned_qty(pro_bean) + if self.doc.purpose == "Manufacture/Repack": + self.update_planned_qty(pro_bean) def update_produced_qty(self, pro_bean): if self.doc.purpose == "Manufacture/Repack": From 44a40b860ed54fc6808d6328a5e6c1acb5702664 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Jan 2014 15:02:30 +0530 Subject: [PATCH 4/7] Fixed planned qty bug and patch to recalculate planned qty --- patches/1401/fix_planned_qty.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 patches/1401/fix_planned_qty.py diff --git a/patches/1401/fix_planned_qty.py b/patches/1401/fix_planned_qty.py new file mode 100644 index 0000000000..96f56fb88a --- /dev/null +++ b/patches/1401/fix_planned_qty.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +import webnotes + +def execute(): + from utilities.repost_stock import repost_stock + for d in webnotes.conn.sql("""select distinct production_item, fg_warehouse + from `tabProduction Order` where docstatus>0""", as_dict=1): + repost_stock(d.production_item, d.fg_warehouse) \ No newline at end of file From 8821541f33de980d6e42780e42eb15a666b0075b Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Mon, 27 Jan 2014 17:49:45 +0600 Subject: [PATCH 5/7] bumped to version 3.7.0 --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index f71ed9b572..91c1624e13 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "app_name": "ERPNext", - "app_version": "3.6.6", + "app_version": "3.7.0", "base_template": "app/portal/templates/base.html", "modules": { "Accounts": { @@ -74,5 +74,5 @@ "type": "module" } }, - "requires_framework_version": "==3.7.5" + "requires_framework_version": "==3.8.0" } \ No newline at end of file From 191935bbf59556fd91d3a2041c02b8f33e94e8d3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 27 Jan 2014 17:37:06 +0530 Subject: [PATCH 6/7] Planned qty patch: auto commit on many writes --- patches/1401/fix_planned_qty.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/1401/fix_planned_qty.py b/patches/1401/fix_planned_qty.py index 96f56fb88a..979d94985b 100644 --- a/patches/1401/fix_planned_qty.py +++ b/patches/1401/fix_planned_qty.py @@ -4,7 +4,10 @@ import webnotes def execute(): + webnotes.conn.auto_commit_on_many_writes = 1 from utilities.repost_stock import repost_stock for d in webnotes.conn.sql("""select distinct production_item, fg_warehouse from `tabProduction Order` where docstatus>0""", as_dict=1): - repost_stock(d.production_item, d.fg_warehouse) \ No newline at end of file + repost_stock(d.production_item, d.fg_warehouse) + + webnotes.conn.auto_commit_on_many_writes = 0 \ No newline at end of file From dc540dda4d29df82928c48c946e103e93df17a4b Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Mon, 27 Jan 2014 18:19:50 +0600 Subject: [PATCH 7/7] bumped to version 3.7.1 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 91c1624e13..cd3e91bda8 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "app_name": "ERPNext", - "app_version": "3.7.0", + "app_version": "3.7.1", "base_template": "app/portal/templates/base.html", "modules": { "Accounts": {