diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index b1c0a58a77..58b1d1938d 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -9,7 +9,7 @@ from frappe import msgprint, _, throw from frappe.model.mapper import get_mapped_doc from erpnext.controllers.buying_controller import BuyingController from erpnext.stock.doctype.item.item import get_last_purchase_details -from erpnext.utilities.repost_stock import update_bin_qty, get_ordered_qty +from erpnext.stock.stock_balance import update_bin_qty, get_ordered_qty form_grid_templates = { diff --git a/erpnext/patches/repair_tools/set_stock_balance_as_per_serial_no.py b/erpnext/patches/repair_tools/set_stock_balance_as_per_serial_no.py index 4a4266e7fd..5a421d146f 100644 --- a/erpnext/patches/repair_tools/set_stock_balance_as_per_serial_no.py +++ b/erpnext/patches/repair_tools/set_stock_balance_as_per_serial_no.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): - from erpnext.utilities.repost_stock import set_stock_balance_as_per_serial_no + from erpnext.stock.stock_balance import set_stock_balance_as_per_serial_no frappe.db.auto_commit_on_many_writes = 1 set_stock_balance_as_per_serial_no() diff --git a/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py b/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py index 73a56a8e98..0df5801c42 100644 --- a/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py +++ b/erpnext/patches/v4_2/fix_gl_entries_for_stock_transactions.py @@ -6,7 +6,7 @@ import frappe from frappe.utils import flt def execute(): - from erpnext.utilities.repost_stock import repost + from erpnext.stock.stock_balance import repost repost(allow_zero_rate=True, only_actual=True) frappe.reload_doctype("Account") diff --git a/erpnext/patches/v4_2/repost_reserved_qty.py b/erpnext/patches/v4_2/repost_reserved_qty.py index a2cd4d8ad6..74f4b79f93 100644 --- a/erpnext/patches/v4_2/repost_reserved_qty.py +++ b/erpnext/patches/v4_2/repost_reserved_qty.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from erpnext.utilities.repost_stock import update_bin_qty, get_reserved_qty +from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty def execute(): repost_for = frappe.db.sql(""" diff --git a/erpnext/patches/v4_2/update_requested_and_ordered_qty.py b/erpnext/patches/v4_2/update_requested_and_ordered_qty.py index 240b11dae5..7bb49e64df 100644 --- a/erpnext/patches/v4_2/update_requested_and_ordered_qty.py +++ b/erpnext/patches/v4_2/update_requested_and_ordered_qty.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): - from erpnext.utilities.repost_stock import update_bin_qty, get_indented_qty, get_ordered_qty + from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty, get_ordered_qty count=0 for item_code, warehouse in frappe.db.sql("""select distinct item_code, warehouse from diff --git a/erpnext/patches/v5_0/repost_requested_qty.py b/erpnext/patches/v5_0/repost_requested_qty.py index 8c1d6f7fbb..6af71f3fc4 100644 --- a/erpnext/patches/v5_0/repost_requested_qty.py +++ b/erpnext/patches/v5_0/repost_requested_qty.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe def execute(): - from erpnext.utilities.repost_stock import update_bin_qty, get_indented_qty + from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty count=0 for item_code, warehouse in frappe.db.sql("""select distinct item_code, warehouse diff --git a/erpnext/patches/v5_4/fix_reserved_qty_and_sle_for_packed_items.py b/erpnext/patches/v5_4/fix_reserved_qty_and_sle_for_packed_items.py index 251dd56acb..6eb3994c7c 100644 --- a/erpnext/patches/v5_4/fix_reserved_qty_and_sle_for_packed_items.py +++ b/erpnext/patches/v5_4/fix_reserved_qty_and_sle_for_packed_items.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from erpnext.utilities.repost_stock import repost_actual_qty +from erpnext.stock.stock_balance import repost_actual_qty def execute(): cancelled_invoices = frappe.db.sql_list("""select name from `tabSales Invoice` diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 4f9d54dfbf..dd21f0553e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -8,7 +8,7 @@ import frappe.utils from frappe.utils import cstr, flt, getdate, comma_and from frappe import _ from frappe.model.mapper import get_mapped_doc -from erpnext.utilities.repost_stock import update_bin_qty, get_reserved_qty +from erpnext.stock.stock_balance import update_bin_qty, get_reserved_qty from erpnext.controllers.selling_controller import SellingController diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 659fb1b5f5..08350afa72 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -269,7 +269,7 @@ class Item(WebsiteGenerator): frappe.db.set_value("Item", newdn, "last_purchase_rate", last_purchase_rate) def recalculate_bin_qty(self, newdn): - from erpnext.utilities.repost_stock import repost_stock + from erpnext.stock.stock_balance import repost_stock frappe.db.auto_commit_on_many_writes = 1 existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 03af0722a3..e4183669bf 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -10,7 +10,7 @@ import frappe from frappe.utils import cstr, flt, getdate from frappe import _ from frappe.model.mapper import get_mapped_doc -from erpnext.utilities.repost_stock import update_bin_qty, get_indented_qty +from erpnext.stock.stock_balance import update_bin_qty, get_indented_qty from erpnext.controllers.buying_controller import BuyingController diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 5a3976399f..610c7b88a3 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -140,7 +140,7 @@ class Warehouse(Document): self.recalculate_bin_qty(newdn) def recalculate_bin_qty(self, newdn): - from erpnext.utilities.repost_stock import repost_stock + from erpnext.stock.stock_balance import repost_stock frappe.db.auto_commit_on_many_writes = 1 existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) diff --git a/erpnext/utilities/repost_stock.py b/erpnext/stock/stock_balance.py similarity index 100% rename from erpnext/utilities/repost_stock.py rename to erpnext/stock/stock_balance.py