[minor] replaced db_save by db_update and added patch to remove the indexes on tabBin

This commit is contained in:
mbauskar 2017-06-08 23:39:58 +05:30
parent 1042941348
commit f819c93329
4 changed files with 22 additions and 6 deletions

View File

@ -399,3 +399,4 @@ erpnext.patches.v8_0.make_payments_table_blank_for_non_pos_invoice
erpnext.patches.v8_0.delete_schools_depricated_doctypes
erpnext.patches.v8_0.update_customer_pos_id
erpnext.patches.v8_0.rename_items_in_status_field_of_material_request
erpnext.patches.v8_0.delete_bin_indexes

View File

@ -0,0 +1,16 @@
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import frappe
def execute():
# delete bin indexes
unwanted_indexes = ["item_code", "warehouse"]
for k in unwanted_indexes:
try:
frappe.db.sql("drop index {0} on `tabBin`".format(k))
except:
pass

View File

@ -40,7 +40,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
@ -72,7 +72,7 @@
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
@ -463,7 +463,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-06-08 18:42:44.714839",
"modified": "2017-06-13 13:06:32.601505",
"modified_by": "Administrator",
"module": "Stock",
"name": "Bin",

View File

@ -72,10 +72,9 @@ class Bin(Document):
self.reserved_qty = flt(self.reserved_qty) + flt(args.get("reserved_qty"))
self.indented_qty = flt(self.indented_qty) + flt(args.get("indented_qty"))
self.planned_qty = flt(self.planned_qty) + flt(args.get("planned_qty"))
self.set_projected_qty()
self.db_save()
self.set_projected_qty()
self.db_update()
def set_projected_qty(self):
self.projected_qty = (flt(self.actual_qty) + flt(self.ordered_qty)