diff --git a/erpnext/setup/doctype/setup_control/setup_control.py b/erpnext/setup/doctype/setup_control/setup_control.py index d5832c4e033..bcdd0938da9 100644 --- a/erpnext/setup/doctype/setup_control/setup_control.py +++ b/erpnext/setup/doctype/setup_control/setup_control.py @@ -81,7 +81,12 @@ class DocType: # Set self.set_defaults(def_args) - self.set_cp_defaults(**args) + + cp_args = {} + for k in ['industry', 'country', 'timezone', 'company_name']: + cp_args[k] = args[k] + + self.set_cp_defaults(**cp_args) self.create_feed_and_todo() diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt index 41570395fdf..06f765dc7e0 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:33', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:33', + 'modified': '2012-05-04 13:02:26', 'modified_by': u'Administrator', 'owner': u'wasim@webnotestech.com' }, @@ -21,7 +21,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 2 + 'version': 1 }, # These values are common for all DocField diff --git a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js index 3cad9447a9b..03e8a39fd0b 100644 --- a/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js +++ b/erpnext/stock/doctype/landed_cost_master/landed_cost_master.js @@ -23,4 +23,8 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) { +} + +cur_frm.fields_dict.landed_cost.grid.get_field('account_head').get_query = function(doc, cdt, cdn) { + return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type = "Tax" OR tabAccount.account_type = "Chargeable" or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.name LIKE "%s"'; } \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt index 1becceaf654..74e47e19238 100644 --- a/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt +++ b/erpnext/stock/doctype/landed_cost_master_detail/landed_cost_master_detail.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:34', + 'creation': '2012-05-03 11:00:55', 'docstatus': 0, - 'modified': '2012-03-27 14:36:34', + 'modified': '2012-05-04 13:02:35', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -19,13 +19,12 @@ 'name': '__common__', 'section_style': u'Simple', 'server_code_error': u' ', - 'version': 2 + 'version': 1 }, # These values are common for all DocField { 'doctype': u'DocField', - 'fieldtype': u'Data', 'name': '__common__', 'oldfieldtype': u'Data', 'parent': u'Landed Cost Master Detail', @@ -44,14 +43,17 @@ { 'doctype': u'DocField', 'fieldname': u'account_head', + 'fieldtype': u'Link', 'label': u'Account Head', - 'oldfieldname': u'account_head' + 'oldfieldname': u'account_head', + 'options': u'Account' }, # DocField { 'doctype': u'DocField', 'fieldname': u'description', + 'fieldtype': u'Data', 'label': u'Description', 'oldfieldname': u'description', 'width': u'300px' diff --git a/js/all-app.js b/js/all-app.js index 09a302013db..97ece36d5c3 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2009,7 +2009,7 @@ _p.def_print_style_other="\n.simpletable, .noborder { border-collapse: collapse; _p.go=function(html){var d=document.createElement('div') d.innerHTML=html $(d).printElement();} -_p.preview=function(html){var w=window.open('');w.document.write(html) +_p.preview=function(html){var w=window.open('');if(!w)return;w.document.write(html) w.document.close();} $.extend(_p,{show_dialog:function(){if(!_p.dialog){_p.make_dialog();} _p.dialog.show();},make_dialog:function(){var d=new Dialog(360,140,'Print Formats',[['HTML','Select'],['Check','No Letterhead'],['HTML','Buttons']]);$btn(d.widgets.Buttons,'Print',function(){_p.build(sel_val(cur_frm.print_sel),_p.go,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px',marginLeft:'7px'},'green');$btn(d.widgets.Buttons,'Preview',function(){_p.build(sel_val(cur_frm.print_sel),_p.preview,d.widgets['No Letterhead'].checked);},{cssFloat:'right',marginBottom:'16px'},'');d.onshow=function(){var c=_p.dialog.widgets['Select'];if(c.cur_sel&&c.cur_sel.parentNode==c){c.removeChild(c.cur_sel);}