Browse Source

Merge pull request #27028 from noahjacob/prompt_warehouse_fix

fix: incorrect mandatory error message for warehouse
develop
Nabin Hait 3 years ago
committed by GitHub
parent
commit
657e61ae6d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      erpnext/stock/doctype/stock_entry/stock_entry.py

7
erpnext/stock/doctype/stock_entry/stock_entry.py

@ -317,9 +317,6 @@ class StockEntry(StockController):
d.s_warehouse = self.from_warehouse
d.t_warehouse = self.to_warehouse
if not (d.s_warehouse or d.t_warehouse):
frappe.throw(_("Atleast one warehouse is mandatory"))
if self.purpose in source_mandatory and not d.s_warehouse:
if self.from_warehouse:
d.s_warehouse = self.from_warehouse
@ -332,6 +329,7 @@ class StockEntry(StockController):
else:
frappe.throw(_("Target warehouse is mandatory for row {0}").format(d.idx))
if self.purpose == "Manufacture":
if validate_for_manufacture:
if d.is_finished_item or d.is_scrap_item:
@ -346,6 +344,9 @@ class StockEntry(StockController):
if cstr(d.s_warehouse) == cstr(d.t_warehouse) and not self.purpose == "Material Transfer for Manufacture":
frappe.throw(_("Source and target warehouse cannot be same for row {0}").format(d.idx))
if not (d.s_warehouse or d.t_warehouse):
frappe.throw(_("Atleast one warehouse is mandatory"))
def validate_work_order(self):
if self.purpose in ("Manufacture", "Material Transfer for Manufacture", "Material Consumption for Manufacture"):
# check if work order is entered

Loading…
Cancel
Save