From 0a37f5575fa9a101b1a5c6df331a2ba40c279beb Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Aug 2015 15:53:20 +0530 Subject: [PATCH 1/2] [hotfix] [patch] stock entry additional cost for docstatus < 2 --- .../v5_4/stock_entry_additional_costs.py | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/erpnext/patches/v5_4/stock_entry_additional_costs.py b/erpnext/patches/v5_4/stock_entry_additional_costs.py index e064690c18..96d6b3ddef 100644 --- a/erpnext/patches/v5_4/stock_entry_additional_costs.py +++ b/erpnext/patches/v5_4/stock_entry_additional_costs.py @@ -9,34 +9,35 @@ def execute(): frappe.reload_doctype("Stock Entry") frappe.reload_doctype("Stock Entry Detail") frappe.reload_doctype("Landed Cost Taxes and Charges") - + frappe.db.sql("""update `tabStock Entry Detail` sed, `tabStock Entry` se set sed.valuation_rate=sed.incoming_rate, sed.basic_rate=sed.incoming_rate, sed.basic_amount=sed.amount - where sed.parent = se.name + where sed.parent = se.name and (se.purpose not in ('Manufacture', 'Repack') or ifnull(additional_operating_cost, 0)=0) """) - - stock_entries = frappe.db.sql_list("""select name from `tabStock Entry` - where purpose in ('Manufacture', 'Repack') and ifnull(additional_operating_cost, 0)!=0""") - + + stock_entries = frappe.db.sql_list("""select name from `tabStock Entry` + where purpose in ('Manufacture', 'Repack') and ifnull(additional_operating_cost, 0)!=0 + and docstatus < 2""") + for d in stock_entries: stock_entry = frappe.get_doc("Stock Entry", d) stock_entry.append("additional_costs", { "description": "Additional Operating Cost", "amount": stock_entry.additional_operating_cost }) - + number_of_fg_items = len([t.t_warehouse for t in stock_entry.get("items") if t.t_warehouse]) - + for d in stock_entry.get("items"): d.valuation_rate = d.incoming_rate - - if d.bom_no or (d.t_warehouse and number_of_fg_items == 1): + + if d.bom_no or (d.t_warehouse and number_of_fg_items == 1): d.additional_cost = stock_entry.additional_operating_cost - + d.basic_rate = flt(d.valuation_rate) - flt(d.additional_cost) d.basic_amount = flt(flt(d.basic_rate) *flt(d.transfer_qty), d.precision("basic_amount")) - + stock_entry.flags.ignore_validate = True stock_entry.flags.ignore_validate_update_after_submit = True - stock_entry.save() \ No newline at end of file + stock_entry.save() From d7ba618b92f2265ed96c63acfa2cde33a09785c7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Aug 2015 16:24:41 +0600 Subject: [PATCH 2/2] bumped to version 5.6.1 --- 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 e630695031..d3874a8f05 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.6.0' +__version__ = '5.6.1' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index ba159edea2..e6797a3400 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -27,7 +27,7 @@ blogs. """ app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.6.0" +app_version = "5.6.1" github_link = "https://github.com/frappe/erpnext" error_report_email = "support@erpnext.com" diff --git a/setup.py b/setup.py index f8f28c488d..9945b713a0 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "5.6.0" +version = "5.6.1" with open("requirements.txt", "r") as f: install_requires = f.readlines()