Merge branch 'shf_rename' of github.com:webnotes/erpnext into shf_rename
This commit is contained in:
commit
ff81c37689
@ -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
|
||||
},
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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."
|
||||
|
@ -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',
|
||||
|
@ -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>\
|
||||
|
@ -331,8 +331,8 @@ if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:funct
|
||||
/*
|
||||
* lib/js/wn/ui/filters.js
|
||||
*/
|
||||
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length)
|
||||
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length)
|
||||
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||
values.push(f.get_value());})
|
||||
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
||||
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
||||
@ -839,7 +839,7 @@ if(this.txt){try{this.txt.focus();}catch(e){}
|
||||
this.txt.field_object=this;}}
|
||||
function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
|
||||
v=this.validate(v);return v;}
|
||||
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val;}
|
||||
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
|
||||
me.set(val);if(me.format_input)
|
||||
me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
|
||||
me.last_value=val;me.run_trigger();}
|
||||
@ -1045,7 +1045,7 @@ $(me.loading_img).toggle(false);}});this.make();}
|
||||
/*
|
||||
* lib/js/wn/ui/search.js
|
||||
*/
|
||||
wn.ui.Search=Class.extend({init:function(opts){$.extend(this,opts);var me=this;wn.model.with_doctype(this.doctype,function(r){me.make();me.dialog.show();});},make:function(){var me=this;this.dialog=new wn.ui.Dialog({title:this.doctype+' Search',width:500});this.list=new wn.ui.Listing({parent:$(this.dialog.body),appframe:this.dialog.appframe,new_doctype:this.doctype,doctype:this.doctype,method:'webnotes.widgets.doclistview.get',show_filters:true,style:'compact',get_args:function(){if(me.query){me.page_length=50;return{query:me.query}}else{return{doctype:me.doctype,fields:['`tab'+me.doctype+'`.name'],filters:me.list.filter_list.get_filters(),docstatus:['0','1']}}},render_row:function(parent,data){$ln=$('<a style="cursor: pointer;" data-name="'+data.name+'">'
|
||||
wn.ui.Search=Class.extend({init:function(opts){$.extend(this,opts);var me=this;wn.model.with_doctype(this.doctype,function(r){me.make();me.dialog.show();me.list.$w.find('.list-filters input[type="text"]').focus();});},make:function(){var me=this;this.dialog=new wn.ui.Dialog({title:this.doctype+' Search',width:500});this.list=new wn.ui.Listing({parent:$(this.dialog.body),appframe:this.dialog.appframe,new_doctype:this.doctype,doctype:this.doctype,method:'webnotes.widgets.doclistview.get',show_filters:true,style:'compact',get_args:function(){if(me.query){me.page_length=50;return{query:me.query}}else{return{doctype:me.doctype,fields:['`tab'+me.doctype+'`.name'],filters:me.list.filter_list.get_filters(),docstatus:['0','1']}}},render_row:function(parent,data){$ln=$('<a style="cursor: pointer;" data-name="'+data.name+'">'
|
||||
+data.name+'</a>').appendTo(parent).click(function(){var val=$(this).attr('data-name');me.dialog.hide();if(me.callback)
|
||||
me.callback(val);else
|
||||
wn.set_route('Form',me.doctype,val);});}});this.list.filter_list.add_filter('name','like');this.list.run();}})
|
||||
@ -1530,7 +1530,7 @@ if(this.txt){try{this.txt.focus();}catch(e){}
|
||||
this.txt.field_object=this;}}
|
||||
function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
|
||||
v=this.validate(v);return v;}
|
||||
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val;}
|
||||
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
|
||||
me.set(val);if(me.format_input)
|
||||
me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
|
||||
me.last_value=val;me.run_trigger();}
|
||||
@ -1719,7 +1719,7 @@ _f.Frm.prototype.check_doctype_conflict=function(docname){var me=this;if(this.do
|
||||
throw'doctype open conflict'}}else{if(wn.views.formview.DocType&&wn.views.formview.DocType.frm.opendocs[this.doctype]){msgprint("Cannot open instance when its DocType is open")
|
||||
throw'doctype open conflict'}}}
|
||||
_f.Frm.prototype.setup=function(){var me=this;this.fields=[];this.fields_dict={};this.wrapper=this.parent;this.setup_print_layout();this.saved_wrapper=$a(this.wrapper,'div');this.setup_std_layout();this.setup_client_script();this.setup_done=true;}
|
||||
_f.Frm.prototype.setup_print_layout=function(){this.print_wrapper=$a(this.wrapper,'div');this.print_head=$a(this.print_wrapper,'div');this.print_body=$a(this.print_wrapper,'div','layout_wrapper',{padding:'23px',minHeight:'800px'});var t=make_table(this.print_head,1,2,'100%',[],{padding:'6px'});this.view_btn_wrapper=$a($td(t,0,0),'span','green_buttons');this.view_btn=$btn(this.view_btn_wrapper,'View Details',function(){cur_frm.edit_doc()},{marginRight:'4px'},'green');this.print_btn=$btn($td(t,0,0),'Print',function(){cur_frm.print_doc()});$y($td(t,0,1),{textAlign:'right'});this.print_close_btn=$btn($td(t,0,1),'Close',function(){window.back();});}
|
||||
_f.Frm.prototype.setup_print_layout=function(){this.print_wrapper=$a(this.wrapper,'div');this.print_head=$a(this.print_wrapper,'div');this.print_body=$a(this.print_wrapper,'div','layout_wrapper',{padding:'23px',minHeight:'800px'});var t=make_table(this.print_head,1,2,'100%',[],{padding:'6px'});this.view_btn_wrapper=$a($td(t,0,0),'span','green_buttons');this.view_btn=$btn(this.view_btn_wrapper,'View Details',function(){cur_frm.edit_doc()},{marginRight:'4px'},'green');this.print_btn=$btn($td(t,0,0),'Print',function(){cur_frm.print_doc()});$y($td(t,0,1),{textAlign:'right'});this.print_close_btn=$btn($td(t,0,1),'Close',function(){window.history.back();});}
|
||||
_f.Frm.prototype.onhide=function(){if(_f.cur_grid_cell)_f.cur_grid_cell.grid.cell_deselect();}
|
||||
_f.Frm.prototype.setup_std_layout=function(){this.page_layout=new wn.PageLayout({parent:this.wrapper,main_width:this.meta.in_dialog?'100%':'75%',sidebar_width:this.meta.in_dialog?'0%':'25%'})
|
||||
this.meta.section_style='Simple';this.layout=new Layout(this.page_layout.body,'100%');if(this.meta.in_dialog){$(this.page_layout.wrapper).removeClass('layout-wrapper-background');$(this.page_layout.main).removeClass('layout-main-section');$(this.page_layout.sidebar_area).toggle(false);}else{this.setup_sidebar();}
|
||||
|
@ -218,8 +218,8 @@ if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:funct
|
||||
/*
|
||||
* lib/js/wn/ui/filters.js
|
||||
*/
|
||||
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').slideToggle();if(!this.filters.length)
|
||||
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('lib/js/legacy/widgets/form/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length)
|
||||
this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
|
||||
values.push(f.get_value());})
|
||||
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
|
||||
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
|
||||
@ -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>\
|
||||
|
Loading…
x
Reference in New Issue
Block a user