mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
use validate value method to validate valuation rate should be greater than 0 in stock entry
This commit is contained in:
@@ -17,7 +17,8 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
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.utils import comma_and
|
||||||
from webnotes.model.doc import make_autoname
|
from webnotes.model.doc import make_autoname
|
||||||
from webnotes.model.bean import getlist
|
from webnotes.model.bean import getlist
|
||||||
|
|||||||
@@ -207,9 +207,8 @@ class DocType(TransactionBase):
|
|||||||
|
|
||||||
def validate_incoming_rate(self):
|
def validate_incoming_rate(self):
|
||||||
for d in getlist(self.doclist, 'mtn_details'):
|
for d in getlist(self.doclist, 'mtn_details'):
|
||||||
if not flt(d.incoming_rate) and d.t_warehouse:
|
if d.t_warehouse:
|
||||||
msgprint("Rate is mandatory for Item: %s at row %s" % (d.item_code, d.idx),
|
self.validate_value("incoming_rate", ">", 0, d)
|
||||||
raise_exception=1)
|
|
||||||
|
|
||||||
def validate_bom(self):
|
def validate_bom(self):
|
||||||
for d in getlist(self.doclist, 'mtn_details'):
|
for d in getlist(self.doclist, 'mtn_details'):
|
||||||
|
|||||||
Reference in New Issue
Block a user