mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
removed Is Sales Item and Is Purchase Item
This commit is contained in:
@@ -251,19 +251,6 @@ class BuyingController(StockController):
|
||||
|
||||
return self._sub_contracted_items
|
||||
|
||||
@property
|
||||
def purchase_items(self):
|
||||
if not hasattr(self, "_purchase_items"):
|
||||
self._purchase_items = []
|
||||
item_codes = list(set(item.item_code for item in
|
||||
self.get("items")))
|
||||
if item_codes:
|
||||
self._purchase_items = [r[0] for r in frappe.db.sql("""select name
|
||||
from `tabItem` where name in (%s) and is_purchase_item='Yes'""" % \
|
||||
(", ".join((["%s"]*len(item_codes))),), item_codes)]
|
||||
|
||||
return self._purchase_items
|
||||
|
||||
def is_item_table_empty(self):
|
||||
if not len(self.get("items")):
|
||||
frappe.throw(_("Item table can not be blank"))
|
||||
|
||||
@@ -232,11 +232,10 @@ class SellingController(StockController):
|
||||
def check_active_sales_items(obj):
|
||||
for d in obj.get("items"):
|
||||
if d.item_code:
|
||||
item = frappe.db.sql("""select docstatus, is_sales_item,
|
||||
item = frappe.db.sql("""select docstatus,
|
||||
income_account from tabItem where name = %s""",
|
||||
d.item_code, as_dict=True)[0]
|
||||
if item.is_sales_item == 0:
|
||||
frappe.throw(_("Item {0} must be a Sales Item in {1}").format(d.item_code, d.idx))
|
||||
|
||||
if getattr(d, "income_account", None) and not item.income_account:
|
||||
frappe.db.set_value("Item", d.item_code, "income_account",
|
||||
d.income_account)
|
||||
|
||||
Reference in New Issue
Block a user