Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename

This commit is contained in:
Anand Doshi 2012-05-04 13:05:36 +05:30
commit 837baee1b4
12 changed files with 74 additions and 79 deletions

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-04-30 12:08:36',
'creation': '2012-05-01 17:10:24',
'docstatus': 0,
'modified': '2012-04-30 15:59:52',
'modified': '2012-05-04 10:05:25',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -521,11 +521,11 @@
'doctype': u'DocField',
'fieldname': u'pay_to_recd_from',
'fieldtype': u'Data',
'hidden': 1,
'hidden': 0,
'label': u'Pay To / Recd From',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1,
'print_hide': 0,
'report_hide': 1
},

View File

@ -5,7 +5,7 @@
{
'creation': '2012-04-13 11:56:18',
'docstatus': 0,
'modified': '2012-05-02 09:57:50',
'modified': '2012-05-04 11:56:59',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -296,19 +296,6 @@
'search_index': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'posting_time',
'fieldtype': u'Time',
'label': u'Posting Time',
'no_copy': 1,
'oldfieldname': u'posting_time',
'oldfieldtype': u'Time',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'colour': u'White:FFF',
@ -327,6 +314,18 @@
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'mode_of_payment',
'fieldtype': u'Select',
'label': u'Mode of Payment',
'oldfieldname': u'mode_of_payment',
'oldfieldtype': u'Select',
'options': u'link:Mode of Payment',
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
@ -1091,6 +1090,19 @@
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'posting_time',
'fieldtype': u'Time',
'label': u'Posting Time',
'no_copy': 1,
'oldfieldname': u'posting_time',
'oldfieldtype': u'Time',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'allow_on_submit': 1,
@ -1106,18 +1118,6 @@
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'mode_of_payment',
'fieldtype': u'Select',
'label': u'Mode of Payment',
'oldfieldname': u'mode_of_payment',
'oldfieldtype': u'Select',
'options': u'link:Mode of Payment',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',

View File

@ -80,14 +80,8 @@ report.get_query = function() {
add_col = '';
add_tables = '';
sp_cond = '';
if(trans == 'Sales Invoice') trans = 'Sales Invoice';
else if(trans == 'Purchase Invoice') trans = 'Purchase Invoice';
trans_det = trans+' Detail'
if(trans == 'Sales Invoice') trans_det = 'Sales Invoice Item';
else if(trans == 'Purchase Invoice') trans_det = 'Purchase Invoice Item';
else if(trans == 'Purchase Order') trans_det = 'Purchase Order Item';
trans_det = trans+' Item'
if(order_type != '') add_code += ' AND t1.order_type = '+order_type;

View File

@ -39,14 +39,8 @@ project = filter_values.get('project')
# ********************************************* SET DEFAULTS **************************************************
# Details Table
# --------------
if trans == 'Sales Invoice': trans = 'Sales Invoice'
elif trans == 'Purchase Invoice': trans = 'Purchase Invoice'
trans_det = trans+' Detail'
if trans == 'Sales Invoice': trans_det = 'Sales Invoice Item'
elif trans == 'Purchase Invoice': trans_det = 'Purchase Invoice Item'
elif trans == 'Purchase Order': trans_det = 'Purchase Order Item'
trans_det = trans+' Item'
col_names, query_val = get_obj('Trend Analyzer Control').get_single_year_query_value(fiscal_year, period, trans, trans_det)
query_val += 'SUM(t2.qty), SUM(t2.amount)'

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-04-03 12:49:53',
'creation': '2012-04-23 12:46:00',
'docstatus': 0,
'modified': '2012-04-03 12:49:53',
'modified': '2012-05-04 12:49:43',
'modified_by': u'Administrator',
'owner': u'saumil@webnotestech.com'
},

View File

@ -183,7 +183,6 @@ class DocType(TransactionBase):
self.validate_reference_value()
self.validate_for_items()
sales_com_obj.make_packing_list(self,'delivery_note_details')
get_obj('Stock Ledger').validate_serial_no(self, 'packing_details')
sales_com_obj.validate_max_discount(self, 'delivery_note_details') #verify whether rate is not greater than max discount
sales_com_obj.get_allocated_sum(self) # this is to verify that the allocated % of sales persons is 100%
sales_com_obj.check_conversion_rate(self)
@ -325,6 +324,7 @@ class DocType(TransactionBase):
# Check for Approving Authority
get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self)
sl_obj = get_obj("Stock Ledger")
sl_obj.validate_serial_no(self, 'packing_details')
sl_obj.validate_serial_no_warehouse(self, 'packing_details')
sl_obj.update_serial_record(self, 'packing_details', is_submit = 1, is_incoming = 0)
get_obj("Sales Common").update_prevdoc_detail(1,self)

View File

@ -22,7 +22,9 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(!doc.__islocal) {
hide_field('new_item_code');
}
}
/* Get Item Code */

View File

