[minor] allow stock entry for manufacture without production order

This commit is contained in:
Rushabh Mehta 2015-12-03 11:10:23 +05:30
parent ba2596a7e0
commit 2c069a418a
2 changed files with 11 additions and 13 deletions

View File

@ -171,7 +171,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
}, },
toggle_enable_bom: function() { toggle_enable_bom: function() {
this.frm.toggle_enable("bom_no", !in_list(["Manufacture", "Material Transfer for Manufacture"], this.frm.doc.purpose)); this.frm.toggle_enable("bom_no", !!!this.frm.doc.production_order);
}, },
add_excise_button: function() { add_excise_button: function() {

View File

@ -170,10 +170,8 @@ class StockEntry(StockController):
def validate_production_order(self): def validate_production_order(self):
if self.purpose in ("Manufacture", "Material Transfer for Manufacture"): if self.purpose in ("Manufacture", "Material Transfer for Manufacture"):
# check if production order is entered # check if production order is entered
if not self.production_order:
frappe.throw(_("Production order number is mandatory for stock entry purpose manufacture")) if self.purpose=="Manufacture" and self.production_order:
# check for double entry
if self.purpose=="Manufacture":
if not self.fg_completed_qty: if not self.fg_completed_qty:
frappe.throw(_("For Quantity (Manufactured Qty) is mandatory")) frappe.throw(_("For Quantity (Manufactured Qty) is mandatory"))
self.check_if_operations_completed() self.check_if_operations_completed()