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

View File

@ -5,7 +5,7 @@
{ {
'creation': '2012-04-13 11:56:18', 'creation': '2012-04-13 11:56:18',
'docstatus': 0, 'docstatus': 0,
'modified': '2012-05-02 09:57:50', 'modified': '2012-05-04 11:56:59',
'modified_by': u'Administrator', 'modified_by': u'Administrator',
'owner': u'Administrator' 'owner': u'Administrator'
}, },
@ -296,19 +296,6 @@
'search_index': 1 '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 # DocField
{ {
'colour': u'White:FFF', 'colour': u'White:FFF',
@ -327,6 +314,18 @@
'search_index': 0 '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 # DocField
{ {
'colour': u'White:FFF', 'colour': u'White:FFF',
@ -1091,6 +1090,19 @@
'print_hide': 1 '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 # DocField
{ {
'allow_on_submit': 1, 'allow_on_submit': 1,
@ -1106,18 +1118,6 @@
'print_hide': 1 '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 # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',

View File

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

View File

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

View File

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

View File

@ -183,7 +183,6 @@ class DocType(TransactionBase):
self.validate_reference_value() self.validate_reference_value()
self.validate_for_items() self.validate_for_items()
sales_com_obj.make_packing_list(self,'delivery_note_details') 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.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.get_allocated_sum(self) # this is to verify that the allocated % of sales persons is 100%
sales_com_obj.check_conversion_rate(self) sales_com_obj.check_conversion_rate(self)
@ -325,6 +324,7 @@ class DocType(TransactionBase):
# Check for Approving Authority # Check for Approving Authority
get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self) 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 = get_obj("Stock Ledger")
sl_obj.validate_serial_no(self, 'packing_details')
sl_obj.validate_serial_no_warehouse(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) sl_obj.update_serial_record(self, 'packing_details', is_submit = 1, is_incoming = 0)
get_obj("Sales Common").update_prevdoc_detail(1,self) 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) { cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(!doc.__islocal) {
hide_field('new_item_code');
}
} }
/* Get Item Code */ /* Get Item Code */

View File

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

View File

@ -3,9 +3,9 @@
# These values are common in all dictionaries # These values are common in all dictionaries
{ {
'creation': '2012-04-26 13:04:56', 'creation': '2012-04-30 12:08:49',
'docstatus': 0, 'docstatus': 0,
'modified': '2012-04-27 11:00:18', 'modified': '2012-05-04 09:53:08',
'modified_by': u'Administrator', 'modified_by': u'Administrator',
'owner': u'Administrator' 'owner': u'Administrator'
}, },
@ -15,6 +15,7 @@
'_last_update': u'1322549701', '_last_update': u'1322549701',
'allow_trash': 1, 'allow_trash': 1,
'colour': u'White:FFF', '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', 'doctype': 'DocType',
'document_type': u'Master', 'document_type': u'Master',
'is_submittable': 1, 'is_submittable': 1,
@ -143,6 +144,8 @@
# DocField # DocField
{ {
'colour': u'White:FFF',
'description': u'Item code of the new aggregate item.',
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'new_item_code', 'fieldname': u'new_item_code',
'fieldtype': u'Data', 'fieldtype': u'Data',
@ -150,12 +153,12 @@
'no_copy': 1, 'no_copy': 1,
'oldfieldname': u'new_item_code', 'oldfieldname': u'new_item_code',
'oldfieldtype': u'Data', 'oldfieldtype': u'Data',
'permlevel': 1,
'reqd': 1 'reqd': 1
}, },
# DocField # DocField
{ {
'colour': u'White:FFF',
'doctype': u'DocField', 'doctype': u'DocField',
'fieldname': u'new_item_name', 'fieldname': u'new_item_name',
'fieldtype': u'Data', 'fieldtype': u'Data',
@ -221,7 +224,8 @@
'oldfieldname': u'stock_uom', 'oldfieldname': u'stock_uom',
'oldfieldtype': u'Link', 'oldfieldtype': u'Link',
'options': u'UOM', 'options': u'UOM',
'permlevel': 0 'permlevel': 0,
'reqd': 1
}, },
# DocField # DocField
@ -280,17 +284,7 @@
# DocField # DocField
{ {
'colour': u'White:FFF', 'colour': u'White:FFF',
'doctype': u'DocField', 'description': u'List items that form a package. One of the items has to be a "main item".',
'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', 'doctype': u'DocField',
'fieldname': u'item_section', 'fieldname': u'item_section',
'fieldtype': u'Section Break', 'fieldtype': u'Section Break',
@ -310,6 +304,19 @@
'permlevel': 0 '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 # DocField
{ {
'doctype': u'DocField', 'doctype': u'DocField',

View File

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

View File

@ -40,7 +40,7 @@ erpnext.navbar.Navbar = Class.extend({
</ul>\ </ul>\
<img src="lib/images/ui/spinner.gif" id="spinner"/>\ <img src="lib/images/ui/spinner.gif" id="spinner"/>\
<ul class="nav pull-right">\ <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>\ </ul>\
</div>\ </div>\
</div>\ </div>\

View File

@ -879,7 +879,7 @@ wn.provide('erpnext.navbar');erpnext.navbar.Navbar=Class.extend({init:function()
</ul>\ </ul>\
<img src="lib/images/ui/spinner.gif" id="spinner"/>\ <img src="lib/images/ui/spinner.gif" id="spinner"/>\
<ul class="nav pull-right">\ <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>\ </ul>\
</div>\ </div>\
</div>\ </div>\