sales person fix

This commit is contained in:
Ravi Dey 2011-07-05 12:11:40 +05:30
parent d958262761
commit 1b6d158f27

View File

@ -5,14 +5,13 @@ from webnotes.model.doc import Document
from webnotes.model.doclist import getlist from webnotes.model.doclist import getlist
from webnotes.model.code import get_obj from webnotes.model.code import get_obj
from webnotes import session, form, is_testing, msgprint, errprint from webnotes import session, form, is_testing, msgprint, errprint
from webnotes.utils import flt
sql = webnotes.conn.sql sql = webnotes.conn.sql
convert_to_lists = webnotes.conn.convert_to_lists convert_to_lists = webnotes.conn.convert_to_lists
# ----------------------------------------------------------------------------------------- # -----------------------------------------------------------------------------------------
class DocType: class DocType:
def __init__(self, doc, doclist=[]): def __init__(self, doc, doclist=[]):
self.doc = doc self.doc = doc
@ -37,7 +36,6 @@ class DocType:
def validate(self): def validate(self):
from webnotes.utils import flt
for d in getlist(self.doclist, 'target_details'): for d in getlist(self.doclist, 'target_details'):
if not flt(d.target_qty) and not flt(d.target_amount): if not flt(d.target_qty) and not flt(d.target_amount):
msgprint("Either target qty or target amount is mandatory.") msgprint("Either target qty or target amount is mandatory.")
@ -64,5 +62,3 @@ class DocType:
d.is_sales_person = 1 d.is_sales_person = 1
d.save(new = (not d.name)) d.save(new = (not d.name))