From 6cdfd1e976d5f6385e1e8b02334ef31cf78a5903 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 25 Feb 2015 15:55:57 +0530 Subject: [PATCH] [fix] patches --- erpnext/controllers/taxes_and_totals.py | 2 +- erpnext/patches.txt | 2 +- erpnext/patches/v5_0/update_from_bom.py | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v5_0/update_from_bom.py diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 28499c12df..2d5df155c3 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -217,7 +217,7 @@ class calculate_taxes_and_totals(object): tax.grand_total_for_current_item = flt(item.net_amount + current_tax_amount, tax.precision("total")) else: tax.grand_total_for_current_item = \ - flt(self.doc.get("taxes")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision("total_taxes_and_charges")) + flt(self.doc.get("taxes")[i-1].grand_total_for_current_item + current_tax_amount, tax.precision("total")) # in tax.total, accumulate grand total of each item tax.total += tax.grand_total_for_current_item diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b3745e7ce5..e4e35ad253 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -126,4 +126,4 @@ erpnext.patches.v5_0.item_patches erpnext.patches.v5_0.update_journal_entry_title erpnext.patches.v5_0.taxes_and_totals_in_party_currency erpnext.patches.v5_0.replace_renamed_fields_in_custom_scripts_and_print_formats -execute:frappe.db.sql("update `tabStock Entry` set from_bom = if(ifnull(bom_no, '')='', 0, 1)") +erpnext.patches.v5_0.update_from_bom diff --git a/erpnext/patches/v5_0/update_from_bom.py b/erpnext/patches/v5_0/update_from_bom.py new file mode 100644 index 0000000000..fb4ffccff4 --- /dev/null +++ b/erpnext/patches/v5_0/update_from_bom.py @@ -0,0 +1,9 @@ +# 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 + +def execute(): + frappe.reload_doctype("BOM") + frappe.db.sql("update `tabStock Entry` set from_bom = if(ifnull(bom_no, '')='', 0, 1)")