Add indexes in some transaction doctypes (#9889)
This commit is contained in:
parent
2df7db0346
commit
e06526ffff
@ -11,3 +11,6 @@ from erpnext.controllers.print_settings import print_settings_for_item_table
|
|||||||
class PurchaseOrderItem(Document):
|
class PurchaseOrderItem(Document):
|
||||||
def __setup__(self):
|
def __setup__(self):
|
||||||
print_settings_for_item_table(self)
|
print_settings_for_item_table(self)
|
||||||
|
|
||||||
|
def on_doctype_update():
|
||||||
|
frappe.db.add_index("Purchase Order Item", ["item_code", "warehouse"])
|
@ -8,3 +8,6 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
class ProductionOrderItem(Document):
|
class ProductionOrderItem(Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def on_doctype_update():
|
||||||
|
frappe.db.add_index("Production Order Item", ["item_code", "source_warehouse"])
|
@ -416,4 +416,5 @@ erpnext.patches.v8_0.update_production_orders
|
|||||||
erpnext.patches.v8_1.remove_sales_invoice_from_returned_serial_no
|
erpnext.patches.v8_1.remove_sales_invoice_from_returned_serial_no
|
||||||
erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit
|
erpnext.patches.v8_1.allow_invoice_copy_to_edit_after_submit
|
||||||
erpnext.patches.v8_1.add_hsn_sac_codes
|
erpnext.patches.v8_1.add_hsn_sac_codes
|
||||||
erpnext.patches.v8_1.update_gst_state
|
erpnext.patches.v8_1.update_gst_state
|
||||||
|
erpnext.patches.v8_1.add_indexes_in_transaction_doctypes
|
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
for dt in ("Sales Order Item", "Purchase Order Item",
|
||||||
|
"Material Request Item", "Production Order Item", "Packed Item"):
|
||||||
|
frappe.get_doc("DocType", dt).run_module_method("on_doctype_update")
|
@ -10,3 +10,6 @@ from erpnext.controllers.print_settings import print_settings_for_item_table
|
|||||||
class SalesOrderItem(Document):
|
class SalesOrderItem(Document):
|
||||||
def __setup__(self):
|
def __setup__(self):
|
||||||
print_settings_for_item_table(self)
|
print_settings_for_item_table(self)
|
||||||
|
|
||||||
|
def on_doctype_update():
|
||||||
|
frappe.db.add_index("Sales Order Item", ["item_code", "warehouse"])
|
@ -9,4 +9,7 @@ import frappe
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class MaterialRequestItem(Document):
|
class MaterialRequestItem(Document):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def on_doctype_update():
|
||||||
|
frappe.db.add_index("Material Request Item", ["item_code", "warehouse"])
|
@ -103,4 +103,7 @@ def get_items_from_product_bundle(args):
|
|||||||
})
|
})
|
||||||
items.append(get_item_details(args))
|
items.append(get_item_details(args))
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
def on_doctype_update():
|
||||||
|
frappe.db.add_index("Packed Item", ["item_code", "warehouse"])
|
Loading…
Reference in New Issue
Block a user