use validate value method to validate valuation rate should be greater than 0 in stock entry

This commit is contained in:
Anand Doshi 2013-03-05 12:25:15 +05:30
parent 9bba9ed4d2
commit 1f3a5c3798
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,8 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, sendmail
from webnotes.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate
from webnotes.utils.email_lib import sendmail
from webnotes.utils import comma_and
from webnotes.model.doc import make_autoname
from webnotes.model.bean import getlist

View File

@ -207,9 +207,8 @@ class DocType(TransactionBase):
def validate_incoming_rate(self):
for d in getlist(self.doclist, 'mtn_details'):
if not flt(d.incoming_rate) and d.t_warehouse:
msgprint("Rate is mandatory for Item: %s at row %s" % (d.item_code, d.idx),
raise_exception=1)
if d.t_warehouse:
self.validate_value("incoming_rate", ">", 0, d)
def validate_bom(self):
for d in getlist(self.doclist, 'mtn_details'):