@ -38,8 +38,7 @@ class DocType:
self.doc, self.doclist = d,dl
def autoname(self):
self.doc.name = make_autoname(self.doc.new_item_code)
self.doc.name = self.doc.new_item_code
# Get Ref Rates
# --------------
@ -67,9 +66,9 @@ class DocType:
msgprint("Sales Bom Item " + d.item_code +" cannot be child item.")
raise Exception
# Check if is_main_item is modified once saved
if not self.doc.fields.get('__islocal') and d.is_main_item == "Yes" and cstr(d.item_code) != cstr(self.doc.new_item_code)[:-3] :
msgprint("Modifying the main item is not allowed.")
raise Exception
#if not self.doc.fields.get('__islocal') and d.is_main_item == "Yes" and cstr(d.item_code) != cstr(self.doc.new_item_code)[:-3] :
# msgprint("Modifying the main item is not allowed.")
# raise Exception
if len(is_main_item) > 1:
msgprint('Main item cannot be more than one.')
raise Exception , " Validation Error."

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-04-26 13:04:56',
'creation': '2012-04-30 12:08:49',
'docstatus': 0,
'modified': '2012-04-27 11:00:18',
'modified': '2012-05-04 09:53:08',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -15,6 +15,7 @@
'_last_update': u'1322549701',
'allow_trash': 1,
'colour': u'White:FFF',
'description': u'Aggregate item and accessories to form a Sales Item. There is no inventory of the new item but of the sub-components.',
'doctype': 'DocType',
'document_type': u'Master',
'is_submittable': 1,
@ -143,6 +144,8 @@
# DocField
{
'colour': u'White:FFF',
'description': u'Item code of the new aggregate item.',
'doctype': u'DocField',
'fieldname': u'new_item_code',
'fieldtype': u'Data',
@ -150,12 +153,12 @@
'no_copy': 1,
'oldfieldname': u'new_item_code',
'oldfieldtype': u'Data',
'permlevel': 1,
'reqd': 1
},
# DocField
{
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'new_item_name',
'fieldtype': u'Data',
@ -221,7 +224,8 @@
'oldfieldname': u'stock_uom',
'oldfieldtype': u'Link',
'options': u'UOM',
'permlevel': 0
'permlevel': 0,
'reqd': 1
},
# DocField
@ -280,17 +284,7 @@
# DocField
{
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'find_sales_bom',
'fieldtype': u'Button',
'label': u'Find Sales BOM',
'oldfieldtype': u'Button',
'permlevel': 0,
'trigger': u'Client'
},
# DocField
{
'description': u'List items that form a package. One of the items has to be a "main item".',
'doctype': u'DocField',
'fieldname': u'item_section',
'fieldtype': u'Section Break',
@ -310,6 +304,19 @@
'permlevel': 0
},
# DocField
{
'colour': u'White:FFF',
'description': u'Add a few items and find if there are any Sales BOM created with the same combination to help you identify duplication.',
'doctype': u'DocField',
'fieldname': u'find_sales_bom',
'fieldtype': u'Button',
'label': u'Find Sales BOM',
'oldfieldtype': u'Button',
'permlevel': 0,
'trigger': u'Client'
},
# DocField
{
'doctype': u'DocField',

View File

@ -47,13 +47,13 @@ class DocType:
return content
def convert_into_list(self, data):
def convert_into_list(self, data, submit = 1):
"""Convert csv data into list"""
count = 1
count = 2
for s in data:
if s[0].strip() != 'Item Code': # remove the labels
# validate
if len(s) != 4:
if (submit and len(s) != 4) or (not submit and len(s) != 6):
msgprint("Data entered at Row No " + cstr(count) + " in Attachment File is not in correct format.", raise_exception=1)
self.validated = 0
self.validate_item(s[0], count)
@ -66,17 +66,16 @@ class DocType:
raise Exception
def get_reconciliation_data(self,submit = 0):
def get_reconciliation_data(self,submit = 1):
"""Read and validate csv data"""
import csv
data = csv.reader(self.get_csv_file_data().splitlines())
self.convert_into_list(data)
self.convert_into_list(data, submit)
def validate_item(self, item, count):
""" Validate item exists and non-serialized"""
det = sql("select item_code, has_serial_no from `tabItem` \
where name = %s", cstr(item), as_dict = 1)
det = sql("select item_code, has_serial_no from `tabItem` where name = %s", cstr(item), as_dict = 1)
if not det:
msgprint("Item: " + cstr(item) + " mentioned at Row No. " + cstr(count) + "does not exist in the system")
self.validated = 0
@ -199,5 +198,5 @@ class DocType:
def on_cancel(self):
self.validate()
self.get_reconciliation_data(submit = 0)
self.do_stock_reco(is_submit = -1)

View File

@ -40,7 +40,7 @@ erpnext.navbar.Navbar = Class.extend({
</ul>\
<img src="lib/images/ui/spinner.gif" id="spinner"/>\
<ul class="nav pull-right">\
<li id="#login-topbar-item"><a href="#!Login Page">Login</a></li>\
<li id="login-topbar-item"><a href="#!Login Page">Login</a></li>\
</ul>\
</div>\
</div>\

View File

@ -879,7 +879,7 @@ wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function()
</ul>\
<img src="lib/images/ui/spinner.gif" id="spinner"/>\
<ul class="nav pull-right">\
<li id="#login-topbar-item"><a href="#!Login Page">Login</a></li>\
<li id="login-topbar-item"><a href="#!Login Page">Login</a></li>\
</ul>\
</div>\
</div>\