mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
chore: remove unused function
This commit is contained in:
@@ -654,7 +654,7 @@ class Asset(AccountsController):
|
|||||||
self.db_set("status", status)
|
self.db_set("status", status)
|
||||||
|
|
||||||
def get_status(self):
|
def get_status(self):
|
||||||
"""Returns status based on whether it is draft, submitted, sold, scrapped or depreciated"""
|
"""Returns status based on whether it is draft, submitted, scrapped or depreciated"""
|
||||||
if self.docstatus == 0:
|
if self.docstatus == 0:
|
||||||
status = "Draft"
|
status = "Draft"
|
||||||
elif self.docstatus == 1:
|
elif self.docstatus == 1:
|
||||||
@@ -676,21 +676,6 @@ class Asset(AccountsController):
|
|||||||
status = "Cancelled"
|
status = "Cancelled"
|
||||||
return status
|
return status
|
||||||
|
|
||||||
def is_sold(self):
|
|
||||||
item = frappe.qb.DocType("Sales Invoice Item").as_("item")
|
|
||||||
si = frappe.qb.DocType("Sales Invoice").as_("si")
|
|
||||||
|
|
||||||
asset_sales_invoice = (
|
|
||||||
frappe.qb.from_(item)
|
|
||||||
.select(item.parent)
|
|
||||||
.inner_join(si)
|
|
||||||
.on(item.parent == si.name)
|
|
||||||
.where(item.asset == self.name)
|
|
||||||
.where(si.docstatus == 1)
|
|
||||||
).run()
|
|
||||||
|
|
||||||
return True if asset_sales_invoice else False
|
|
||||||
|
|
||||||
def get_default_finance_book_idx(self):
|
def get_default_finance_book_idx(self):
|
||||||
if not self.get("default_finance_book") and self.company:
|
if not self.get("default_finance_book") and self.company:
|
||||||
self.default_finance_book = erpnext.get_default_finance_book(self.company)
|
self.default_finance_book = erpnext.get_default_finance_book(self.company)
|
||||||
|
|||||||
Reference in New Issue
Block a user