[aii] [patches] minor fixes

This commit is contained in:
Anand Doshi
2013-03-29 20:40:23 +05:30
parent 96a5f1dda0
commit 19acce9fa1
9 changed files with 42 additions and 11 deletions

View File

@@ -17,7 +17,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, flt
from webnotes.utils import cstr, flt, cint
from webnotes.model.doc import addchild
from webnotes.model.bean import getlist
from webnotes import msgprint, _
@@ -119,7 +119,7 @@ class DocType(DocListController):
def check_ref_rate_detail(self):
check_list=[]
for d in getlist(self.doclist,'ref_rate_details'):
if [cstr(d.price_list_name),cstr(d.ref_currency)] in check_list:
if [cstr(d.price_list_name),cstr(d.ref_currency),cint(d.selling),cint(d.buying)] in check_list:
msgprint("Ref Rate is entered twice for Price List : '%s' and Currency : '%s'." % (d.price_list_name,d.ref_currency))
raise Exception
else:

View File

@@ -360,7 +360,8 @@ cur_frm.cscript.uom = function(doc, cdt, cdn) {
cur_frm.cscript.validate = function(doc, cdt, cdn) {
cur_frm.cscript.validate_items(doc);
validated = cur_frm.cscript.get_doctype_docname() ? true : false;
if($.inArray(cur_frm.doc.purpose, ["Purchase Return", "Sales Return"])!==-1)
validated = cur_frm.cscript.get_doctype_docname() ? true : false;
}
cur_frm.cscript.validate_items = function(doc) {

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-02-22 01:28:04",
"creation": "2013-03-29 18:22:12",
"docstatus": 0,
"modified": "2013-03-07 07:03:32",
"modified": "2013-03-29 19:43:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -158,6 +158,7 @@
"label": "Conversion Factor",
"oldfieldname": "conversion_factor",
"oldfieldtype": "Currency",
"print_hide": 1,
"read_only": 1,
"reqd": 1
},
@@ -168,6 +169,7 @@
"label": "Qty as per Stock UOM",
"oldfieldname": "transfer_qty",
"oldfieldtype": "Currency",
"print_hide": 1,
"read_only": 1,
"reqd": 1
},
@@ -180,6 +182,7 @@
"oldfieldname": "stock_uom",
"oldfieldtype": "Link",
"options": "UOM",
"print_hide": 1,
"read_only": 1,
"reqd": 1,
"search_index": 0