fixes in warehouse validation

This commit is contained in:
Anand Doshi
2013-03-11 19:44:52 +05:30
parent 88ac485541
commit df6ff1385f
13 changed files with 59 additions and 35 deletions

View File

@@ -21,7 +21,7 @@
wn.provide("erpnext.buying");
erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
erpnext.buying.BuyingController = wn.ui.form.Controller.extend({
setup: function() {
var me = this;

View File

@@ -132,6 +132,10 @@ class DocType(BuyingController):
for d in getlist(self.doclist, 'po_details'):
#1. Check if is_stock_item == 'Yes'
if webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == "Yes":
# this happens when item is changed from non-stock to stock item
if not d.warehouse:
continue
ind_qty, po_qty = 0, flt(d.qty) * flt(d.conversion_factor)
if is_stopped:
po_qty = flt(d.qty) > flt(d.received_qty) and \