Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
38bdf6c5e7
@ -19,8 +19,8 @@ from webnotes.utils import flt
|
||||
from webnotes.model.code import get_obj
|
||||
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Accounts Manager"},
|
||||
{"doctype":"Role", "name":"Accounts User"}
|
||||
{"doctype":"Role", "role_name":"Accounts Manager", "name":"Accounts Manager"},
|
||||
{"doctype":"Role", "role_name":"Accounts User", "name":"Accounts User"}
|
||||
]
|
||||
|
||||
@webnotes.whitelist()
|
||||
|
@ -334,10 +334,9 @@ cur_frm.cscript.tax_code = function(doc, dt, dn) {
|
||||
}
|
||||
|
||||
/* ***************************** UTILITY FUNCTIONS ************************ */
|
||||
|
||||
// Calculate Advance
|
||||
// ------------------
|
||||
var calc_total_advance = function(doc,cdt,cdn) {
|
||||
calc_total_advance = function(doc,cdt,cdn) {
|
||||
var doc = locals[doc.doctype][doc.name];
|
||||
var el = getchildren('Purchase Invoice Advance',doc.name,'advance_allocation_details')
|
||||
var tot_tds=0;
|
||||
|
@ -193,9 +193,14 @@ class DocType(TransactionBase):
|
||||
|
||||
item = webnotes.conn.sql("select default_income_account, default_sales_cost_center, default_warehouse from tabItem where name = '%s'" %(args['item_code']), as_dict=1)
|
||||
|
||||
ret['income_account'] = item and item[0]['default_income_account'] or dtl and dtl[0]['income_account'] or args['income_account']
|
||||
ret['cost_center'] = item and item[0]['default_sales_cost_center'] or dtl and dtl[0]['cost_center'] or args['cost_center']
|
||||
ret['warehouse'] = item and item[0]['default_warehouse'] or dtl and dtl[0]['warehouse'] or args['warehouse']
|
||||
ret['income_account'] = item and item[0].get('default_income_account') \
|
||||
or (dtl and dtl[0].get('income_account') or args.get('income_account'))
|
||||
|
||||
ret['cost_center'] = item and item[0].get('default_sales_cost_center') \
|
||||
or (dtl and dtl[0].get('cost_center') or args.get('cost_center'))
|
||||
|
||||
ret['warehouse'] = item and item[0].get('default_warehouse') \
|
||||
or (dtl and dtl[0].get('warehouse') or args.get('warehouse'))
|
||||
|
||||
if ret['warehouse']:
|
||||
actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (args['item_code'], ret['warehouse']))
|
||||
|
@ -1,6 +1,6 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Purchase Manager"},
|
||||
{"doctype":"Role", "name":"Purchase User"},
|
||||
{"doctype":"Role", "name":"Purchase Master Manager"},
|
||||
{"doctype":"Role", "name":"Supplier"}
|
||||
]
|
||||
{"doctype":"Role", "role_name":"Purchase Manager", "name":"Purchase Manager"},
|
||||
{"doctype":"Role", "role_name":"Purchase User", "name":"Purchase User"},
|
||||
{"doctype":"Role", "role_name":"Purchase Master Manager", "name":"Purchase Master Manager"},
|
||||
{"doctype":"Role", "role_name":"Supplier", "name":"Supplier"}
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Employee"},
|
||||
{"doctype":"Role", "name":"HR Manager"},
|
||||
{"doctype":"Role", "name":"HR User"},
|
||||
{"doctype":"Role", "role_name":"Employee", "name":"Employee"},
|
||||
{"doctype":"Role", "role_name":"HR Manager", "name":"HR Manager"},
|
||||
{"doctype":"Role", "role_name":"HR User", "name":"HR User"},
|
||||
]
|
||||
|
@ -57,7 +57,7 @@
|
||||
<div class="section-item">
|
||||
<a class="section-link"
|
||||
title = "List of holidays"
|
||||
href="#!List/Leave Allocation">Holiday List</a>
|
||||
href="#!List/Holiday List">Holiday List</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -129,7 +129,8 @@ def delete_search_criteria():
|
||||
'periodic_sales_summary', 'monthly_despatched_trend', 'sales', 'sales_order',
|
||||
'sales_order1', 'sales_agentwise_commission', 'test_report',
|
||||
'territory_wise_sales_-_target_vs_actual_',
|
||||
'pending_po_items_to_bill1', 'pending_po_items_to_receive1', 'expense_vouchers', 'pending_expense_vouchers')""")
|
||||
'pending_po_items_to_bill1', 'pending_po_items_to_receive1',
|
||||
'expense_vouchers', 'pending_expense_vouchers', 'shortage_to_indent')""")
|
||||
|
||||
webnotes.conn.sql("""
|
||||
DELETE FROM `tabSearch Criteria`
|
||||
|
@ -1,4 +1,4 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Production Manager"},
|
||||
{"doctype":"Role", "name":"Production User"},
|
||||
{"doctype":"Role", "role_name":"Production Manager", "name":"Production Manager"},
|
||||
{"doctype":"Role", "role_name":"Production User", "name":"Production User"},
|
||||
]
|
||||
|
@ -1,3 +1,3 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Projects User"},
|
||||
{"doctype":"Role", "role_name":"Projects User", "name":"Projects User"},
|
||||
]
|
||||
|
@ -52,4 +52,4 @@ cur_frm.cscript.project_value = function(doc, cdt, cdn){
|
||||
//--------- calculate gross profit --------------------------------
|
||||
cur_frm.cscript.est_material_cost = function(doc, cdt, cdn){
|
||||
get_server_fields('get_gross_profit','','',doc, cdt, cdn, 1);
|
||||
}
|
||||
}
|
||||
|
@ -119,4 +119,4 @@ cur_frm.cscript.declare_completed = function(){
|
||||
cur_frm.cscript.refresh(cur_frm.doc, cur_frm.doc.doctype, cur_frm.doc.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class DocType:
|
||||
|
||||
def get_allocated_to_name(self):
|
||||
as_em = sql("select first_name, last_name from `tabProfile` where name=%s",str(self.doc.allocated_to))
|
||||
ret = { 'allocated_to_name' : as_em and (as_em[0][0] + ' ' + as_em[0][1]) or ''}
|
||||
ret = { 'allocated_to_name' : as_em and (cstr(as_em[0][0]) + ' ' + cstr(as_em[0][1])) or ''}
|
||||
return ret
|
||||
|
||||
# validate
|
||||
@ -95,7 +95,7 @@ class DocType:
|
||||
sql("delete from tabEvent where ref_type='Task' and ref_name=%s", self.doc.name)
|
||||
self.add_calendar_event()
|
||||
else:
|
||||
msgprint("An Expeted start date has not been set for this task.Please set a, 'Expected Start date'\
|
||||
msgprint("An Expeted start date has not been set for this task.Please set 'Expected Start date'\
|
||||
to add an event to allocated persons calender.You can save a task without this also.")
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Customer"},
|
||||
{"doctype":"Role", "name":"Partner"},
|
||||
{"doctype":"Role", "name":"Sales Manager"},
|
||||
{"doctype":"Role", "name":"Sales Master Manager"},
|
||||
{"doctype":"Role", "name":"Sales User"},
|
||||
{"doctype":"Role", "role_name":"Customer", "name":"Customer"},
|
||||
{"doctype":"Role", "role_name":"Partner", "name":"Partner"},
|
||||
{"doctype":"Role", "role_name":"Sales Manager", "name":"Sales Manager"},
|
||||
{"doctype":"Role", "role_name":"Sales Master Manager", "name":"Sales Master Manager"},
|
||||
{"doctype":"Role", "role_name":"Sales User", "name":"Sales User"},
|
||||
]
|
||||
|
@ -1,3 +1,3 @@
|
||||
install_docs = [
|
||||
{'doctype':'Role', 'name': 'System Manager'}
|
||||
]
|
||||
{'doctype':'Role', 'role_name': 'System Manager', 'name': 'System Manager'}
|
||||
]
|
||||
|
@ -30,10 +30,10 @@ pscript.feature_dict = {
|
||||
'fs_projects': {
|
||||
'BOM': {'fields':['project_name']},
|
||||
'Delivery Note': {'fields':['project_name']},
|
||||
'Purchase Invoice': {'fields':['project_name']},
|
||||
'Purchase Invoice': {'entries':['project_name']},
|
||||
'Production Order': {'fields':['project_name']},
|
||||
'Purchase Order': {'fields':['project_name']},
|
||||
'Purchase Receipt': {'fields':['project_name']},
|
||||
'Purchase Order': {'po_details':['project_name']},
|
||||
'Purchase Receipt': {'purchase_receipt_details':['project_name']},
|
||||
'Sales Invoice': {'fields':['project_name']},
|
||||
'Sales Order': {'fields':['project_name']},
|
||||
'Stock Entry': {'fields':['project_name']},
|
||||
|
@ -1,6 +1,6 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Material Manager"},
|
||||
{"doctype":"Role", "name":"Material Master Manager"},
|
||||
{"doctype":"Role", "name":"Material User"},
|
||||
{"doctype":"Role", "name":"Quality Manager"},
|
||||
{"doctype":"Role", "role_name":"Material Manager", "name":"Material Manager"},
|
||||
{"doctype":"Role", "role_name":"Material Master Manager", "name":"Material Master Manager"},
|
||||
{"doctype":"Role", "role_name":"Material User", "name":"Material User"},
|
||||
{"doctype":"Role", "role_name":"Quality Manager", "name":"Quality Manager"},
|
||||
]
|
||||
|
@ -44,17 +44,17 @@ cur_frm.fields_dict.purchase_receipt_no.get_query = function(doc) {
|
||||
cur_frm.cscript.return_type = function(doc, cdt, cdn) {
|
||||
var cp = wn.control_panel;
|
||||
hide_field(['purchase_receipt_no', 'delivery_note_no', 'sales_invoice_no',
|
||||
'return_details', 'Get Items', 'Make Excise Invoice', 'Make Stock Entry',
|
||||
'return_details', 'get_items', 'Make Excise Invoice', 'Make Stock Entry',
|
||||
'Make Debit Note', 'Make Credit Note']);
|
||||
|
||||
if(doc.return_type == 'Sales Return') {
|
||||
unhide_field(['delivery_note_no', 'sales_invoice_no', 'Get Items',
|
||||
unhide_field(['delivery_note_no', 'sales_invoice_no', 'get_items',
|
||||
'return_details', 'Make Credit Note', 'Make Stock Entry']);
|
||||
|
||||
if(cp.country == 'India') { unhide_field(['Make Excise Invoice']); }
|
||||
|
||||
} else if(doc.return_type == 'Purchase Return') {
|
||||
unhide_field(['purchase_receipt_no', 'Get Items', 'return_details',
|
||||
unhide_field(['purchase_receipt_no', 'get_items', 'return_details',
|
||||
'Make Debit Note', 'Make Stock Entry']);
|
||||
|
||||
if(cp.country == 'India') { unhide_field(['Make Excise Invoice']); }
|
||||
|
@ -1,6 +1,6 @@
|
||||
install_docs = [
|
||||
{'doctype':'Role', 'name':'Support Team'},
|
||||
{'doctype':'Role', 'name':'Support Manager'},
|
||||
{'doctype':'Role', 'name':'Maintenance User'},
|
||||
{'doctype':'Role', 'name':'Maintenance Manager'}
|
||||
]
|
||||
{'doctype':'Role', 'role_name':'Support Team', 'name':'Support Team'},
|
||||
{'doctype':'Role', 'role_name':'Support Manager', 'name':'Support Manager'},
|
||||
{'doctype':'Role', 'role_name':'Maintenance User', 'name':'Maintenance User'},
|
||||
{'doctype':'Role', 'role_name':'Maintenance Manager', 'name':'Maintenance Manager'}
|
||||
]
|
||||
|
@ -10,6 +10,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
||||
"`tabSupport Ticket`.description"
|
||||
]);
|
||||
this.stats = this.stats.concat(['status']);
|
||||
this.show_hide_check_column();
|
||||
},
|
||||
|
||||
prepare_data: function(data) {
|
||||
@ -43,9 +44,10 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
|
||||
},
|
||||
|
||||
columns: [
|
||||
{width: '3%', content:'check'},
|
||||
{width: '20%', content:'name'},
|
||||
{width: '10%', content:'status_html'},
|
||||
{width: '56%', content:'tags+description', css: {color:'#aaa'}},
|
||||
{width: '53%', content:'tags+description', css: {color:'#aaa'}},
|
||||
{width: '14%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
|
||||
]
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
install_docs = [
|
||||
{"doctype":"Role", "name":"Blogger"},
|
||||
{"doctype":"Role", "name":"Website Manager"},
|
||||
]
|
||||
{"doctype":"Role", "role_name":"Blogger", "name":"Blogger"},
|
||||
{"doctype":"Role", "role_name":"Website Manager", "name":"Website Manager"},
|
||||
]
|
||||
|
File diff suppressed because one or more lines are too long
@ -177,7 +177,7 @@ if(this.show_filters){this.make_filters();}},add_button:function(label,click,ico
|
||||
if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){wn.views.formview.create(me.new_doctype)},'icon-plus');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype);},'icon-plus');}
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
|
||||
if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
this.onrun=a0;if(a0&&a0.callback)
|
||||
@ -289,7 +289,7 @@ args.label=v[0];args.width=flt(v[1])/max*100;args.count=v[1];args.field=field;$i
|
||||
%(label)s</a> \
|
||||
(%(count)s)</div>\
|
||||
</div>',args));this.setup_stat_item_click($item);return $item;},setup_stat_item_click:function($item){var me=this;$item.find('a').click(function(){var fieldname=$(this).attr('data-field');var label=$(this).attr('data-label');me.set_filter(fieldname,label);return false;});},set_filter:function(fieldname,label){var filter=this.filter_list.get_filter(fieldname);if(filter){var v=filter.field.get_value();if(v.indexOf(label)!=-1){return false;}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{filter.set_values(fieldname,'in',v+', '+label);}}}else{if(fieldname=='_user_tags'){this.filter_list.add_filter(fieldname,'like','%'+label);}else{this.filter_list.add_filter(fieldname,'=',label);}}
|
||||
this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});}
|
||||
this.run();}});wn.views.ListView=Class.extend({init:function(doclistview){this.doclistview=doclistview;this.doctype=doclistview.doctype;var t="`tab"+this.doctype+"`.";this.fields=[t+'name',t+'owner',t+'docstatus',t+'_user_tags',t+'modified'];this.stats=['_user_tags'];this.show_hide_check_column();},columns:[{width:'3%',content:'check'},{width:'4%',content:'avatar'},{width:'3%',content:'docstatus',css:{"text-align":"center"}},{width:'35%',content:'name'},{width:'40%',content:'tags',css:{'color':'#aaa'}},{width:'15%',content:'modified',css:{'text-align':'right','color':'#777'}}],render_column:function(data,parent,opts){var me=this;if(opts.css){$.each(opts.css,function(k,v){$(parent).css(k,v)});}
|
||||
if(opts.content.indexOf&&opts.content.indexOf('+')!=-1){$.map(opts.content.split('+'),function(v){me.render_column(data,parent,{content:v});});return;}
|
||||
if(typeof opts.content=='function'){opts.content(parent,data);}
|
||||
else if(opts.content=='name'){$(parent).append(repl('<a href="#!Form/%(doctype)s/%(name)s">%(name)s</a>',data));}
|
||||
@ -310,7 +310,7 @@ else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:f
|
||||
if(diff==1){data.when='Yesterday'}
|
||||
if(diff==2){data.when='2 days ago'}
|
||||
if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer">'
|
||||
+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}}})
|
||||
+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}},show_hide_check_column:function(){if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}}})
|
||||
/*
|
||||
* lib/js/wn/views/pageview.js
|
||||
*/
|
||||
@ -686,7 +686,7 @@ if(this.show_filters){this.make_filters();}},add_button:function(label,click,ico
|
||||
if(icon){$('<i>').addClass(icon).appendTo($button);}
|
||||
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
|
||||
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){wn.views.formview.create(me.new_doctype)},'icon-plus');}
|
||||
if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype);},'icon-plus');}
|
||||
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
|
||||
if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
|
||||
this.onrun=a0;if(a0&&a0.callback)
|
||||
|
Loading…
x
Reference in New Issue
Block a user