mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
[minor] removed mandatory validation in server side
This commit is contained in:
@@ -4,7 +4,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.utils import date_diff
|
from webnotes.utils import date_diff
|
||||||
from webnotes import _
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
|
||||||
@@ -64,11 +63,6 @@ def get_fifo_queue(filters):
|
|||||||
return item_details
|
return item_details
|
||||||
|
|
||||||
def get_stock_ledger_entries(filters):
|
def get_stock_ledger_entries(filters):
|
||||||
if not filters.get("company"):
|
|
||||||
webnotes.throw(_("Company is mandatory"))
|
|
||||||
if not filters.get("to_date"):
|
|
||||||
webnotes.throw(_("To Date is mandatory"))
|
|
||||||
|
|
||||||
return webnotes.conn.sql("""select
|
return webnotes.conn.sql("""select
|
||||||
item.name, item.item_name, brand, description, item.stock_uom, actual_qty, posting_date
|
item.name, item.item_name, brand, description, item.stock_uom, actual_qty, posting_date
|
||||||
from `tabStock Ledger Entry` sle,
|
from `tabStock Ledger Entry` sle,
|
||||||
|
|||||||
@@ -3,19 +3,17 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes import _
|
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
columns = get_columns()
|
columns = get_columns()
|
||||||
if not filters.get("company"):
|
|
||||||
webnotes.throw(_("Company is mandatory"))
|
|
||||||
|
|
||||||
data = webnotes.conn.sql("""select
|
data = webnotes.conn.sql("""select
|
||||||
item.name, item.item_name, description, brand, warehouse, item.stock_uom,
|
item.name, item.item_name, description, brand, warehouse, item.stock_uom,
|
||||||
actual_qty, planned_qty, indented_qty, ordered_qty, reserved_qty,
|
actual_qty, planned_qty, indented_qty, ordered_qty, reserved_qty,
|
||||||
projected_qty, item.re_order_level, item.re_order_qty
|
projected_qty, item.re_order_level, item.re_order_qty
|
||||||
from `tabBin` bin,
|
from `tabBin` bin,
|
||||||
(select name, company from tabWarehouse {warehouse_conditions}) wh,
|
(select name, company from tabWarehouse
|
||||||
|
where company=%(company)s {warehouse_conditions}) wh,
|
||||||
(select name, item_name, description, stock_uom, brand, re_order_level, re_order_qty
|
(select name, item_name, description, stock_uom, brand, re_order_level, re_order_qty
|
||||||
from `tabItem` {item_conditions}) item
|
from `tabItem` {item_conditions}) item
|
||||||
where item_code = item.name and warehouse = wh.name
|
where item_code = item.name and warehouse = wh.name
|
||||||
@@ -42,13 +40,4 @@ def get_item_conditions(filters):
|
|||||||
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
|
|
||||||
def get_warehouse_conditions(filters):
|
def get_warehouse_conditions(filters):
|
||||||
conditions = []
|
return " and name=%(warehouse)s" if filters.get("warehouse") else ""
|
||||||
if not filters.get("company"):
|
|
||||||
webnotes.throw(_("Company is mandatory"))
|
|
||||||
else:
|
|
||||||
conditions.append("company=%(company)s")
|
|
||||||
|
|
||||||
if filters.get("warehouse"):
|
|
||||||
conditions.append("name=%(warehouse)s")
|
|
||||||
|
|
||||||
return "where {}".format(" and ".join(conditions)) if conditions else ""
|
|
||||||
Reference in New Issue
Block a user