diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 737e8496d33..3d7062be3cb 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -822,6 +822,9 @@ class StockController(AccountsController): self.update_inventory_dimensions(d, sl_dict) if self.docstatus == 2: + from erpnext.deprecation_dumpster import deprecation_warning + + deprecation_warning("unknown", "v16", "No instructions.") # To handle denormalized serial no records, will br deprecated in v16 for field in ["serial_no", "batch_no"]: if d.get(field): diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py index 5fb1ee468cd..15a13cb90fd 100644 --- a/erpnext/controllers/subcontracting_controller.py +++ b/erpnext/controllers/subcontracting_controller.py @@ -335,12 +335,18 @@ class SubcontractingController(StockController): # Will be deprecated in v16 if row.serial_no and not consumed_bundles.serial_nos: + from erpnext.deprecation_dumpster import deprecation_warning + + deprecation_warning("unknown", "v16", "No instructions.") self.available_materials[key]["serial_no"] = list( set(self.available_materials[key]["serial_no"]) - set(get_serial_nos(row.serial_no)) ) # Will be deprecated in v16 if row.batch_no and not consumed_bundles.batch_nos: + from erpnext.deprecation_dumpster import deprecation_warning + + deprecation_warning("unknown", "v16", "No instructions.") self.available_materials[key]["batch_no"][row.batch_no] -= row.consumed_qty def get_available_materials(self): diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index a14cde116af..ca0b037ea5b 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -8,7 +8,6 @@ import frappe from frappe import _, scrub from frappe.model.document import Document from frappe.utils import cint, flt, round_based_on_smallest_currency_fraction -from frappe.utils.deprecations import deprecated import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate @@ -18,6 +17,7 @@ from erpnext.controllers.accounts_controller import ( validate_inclusive_tax, validate_taxes_and_charges, ) +from erpnext.deprecation_dumpster import deprecated from erpnext.stock.get_item_details import ItemDetailsCtx, _get_item_tax_template from erpnext.utilities.regional import temporary_flag @@ -567,7 +567,12 @@ class calculate_taxes_and_totals: tax.base_tax_amount = round(tax.base_tax_amount, 0) tax.base_tax_amount_after_discount_amount = round(tax.base_tax_amount_after_discount_amount, 0) - @deprecated + @deprecated( + f"{__name__}.calculate_taxes_and_totals.manipulate_grand_total_for_inclusive_tax", + "unknown", + "v16", + "No known instructions.", + ) def manipulate_grand_total_for_inclusive_tax(self): # for backward compatablility - if in case used by an external application return self.adjust_grand_total_for_inclusive_tax() diff --git a/erpnext/startup/leaderboard.py b/erpnext/startup/leaderboard.py index 06f61fd961e..b8d01d56ef5 100644 --- a/erpnext/startup/leaderboard.py +++ b/erpnext/startup/leaderboard.py @@ -1,5 +1,6 @@ import frappe -from frappe.utils.deprecations import deprecated + +from erpnext.deprecation_dumpster import deprecated def get_leaderboards(): @@ -218,7 +219,7 @@ def get_all_sales_person(date_range, company, field=None, limit=0): ) -@deprecated +@deprecated(f"{__name__}.get_date_condition", "unknown", "v16", "No known instructions.") def get_date_condition(date_range, field): date_condition = "" if date_range: diff --git a/erpnext/stock/deprecated_serial_batch.py b/erpnext/stock/deprecated_serial_batch.py index 08ac3eea91f..de31867fbd9 100644 --- a/erpnext/stock/deprecated_serial_batch.py +++ b/erpnext/stock/deprecated_serial_batch.py @@ -4,12 +4,18 @@ from collections import defaultdict import frappe from frappe.query_builder.functions import CombineDatetime, Sum from frappe.utils import flt -from frappe.utils.deprecations import deprecated from pypika import Order +from erpnext.deprecation_dumpster import deprecated + class DeprecatedSerialNoValuation: - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.SerialNoValuation.calculate_stock_value_from_deprecarated_ledgers", + "unknown", + "v16", + "No known instructions.", + ) def calculate_stock_value_from_deprecarated_ledgers(self): if not has_sle_for_serial_nos(self.sle.item_code): return @@ -35,7 +41,12 @@ class DeprecatedSerialNoValuation: return serial_nos - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.SerialNoValuation.get_incoming_value_for_serial_nos", + "unknown", + "v16", + "No known instructions.", + ) def get_incoming_value_for_serial_nos(self, serial_nos): from erpnext.stock.utils import get_combine_datetime @@ -93,14 +104,24 @@ def has_sle_for_serial_nos(item_code): class DeprecatedBatchNoValuation: - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.calculate_avg_rate_from_deprecarated_ledgers", + "unknown", + "v16", + "No known instructions.", + ) def calculate_avg_rate_from_deprecarated_ledgers(self): entries = self.get_sle_for_batches() for ledger in entries: self.stock_value_differece[ledger.batch_no] += flt(ledger.batch_value) self.available_qty[ledger.batch_no] += flt(ledger.batch_qty) - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.get_sle_for_batches", + "unknown", + "v16", + "No known instructions.", + ) def get_sle_for_batches(self): from erpnext.stock.utils import get_combine_datetime @@ -147,7 +168,12 @@ class DeprecatedBatchNoValuation: return query.run(as_dict=True) - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.calculate_avg_rate_for_non_batchwise_valuation", + "unknown", + "v16", + "No known instructions.", + ) def calculate_avg_rate_for_non_batchwise_valuation(self): if not self.non_batchwise_valuation_batches: return @@ -185,12 +211,22 @@ class DeprecatedBatchNoValuation: }, ) - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.set_balance_value_for_non_batchwise_valuation_batches", + "unknown", + "v16", + "No known instructions.", + ) def set_balance_value_for_non_batchwise_valuation_batches(self): self.set_balance_value_from_sl_entries() self.set_balance_value_from_bundle() - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.set_balance_value_from_sl_entries", + "unknown", + "v16", + "No known instructions.", + ) def set_balance_value_from_sl_entries(self) -> None: from erpnext.stock.utils import get_combine_datetime @@ -237,7 +273,12 @@ class DeprecatedBatchNoValuation: self.non_batchwise_balance_qty[d.batch_no] += flt(d.batch_qty) self.available_qty[d.batch_no] += flt(d.batch_qty) - @deprecated + @deprecated( + "erpnext.stock.serial_batch_bundle.BatchNoValuation.set_balance_value_from_bundle", + "unknown", + "v16", + "No known instructions.", + ) def set_balance_value_from_bundle(self) -> None: bundle = frappe.qb.DocType("Serial and Batch Bundle") bundle_child = frappe.qb.DocType("Serial and Batch Entry") diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py index 0bb9d40581a..eeb331318ba 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py @@ -5,9 +5,9 @@ import frappe from frappe import _ from frappe.utils import add_to_date, cint, flt, get_datetime, get_table_name, getdate -from frappe.utils.deprecations import deprecated from pypika import functions as fn +from erpnext.deprecation_dumpster import deprecated from erpnext.stock.doctype.warehouse.warehouse import apply_warehouse_filter SLE_COUNT_LIMIT = 10_000 @@ -100,7 +100,7 @@ def get_stock_ledger_entries(filters): return entries -@deprecated +@deprecated(f"{__name__}.get_stock_ledger_entries_for_batch_no", "unknown", "v16", "No known instructions.") def get_stock_ledger_entries_for_batch_no(filters): if not filters.get("from_date"): frappe.throw(_("'From Date' is required"))