diff --git a/README b/README new file mode 100644 index 0000000000..37967291f6 --- /dev/null +++ b/README @@ -0,0 +1 @@ +erpnext diff --git a/crm/doctype/customer/customer.py b/crm/doctype/customer/customer.py index d480a6cf25..3d2fa59335 100644 --- a/crm/doctype/customer/customer.py +++ b/crm/doctype/customer/customer.py @@ -25,7 +25,8 @@ class DocType: if cust_master_name == 'Customer Name': # filter out bad characters in name - cust = self.doc.customer_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') + #cust = self.doc.customer_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') + cust = self.doc.customer_name supp = sql("select name from `tabSupplier` where name = %s", (cust)) supp = supp and supp[0][0] or '' diff --git a/event_updates/Module Def/Event Updates/Event Updates.txt b/event_updates/Module Def/Event Updates/Event Updates.txt deleted file mode 100644 index 3bc62f084e..0000000000 --- a/event_updates/Module Def/Event Updates/Event Updates.txt +++ /dev/null @@ -1,330 +0,0 @@ -[ - { - '_last_update': None, - 'creation': '2010-11-30 22:40:49', - 'disabled': 'No', - 'docstatus': 0, - 'doctype': 'Module Def', - 'doctype_list': None, - 'file_list': None, - 'idx': None, - 'is_hidden': 'No', - 'last_updated_date': '2010-11-29 12:02:02', - 'modified': '2010-09-25 15:53:18', - 'modified_by': 'Administrator', - 'module_desc': '

This module contains

\n', - 'module_icon': 'star_full.png', - 'module_label': 'Home', - 'module_name': 'Event Updates', - 'module_page': 'Event Updates', - 'module_seq': 0, - 'name': 'Event Updates', - 'owner': 'Administrator', - 'parent': None, - 'parentfield': None, - 'parenttype': None, - 'trash_reason': None, - 'widget_code': None - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:40:49', - 'description': None, - 'display_name': 'Comment Widget Record', - 'doc_name': 'Comment Widget Record', - 'doc_type': 'Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': None, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDI00108', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:40:49', - 'description': None, - 'display_name': 'Feed', - 'doc_name': 'Feed', - 'doc_type': 'Forms', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': None, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDI00109', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'click_function': None, - 'creation': '2010-11-30 22:40:49', - 'description': None, - 'display_name': 'Home', - 'doc_name': 'Home', - 'doc_type': 'Pages', - 'docstatus': 0, - 'doctype': 'Module Def Item', - 'fields': None, - 'hide': None, - 'icon': None, - 'idx': None, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDI00111', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'items', - 'parenttype': 'Module Def' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 1, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00014', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Administrator' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 2, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00015', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Accounts User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 3, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00016', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Accounts Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 4, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00017', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'HR User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 5, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00018', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'HR Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 6, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00019', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 7, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00020', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material Master Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 8, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00021', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Material Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 9, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00022', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 10, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00023', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase Master Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 11, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00024', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Purchase Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 12, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00025', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Production User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 13, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00026', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Production Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 14, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00027', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'System Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 15, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00028', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales User' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 16, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00029', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales Master Manager' - }, - { - 'creation': '2010-11-30 22:40:49', - 'docstatus': 0, - 'doctype': 'Module Def Role', - 'idx': 17, - 'modified': '2010-11-30 22:40:49', - 'modified_by': 'Administrator', - 'name': 'MDR00030', - 'owner': 'Administrator', - 'parent': 'Event Updates', - 'parentfield': 'roles', - 'parenttype': 'Module Def', - 'role': 'Sales Manager' - } -] \ No newline at end of file diff --git a/event_updates/__init__.py b/event_updates/__init__.py deleted file mode 100644 index d1f79c7d59..0000000000 --- a/event_updates/__init__.py +++ /dev/null @@ -1,52 +0,0 @@ -import webnotes - -feed_dict = { - # Project - 'Ticket': ['[%(status)s] %(subject)s', '#000080'], - - # Sales - 'Lead': ['%(lead_name)s', '#000080'], - 'Quotation': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], - 'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], - - # Purchase - 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], - 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], - - # Stock - 'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'], - - # Accounts - 'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'], - 'Payable Voucher': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], - 'Receivable Voucher':['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'], - - # HR - 'Expense Voucher': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'], - 'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'], - 'Leave Transaction':['%(leave_type)s for %(employee)s', '#4169E1'], - - # Support - 'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'], - 'Maintenance Visit':['To %(customer_name)s', '#4169E1'], - 'Support Ticket': ['[%(status)s] %(subject)s', '#000080'] -} - -def make_feed(doc, subject, color): - "makes a new Feed record" - from webnotes.model.doc import Document - webnotes.conn.sql("delete from tabFeed where doc_type=%s and doc_name=%s", (doc.doctype, doc.name)) - f = Document('Feed') - f.doc_type = doc.doctype - f.doc_name = doc.name - f.subject = subject - f.color = color - f.save(1) - -def update_feed(doc): - "adds a new feed" - subject, color = feed_dict.get(doc.doctype, [None, None]) - if subject: - subject = subject % doc.fields - make_feed(doc, subject, color) - diff --git a/event_updates/doctype/home_control/home_control.txt b/event_updates/doctype/home_control/home_control.txt deleted file mode 100644 index d23fb3d9e7..0000000000 --- a/event_updates/doctype/home_control/home_control.txt +++ /dev/null @@ -1 +0,0 @@ -[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2009-07-09 16:32:49', 'search_fields': None, 'module': 'Event Updates', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': 1, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': 0, 'max_attachments': None, 'version': 4, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': None, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': '', 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Home Control', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-11-21 16:46:44', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}] \ No newline at end of file diff --git a/event_updates/doctype/widget_control/widget_control.txt b/event_updates/doctype/widget_control/widget_control.txt deleted file mode 100644 index 184eb2425b..0000000000 --- a/event_updates/doctype/widget_control/widget_control.txt +++ /dev/null @@ -1 +0,0 @@ -[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2009-11-12 13:06:24', 'search_fields': None, 'module': 'Event Updates', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': 1, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': 0, 'max_attachments': None, 'version': 27, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': 0, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': None, 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Widget Control', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-09-20 14:06:57', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}] \ No newline at end of file diff --git a/event_updates/page/event_updates/event_updates.comp.js b/event_updates/page/event_updates/event_updates.comp.js deleted file mode 100644 index 3af8868ffb..0000000000 --- a/event_updates/page/event_updates/event_updates.comp.js +++ /dev/null @@ -1,111 +0,0 @@ - -pscript['onload_Event Updates']=function(){if(user=='Guest'){loadpage('Login Page');return;} -pscript.home_make_body();pscript.home_make_status();pscript.home_pre_process();pscript.home_make_widgets();} -pscript.home_make_body=function(){var wrapper=page_body.pages['Event Updates'];wrapper.main_tab=make_table(wrapper,1,2,'100%',['70%','30%']);$y(wrapper.main_tab,{tableLayout:'fixed'});wrapper.body=$a($td(wrapper.main_tab,0,0),'div','layout_wrapper');wrapper.head=$a(wrapper.body,'div');wrapper.banner_area=$a(wrapper.head,'div');wrapper.toolbar_area=$a(wrapper.head,'div');wrapper.system_message_area=$a(wrapper.body,'div','',{marginBottom:'16px',padding:'8px',backgroundColor:'#FFD',border:'1px dashed #AA6',display:'none'})} -pscript.home_pre_process=function(wrapper){var wrapper=page_body.pages['Event Updates'];var cp=locals['Control Panel']['Control Panel'];if(cp.client_name){var banner=$a(wrapper.banner_area,'div','',{paddingBottom:'4px'}) -banner.innerHTML=cp.client_name;} -if(in_list(user_roles,'System Manager')){pscript.complete_registration();}} -pscript.home_make_widgets=function(){var wrapper=page_body.pages['Event Updates'];var cell=$td(wrapper.main_tab,0,1);sidebar=new wn.widgets.PageSidebar(cell,{sections:[{title:'Calendar',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){new HomeCalendar(new HomeWidget(wrapper,'Calendar','Event'),wrapper);}},{title:'To Do',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){new HomeToDo(new HomeWidget(wrapper,'To Do','Item'));}},{title:'Online Users',display:function(){return!has_common(user_roles,['Guest','Customer','Vendor'])},render:function(wrapper){pscript.online_users_obj=new OnlineUsers(wrapper);}}]}) -sidebar.refresh() -new FeedList(wrapper.body);} -OnlineUsers=function(wrapper){var me=this;this.wrapper=wrapper;this.my_company_link=function(){$a($a(wrapper,'div','',{marginBottom:'7px'}),'span','link_type',{color:'#777','color:hover':'#FFF',fontSize:'11px'},'See all users',function(){loadpage('My Company');});} -this.render=function(online_users){me.my_company_link();if(online_users.length){var max=online_users.length;max=(max>10?10:max) -for(var i=0;iDeleting...';var callback=function(r,rt){$(me.wrapper).slideUp();} -$c_obj('Home Control',this.widget.delete_method,this.widget.get_item_id(this.det),callback);} -HomeCalendar=function(widget,wrapper){$ln(widget.footer,'Full Calendar',function(){loadpage('_calendar');},{marginLeft:'7px',fontSize:'11px',color:'#888'}) -this.widget=widget;this.widget.get_list_method='get_events_list' -this.widget.delete_method='delete_event';this.widget.no_items_message='You have no events in the next 7 days';this.widget.get_item_id=function(det){return det.name;} -this.widget.decorator=this;var hl=[];for(var i=0;i<24;i++){hl.push(((i+8)%24)+':00');} -this.widget.dialog_fields=[{fieldtype:'Date',fieldname:'event_date',label:'Event Date',reqd:1},{fieldtype:'Time',fieldname:'event_hour',label:'Event Time',reqd:1},{fieldtype:'Text',fieldname:'description',label:'Description',reqd:1},{fieldtype:'Button',fieldname:'save',label:'Save'}];this.widget.refresh();} -HomeCalendar.prototype.setup_body=function(){var w=this.widget;w.date_blocks={};for(var i=0;i<7;i++){var dt=dateutil.obj_to_str(dateutil.add_days(new Date(),i));var div=$a(w.body,'div','',{padding:'4px 0px',borderBottom:'1px solid #AAA',display:'none'});div.head=$a(div,'div','',{fontWeight:'bold',paddingBottom:'4px'});div.head.innerHTML=(i==0?'Today':(i==1?'Tomorrow':dateutil.str_to_user(dt))) -w.date_blocks[dt]=div;}} -HomeCalendar.prototype.get_item_parent=function(det){var d=this.widget.date_blocks[det.event_date];$ds(d);return d;} -HomeCalendar.prototype.render_item=function(item,det){var tab=make_table($td(item.tab,0,0),1,2,'100%',['48px',null],{padding:'2px',lineHeight:'1.5em'});$y(tab,{tableLayout:'fixed'});$td(tab,0,0).innerHTML=''+det.event_hour+': ';$a($td(tab,0,1),'span','social',{},replace_newlines(det.description));if(det.ref_type&&det.ref_name&&det.ref_name!='None'){var span=$a($a($td(tab,0,1),'div'),'span','link_type');span.innerHTML=det.ref_name;span.dt=det.ref_type;span.onclick=function(){loaddoc(this.dt,this.innerHTML);}}} -HomeCalendar.prototype.clear_dialog=function(){this.set_dialog_values({event_date:get_today(),event_hour:'8:00',description:''});} -HomeCalendar.prototype.set_dialog_values=function(det){var d=this.widget.dialog;d.set_values(det);d.det=det;} -HomeCalendar.prototype.save=function(btn){var d=this.widget.dialog;var me=this;var det=d.get_values();if(!det){btn.done_working();return;} -det.name=d.det.name;det.owner=user;if(!det.event_type) -det.event_type='Private';var callback=function(r,rt){btn.done_working();me.widget.dialog.hide();me.widget.refresh();} -$c_obj('Home Control','edit_event',JSON.stringify(det),callback);} -HomeToDo=function(widget){this.widget=widget;this.widget.get_list_method='get_todo_list';this.widget.delete_method='remove_todo_item';this.widget.no_items_message='Nothing to do?';this.widget.get_item_id=function(det){return det[0];} -this.widget.decorator=this;this.widget.dialog_fields=[{fieldtype:'Date',fieldname:'date',label:'Event Date',reqd:1},{fieldtype:'Text',fieldname:'description',label:'Description',reqd:1},{fieldtype:'Check',fieldname:'checked',label:'Completed'},{fieldtype:'Select',fieldname:'priority',label:'Priority',reqd:1,'options':['Medium','High','Low'].join('\n')},{fieldtype:'Button',fieldname:'save',label:'Save'}];this.widget.refresh();} -HomeToDo.prototype.render_item=function(item,det){var tab=make_table($td(item.tab,0,0),1,2,'100%',['48px',null],{padding:'2px'});$y(tab,{tableLayout:'fixed'});var span=$a($td(tab,0,0),'span','',{padding:'2px',color:'#FFF',fontSize:'10px',backgroundColor:(det[3]=='Low'?'#888':(det[3]=='High'?'#EDA857':'#687FD3'))});$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');span.innerHTML=det[3];var span=$a($td(tab,0,1),'span','social',{lineHeight:'1.5em'},replace_newlines(det[1]));if(det[4])$y(span,{textDecoration:'line-through'});if(!det[4]&&dateutil.str_to_obj(det[2])What appears here? This is where you get updates of everything you are allowed to access and generates an update')}) -$a(this.head,'span','link_type',{cursor:'pointer',marginLeft:'7px',fontSize:'11px'},'refresh',function(){me.run();});} -FeedList.prototype.run=function(){this.prev_date=null;this.list.run();} -FeedList.prototype.make_list=function(){this.list_area=$a(this.wrapper,'div') -this.no_result=$a(this.wrapper,'div','help_box',{display:'none'},'Nothing to show yet. Your feed will be updated as you start your activities') -var l=new Listing('Feed List',1);var me=this;l.colwidths=['100%'];l.page_len=20;l.opts.cell_style={padding:'0px'};l.opts.hide_rec_label=1;l.get_query=function(){this.query=repl('select \ - distinct t1.name, t1.doc_type, t1.doc_name, t1.subject, t1.modified_by, \ - concat(ifnull(t2.first_name,""), " ", ifnull(t2.last_name,"")), t1.modified, t1.color \ - from tabFeed t1, tabProfile t2, tabUserRole t3, tabDocPerm t4 \ - where t1.doc_type = t4.parent \ - and t2.name = t1.owner \ - and t3.parent = "%(user)s" \ - and t4.role = t3.role \ - and ifnull(t4.`read`,0) = 1 \ - order by t1.modified desc',{user:user}) -this.query_max=''} -l.show_cell=function(cell,ri,ci,d){me.render_feed(cell,ri,ci,d);} -l.onrun=function(){$(me.wrapper).fadeIn();if(me.after_run)me.after_run();} -l.make(this.list_area);$dh(l.btn_area);this.list=l;} -FeedList.prototype.after_run=function(){this.list.has_data()?$dh(this.no_result):$ds(this.no_result)} -FeedList.prototype.render_feed=function(cell,ri,ci,d){new FeedItem(cell,d[ri],this);} -FeedItem=function(cell,det,feedlist){var me=this;this.det=det;this.feedlist=feedlist;this.wrapper=$a(cell,'div','',{paddingBottom:'4px'});this.head=$a(this.wrapper,'div');this.tab=make_table(this.wrapper,1,2,'100%',[(100/7)+'%',(600/7)+'%']);$y(this.tab,{tableLayout:'fixed'}) -$y($td(this.tab,0,0),{textAlign:'right',paddingRight:'4px'});this.text_area=$a($td(this.tab,0,1),'div');this.render_references(this.text_area,det);this.render_tag(det);this.add_day_sep(det);} -FeedItem.prototype.add_day_sep=function(det){var me=this;var prev_date=det[6].split(' ')[0];var make_div=function(){var div=$a(me.head,'div','',{borderBottom:'1px solid #888',margin:'8px 0px',padding:'2px 0px',color:'#888',fontSize:'11px'});div.innerHTML=comment_when(det[6],1);if(prev_date==get_today()){div.innerHTML='';span=$a(div,'span','',{padding:'2px',color:'#000',fontWeight:'bold'});span.innerHTML='Today';}} -if(this.feedlist.prev_date&&this.feedlist.prev_date!=prev_date){make_div();} -if(!this.feedlist.prev_date){make_div();} -this.feedlist.prev_date=prev_date;} -FeedItem.prototype.render_tag=function(det){tag=$a($td(this.tab,0,0),'div','',{color:'#FFF',padding:'3px',textAlign:'right',fontSize:'11px',whiteSpace:'nowrap',overflow:'hidden',cursor:'pointer'});$br(tag,'3px');$y(tag,{backgroundColor:(det[7]?det[7]:'#273')});tag.innerHTML=get_doctype_label(det[1]);tag.dt=det[1] -tag.onclick=function(){loaddocbrowser(this.dt);}} -FeedItem.prototype.render_references=function(div,det){div.tab=make_table(div,1,2,'100%',[null,'15%']) -var dt=det[1];var dn=det[2] -var allow=in_list(profile.can_read,dt);var span=$a($td(div.tab,0,0),'span',(allow?'link_type':''),null,det[2]);span.dt=dt;span.dn=dn;if(allow)span.onclick=function(){loaddoc(this.dt,this.dn);} -if(det[3]){$a($td(div.tab,0,0),'span','',{marginLeft:'7px',color:'#444'},det[3]);} -$y($td(div.tab,0,1),{fontSize:'11px'}).innerHTML=(strip(det[5])?det[5]:det[4]);} -HomeStatusBar=function(){var me=this;var parent=page_body.pages['Event Updates'];this.wrapper=$a($td(parent.main_tab,0,1),'div','home-status',{},'Loading...');$br(this.wrapper,'3px');this.render=function(r){this.wrapper.innerHTML='';this.span=$a(this.wrapper,'span','home-status-link') -this.span.onclick=function(){loadpage('My Company')} -if(r.unread_messages){this.span.innerHTML=''+r.unread_messages+' unread message'+(cint(r.unread_messages)>1?'s':'');}else{this.span.innerHTML='No unread messages.';}}} -pscript.home_make_status=function(){var home_status_bar=new HomeStatusBar() -var wrapper=page_body.pages['Event Updates'];$c_page('event_updates','event_updates','get_status_details',user,function(r,rt){home_status_bar.render(r.message);if(r.message.system_message) -pscript.show_system_message(wrapper,r.message.system_message);if(pscript.is_erpnext_saas&&cint(r.message.is_trial)&&in_list(user_roles,'System Manager')){pscript.trial_box=$a(div,'div','help_box',{margin:'2px 8px 2px 0px'},"Your Free Trial expires in "+ -r.message.days_to_expiry+" days. When you are satisfied, please please click here to convert to a paid account."+"
To get help, view Getting Started with Your System (opens in a new page)");} -pscript.online_users_obj.render(r.message.online_users);pscript.online_users=r.message.online_users;});} -pscript.convert_to_paid=function(){var callback=function(r,rt){if(r.exc){msgprint(r.exc);return;} -$(pscript.trial_box).slideUp();} -$c_page('event_updates','event_updates','convert_to_paid','',callback)} -pscript.show_system_message=function(wrapper,msg){$ds(wrapper.system_message_area);var txt=$a(wrapper.system_message_area,'div','',{lineHeight:'1.6em'});txt.innerHTML=msg;var span=$ln($a(wrapper.system_message_area,'div'),'Dismiss',function(me){me.set_working();$c_obj('Home Control','dismiss_message','',function(r,rt){me.done_working();$(wrapper.system_message_area).slideUp();});},{fontSize:'11px'})} -pscript.complete_registration=function() -{var reg_callback=function(r,rt){if(r.message=='No'){var d=new Dialog(400,200,"Please Complete Your Registration");if(user!='Administrator'){d.no_cancel();$dh(page_body.wntoolbar.wrapper);} -$($a(d.body,'div','',{margin:'8px',color:'#888'})).html('Company Name : '+locals['Control Panel']['Control Panel'].company_name);d.make_body([['Data','Company Abbreviation'],['Select','Fiscal Year Start Date'],['Select','Default Currency'],['Button','Save'],]);pscript.make_dialog_field(d);d.widgets['Save'].onclick=function() -{d.widgets['Save'].set_working();flag=pscript.validate_fields(d);if(flag) -{var args=[locals['Control Panel']['Control Panel'].company_name,d.widgets['Company Abbreviation'].value,d.widgets['Fiscal Year Start Date'].value,d.widgets['Default Currency'].value];$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r,rt){sys_defaults=r.message;d.hide();$ds(page_body.wntoolbar.wrapper);});}} -d.show();}} -$c_obj('Home Control','registration_complete','',reg_callback);} -pscript.make_dialog_field=function(d) -{fisc_format=d.widgets['Fiscal Year Start Date'];add_sel_options(fisc_format,['','1st Jan','1st Apr','1st Jul','1st Oct']);currency_list=['','AED','AFN','ALL','AMD','ANG','AOA','ARS','AUD','AZN','BAM','BBD','BDT','BGN','BHD','BIF','BMD','BND','BOB','BRL','BSD','BTN','BYR','BZD','CAD','CDF','CFA','CFP','CHF','CLP','CNY','COP','CRC','CUC','CZK','DJF','DKK','DOP','DZD','EEK','EGP','ERN','ETB','EUR','EURO','FJD','FKP','FMG','GBP','GEL','GHS','GIP','GMD','GNF','GQE','GTQ','GYD','HKD','HNL','HRK','HTG','HUF','IDR','ILS','INR','IQD','IRR','ISK','JMD','JOD','JPY','KES','KGS','KHR','KMF','KPW','KRW','KWD','KYD','KZT','LAK','LBP','LKR','LRD','LSL','LTL','LVL','LYD','MAD','MDL','MGA','MKD','MMK','MNT','MOP','MRO','MUR','MVR','MWK','MXN','MYR','MZM','NAD','NGN','NIO','NOK','NPR','NRs','NZD','OMR','PAB','PEN','PGK','PHP','PKR','PLN','PYG','QAR','RMB','RON','RSD','RUB','RWF','SAR','SCR','SDG','SDR','SEK','SGD','SHP','SOS','SRD','STD','SYP','SZL','THB','TJS','TMT','TND','TRY','TTD','TWD','TZS','UAE','UAH','UGX','USD','USh','UYU','UZS','VEB','VND','VUV','WST','XAF','XCD','XDR','XOF','XPF','YEN','YER','YTL','ZAR','ZMK','ZWR'];currency=d.widgets['Default Currency'];add_sel_options(currency,currency_list);} -pscript.validate_fields=function(d) -{var lst=['Company Abbreviation','Fiscal Year Start Date','Default Currency'];var msg='Please enter the following fields';var flag=1;for(var i=0;iAccount Settings to increase the number of users');} -$c_page('my_company','my_company','get_max_users','',callback)} -pscript.myc_add_user=function(){var d=new wn.widgets.Dialog({title:'Add User',width:400,fields:[{fieldtype:'Data',fieldname:'user',reqd:1,label:'Email Id of the user to add'},{fieldtype:'Button',label:'Add',fieldname:'add'}]});d.make();d.fields_dict.add.input.onclick=function(){v=d.get_values();if(v){d.fields_dict.add.input.set_working();$c_page('my_company','my_company','add_user',v,function(r,rt){if(r.exc){msgprint(r.exc);return;} -else{d.hide();pscript.myc_refresh();}})}} -d.show();} -pscript.myc_refresh=function(){page_body.pages['My Company'].member_list.lst.run();} -pscript.myc_make_list=function(wrapper){wrapper.member_list=new MemberList(wrapper)} -pscript.get_fullname=function(uid){if(uid=='Administrator')return uid;return page_body.pages['My Company'].member_list.member_items[uid].fullname;} -MemberList=function(parent){var me=this;this.profiles={};this.member_items={};this.role_objects={};this.cur_profile=null;this.list_wrapper=$a($td(parent.tab,0,0),'div','',{marginLeft:'11px'});this.profile_wrapper=$a($td(parent.tab,0,1),'div','layout_wrapper',{marginLeft:'0px',height:'100%'});this.no_user_selected=$a(this.profile_wrapper,'div','help_box',null,'Please select a user to view profile');this.make_search();if(pscript.online_users){this.make_list();}else{$c_page('event_updates','event_updates','get_online_users','',function(r,rt){pscript.online_users=r.message;me.make_list();})}} -MemberList.prototype.make_search=function(){var me=this;this.search_area=$a(this.list_wrapper,'div','',{textAlign:'center',padding:'8px'});this.search_inp=$a(this.search_area,'input','',{fontSize:'14px',width:'80%'});this.search_inp.set_empty=function(){this.value='Search';$fg(this,'#888');} -this.search_inp.onfocus=function(){$fg(this,'#000');if(this.value=='Search')this.value='';} -this.search_inp.onchange=function(){if(!this.value)this.set_empty();} -this.search_inp.set_empty();} -MemberList.prototype.make_list=function(){var me=this;this.lst_area=$a(this.list_wrapper,'div');this.lst=new Listing('Profiles',1);this.lst.colwidths=['100%'];this.lst.opts.cell_style={padding:'0px'} -this.lst.get_query=function(){var c1='';if(me.search_inp.value&&me.search_inp.value!='Search'){var c1=repl(' AND (first_name LIKE "%(txt)s" OR last_name LIKE "%(txt)s" OR name LIKE "%(txt)s")',{txt:'%'+me.search_inp.value+'%'});} -this.query=repl("SELECT distinct ifnull(name,''), ifnull(concat_ws(' ', first_name, last_name),''), ifnull(messanger_status,''), ifnull(gender,''), ifnull(file_list,''), 0, enabled from tabProfile where docstatus != 2 AND name not in ('Guest','Administrator') %(cond)s ORDER BY name asc",{cond:c1});} -this.lst.make(this.lst_area);this.lst.show_cell=function(cell,ri,ci,d){me.member_items[d[ri][0]]=new MemberItem(cell,d[ri],me);} -this.lst.run();} -MemberList.prototype.show_profile=function(uid,member_item){$dh(this.no_user_selected);if(!this.profiles[uid]){if(!member_item)member_item=this.member_items[uid];this.profiles[uid]=new MemberProfile(this.profile_wrapper,uid,member_item);} -if(this.cur_profile) -this.cur_profile.hide();this.profiles[uid].show();this.cur_profile=this.profiles[uid];} -MemberItem=function(parent,det,mlist){var me=this;this.det=det;this.wrapper=$a(parent,'div');this.enabled=det[6];this.tab=make_table(this.wrapper,1,2,'100%',['20%','70%'],{padding:'4px',overflow:'hidden'});$y(this.tab,{tableLayout:'fixed',borderCollapse:'collapse'}) -this.is_online=function(){for(var i=0;i'):'';this.bio_area.innerHTML+=this.profile.bio?this.profile.bio:'No bio';new MemberConversation(this.wrapper,this.profile.name,this.fullname);} -this.refresh_enable_disable=function(){this.profile=locals['Profile'][this.uid] -if(!this.profile.enabled){$fg(this.name_area,'#999');}else{$fg(this.name_area,'#000');} -this.member_item.enabled=this.profile.enabled;this.member_item.refresh_name_link();this.status_span.innerHTML=this.profile.enabled?'Enabled':'Disabled';if(has_common(['Administrator','System Manager'],user_roles)){this.set_enable_button();}} -this.load=function(){if(locals['Profile']&&locals['Profile'][uid]){this.render();return;} -var callback=function(r,rt){$dh(me.member_item.working_img);$ds(me.wrapper);me.loading=0;me.render();} -$ds(this.member_item.working_img);$dh(this.wrapper);this.loading=1;$c('webnotes.widgets.form.getdoc',{'name':this.uid,'doctype':'Profile','user':user},callback);} -this.show=function(){if(!this.loading)$ds(this.wrapper);this.member_item.select();} -this.hide=function(){$dh(this.wrapper);this.member_item.deselect();} -this.make_message_list=function(){} -this.make();this.load();} -MemberConversation=function(parent,uid,fullname){var me=this;this.wrapper=$a(parent,'div','my-company-conversation');this.fullname=fullname;this.make=function(){if(user!=uid){this.make_input();} -this.make_list();if(user==uid){$c_page('my_company','my_company','set_read_all_messages','',function(r,rt){});}} -this.make_input=function(){this.input_wrapper=$a(this.wrapper,'div','my-company-input-wrapper');var tab=make_table(this.input_wrapper,1,2,'100%',['64%','36%'],{padding:'3px'}) -this.input=$a($td(tab,0,0),'textarea');$(this.input).add_default_text('Send a message to '+fullname);var div=$a(this.input_wrapper,'div');this.post=$btn(div,'Post'.bold(),function(){me.post_message();},{margin:'0px 13px 0px 3px'}) -this.post.set_disabled();this.input.onkeyup=this.input.onchange=function(){if(this.value){me.post.set_enabled();}else{me.post.set_disabled();}} -this.notify_check=$a_input(div,'checkbox',null);$a(div,'span','',{marginLeft:'3px'},'Notify '+fullname+' by email')} -this.post_message=function(){if(me.input.value==$(me.input).attr('default_text')){msgprint('Please write a message first!');return;} -this.post.set_working();$c_page('my_company','my_company','post_comment',{uid:uid,comment:$(me.input).val(),notify:me.notify_check.checked?1:0},function(r,rt){$(me.input).val("").blur();me.post.done_working();if(r.exc){msgprint(r.exc);return;} -me.notify_check.checked=false;me.refresh();})} -this.make_list=function(){this.lst_area=$a(this.wrapper,'div','my-company-conversation',{padding:'7px 13px'});if(user==uid){this.my_messages_box=$a(this.lst_area,'div','my-company-conversation-head',{marginBottom:'7px'},'Messages by everyone to me
To send a message, click on the user on the left')} -this.lst=new wn.widgets.Listing({parent:this.lst_area,no_result_message:(user==uid?'No messages by anyone yet':'No messages yet. To start a conversation post a new message'),get_query:function(){if(uid==user){return repl("SELECT comment, owner, comment_docname, creation, docstatus "+"FROM `tabComment Widget Record` "+"WHERE comment_doctype='My Company' "+"AND comment_docname='%(user)s' "+"ORDER BY creation DESC ",{user:user});}else{return repl("SELECT comment, owner, comment_docname, creation, docstatus "+"FROM `tabComment Widget Record` "+"WHERE comment_doctype='My Company' "+"AND ((owner='%(user)s' AND comment_docname='%(uid)s') "+"OR (owner='%(uid)s' AND comment_docname='%(user)s')) "+"ORDER BY creation DESC ",{uid:uid,user:user});}},render_row:function(parent,data){new MemberCoversationComment(parent,data,me);},}) -this.refresh();} -this.refresh=function(){me.lst.run()} -this.make();} -MemberCoversationComment=function(cell,det,conv){var me=this;this.det=det;this.wrapper=$a(cell,'div','my-company-comment-wrapper');this.comment=$a(this.wrapper,'div','my-company-comment');this.user=$a(this.comment,'span','link_type',{fontWeight:'bold'},pscript.get_fullname(det[1]));this.user.onclick=function(){page_body.pages['My Company'].member_list.show_profile(me.det[1]);} -var st=(!det[4]?{fontWeight:'bold'}:null);this.msg=$a(this.comment,'span','social',st,': '+det[0]);if(det[1]==user){$y(this.wrapper,{backgroundColor:'#D9D9F3'});} -this.timestamp=$a(this.wrapper,'div','my-company-timestamp','',comment_when(det[3]));} -pscript.all_roles=null;RoleObj=function(profile_id){this.roles_dict={};this.profile_id=profile_id;this.setup_done=0;var d=new Dialog(500,500,'Assign Roles');d.make_body([['HTML','roles']]);this.dialog=d;this.make_role_body(profile_id);this.make_help_body();this.body.innerHTML='Loading... ' -var me=this;d.onshow=function(){if(!me.setup_done) -me.get_all_roles(me.profile_id);}} -RoleObj.prototype.make_role_body=function(id){var me=this;var d=this.dialog;this.role_div=$a(d.widgets['roles'],'div');this.head=$a(this.role_div,'div','',{marginLeft:'4px',marginBottom:'4px',fontWeight:'bold'});this.body=$a(this.role_div,'div');this.footer=$a(this.role_div,'div');this.update_btn=$btn(this.footer,'Update',function(){me.update_roles(me.profile_id);},{marginRight:'4px'},'',1);} -RoleObj.prototype.make_help_body=function(){var me=this;var d=this.dialog;this.help_div=$a(d.widgets['roles'],'div');var head=$a(this.help_div,'div');this.help_div.head=head;var body=$a(this.help_div,'div');this.help_div.body=body;var tail=$a(this.help_div,'div');this.help_div.tail=tail;var back_btn=$btn(tail,'Back',function(){$(me.role_div).slideToggle('medium');$(me.help_div).slideToggle('medium');});this.help_div.back_btn=back_btn;$dh(this.help_div);} -RoleObj.prototype.get_all_roles=function(id){if(pscript.all_roles){this.make_roles(id);return;} -var me=this;var callback=function(r,rt){pscript.all_roles=r.message;me.make_roles(id);} -$c_obj('Company Control','get_all_roles','',callback);} -RoleObj.prototype.make_roles=function(id){var me=this;var list=pscript.all_roles;me.setup_done=1;me.body.innerHTML='';var tbl=make_table(me.body,cint(list.length/2)+1,4,'100%',['5%','45%','5%','45%'],{padding:'4px'});var in_right=0;var ridx=0;for(i=0;i1){var c=confirm("You have unchecked the System Manager role.\nYou will lose administrative rights and will not be able to set roles.\n\nDo you want to continue anyway?");if(!c)return;} -else{var c="There should be atleast one user with System Manager role.";me.roles_dict['System Manager'].checked=1;}} -me.set_roles(id);} -$c_obj('Company Control','get_sm_count','',callback);} -else{me.set_roles(id);}} -RoleObj.prototype.set_roles=function(id){var me=this;var role_list=[];for(d in me.roles_dict){if(me.roles_dict[d].checked){role_list.push(d);}} -var callback=function(r,rt){me.update_btn.done_working();me.dialog.hide();} -var arg={'usr':id,'role_list':role_list};me.update_btn.set_working();$c_obj('Company Control','update_roles',docstring(arg),callback);} -RoleObj.prototype.get_permissions=function(role){var me=this;var callback=function(r,rt){$(me.help_div).slideToggle('medium');$(me.role_div).slideToggle('medium');me.set_permissions(r.message,role);} -$c_obj('Company Control','get_permission',role,callback);} -RoleObj.prototype.set_permissions=function(perm,role){var me=this;me.help_div.body.innerHTML='';if(perm){me.help_div.head.innerHTML='Permissions for '+role+':

';perm_tbl=make_table(me.help_div.body,cint(perm.length)+2,7,'100%',['30%','10%','10%','10%','10%','10%','10%'],{padding:'4px'});var head_lst=['Document','Read','Write','Create','Submit','Cancel','Amend'];for(var i=0;i<(head_lst.length-1);i++){$td(perm_tbl,0,i).innerHTML=""+head_lst[i]+"";} -var accept_img1='images/icons/accept.gif';var cancel_img1='images/icons/cancel.gif';for(i=1;i
';} \ No newline at end of file diff --git a/my_company/page/my_company/my_company.txt b/my_company/page/my_company/my_company.txt deleted file mode 100644 index 4977ac9c63..0000000000 --- a/my_company/page/my_company/my_company.txt +++ /dev/null @@ -1 +0,0 @@ -[{'creation': '2010-06-29 12:40:20', 'module': 'My Company', 'doctype': 'Page', 'owner': 'Administrator', 'style': '', 'modified_by': 'Administrator', 'script': None, 'show_in_menu': 1, 'content': None, 'page_name': 'My Company', 'menu_index': None, 'docstatus': 0, 'parent': None, 'standard': 'Yes', 'icon': None, 'name': 'My Company', 'idx': None, 'static_content': None, 'modified': '2010-12-01 17:09:46', 'parenttype': None, 'parent_node': None, 'parentfield': None}, {'modified_by': 'Administrator', 'name': 'PR000143', 'parent': 'My Company', 'creation': '2010-06-29 16:40:26', 'modified': '2010-12-01 17:09:46', 'doctype': 'Page Role', 'idx': 1, 'parenttype': 'Page', 'role': 'Administrator', 'owner': 'Administrator', 'docstatus': 0, 'parentfield': 'roles'}, {'modified_by': 'Administrator', 'name': 'PR000153', 'parent': 'My Company', 'creation': '2010-08-06 20:18:55', 'modified': '2010-12-01 17:09:46', 'doctype': 'Page Role', 'idx': 2, 'parenttype': 'Page', 'role': 'All', 'owner': 'nabin@webnotestech.com', 'docstatus': 0, 'parentfield': 'roles'}] \ No newline at end of file diff --git a/patches/patch.py b/patches/patch.py index 0ab691274e..9b9255b6cc 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,6 +1,6 @@ # REMEMBER to update this # ======================== -last_patch = 276 +last_patch = 277 #------------------------------------------- @@ -1097,3 +1097,15 @@ def execute(patch_no): for d in sn: delete_doc('Search Criteria', d[0]) reload_doc('crm', 'search_criteria', 'sales_personwise_transaction_summary') + elif patch_no == 277: + webnotes.model.delete_doc('DocType','HomePage Settings') + webnotes.model.delete_doc('DocType','Badge Settings') + sql("update tabDocType set module='Home' where module in ('Event Updates', 'My Company')") + sql("update tabPage set module='Home' where module in ('Event Updates', 'My Company')") + sql("update `tabSearch Criteria` set module='Home' where module in ('Event Updates', 'My Company')") + + + delete_pages = ('Chat User Gallery', 'Badge Info', 'Home', 'Website Setup', 'Test Page', 'Setup Masters', 'Service', 'Selling', 'Sales Reports', 'Organize','My Cart', 'My Activity', 'Manage Users', 'Maintenance', 'Getting Started', 'Gantt Test', 'Custom Reports - Stock', 'Custom Reports - Selling', 'Custom Reports - Production', 'Custom Reports - Payroll', 'Custom Reports - Maintenance', 'Custom Reports - Buying', 'Custom Reports - Accounts', 'CRM Setup', 'CRM Reports') + for p in delete_pages: + webnotes.model.delete_doc('Page',p) + \ No newline at end of file diff --git a/srm/doctype/supplier/supplier.py b/srm/doctype/supplier/supplier.py index af5b85a650..e6db6c326e 100644 --- a/srm/doctype/supplier/supplier.py +++ b/srm/doctype/supplier/supplier.py @@ -29,7 +29,8 @@ class DocType: if supp_master_name == 'Supplier Name': # filter out bad characters in name - supp = self.doc.supplier_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') + #supp = self.doc.supplier_name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') + supp = self.doc.supplier_name cust = sql("select name from `tabCustomer` where name = '%s'" % (supp)) cust = cust and cust[0][0] or '' diff --git a/tools/doctype/address/address.py b/tools/doctype/address/address.py index dc177436fa..eabf624af2 100644 --- a/tools/doctype/address/address.py +++ b/tools/doctype/address/address.py @@ -22,7 +22,7 @@ class DocType: self.doc.name = self.doc.sales_partner + '-' + self.doc.address_type # filter out bad characters in name - self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') + #self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','').replace('`','') #---------------------- # Call to Validate diff --git a/tools/doctype/contact/contact.py b/tools/doctype/contact/contact.py index 7498619775..6d7c4c442a 100644 --- a/tools/doctype/contact/contact.py +++ b/tools/doctype/contact/contact.py @@ -22,7 +22,7 @@ class DocType: self.doc.name = self.doc.first_name + (self.doc.last_name and ' ' + self.doc.last_name or '') + '-' + self.doc.sales_partner # filter out bad characters in name - self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','') + #self.doc.name = self.doc.name.replace('&','and').replace('.','').replace("'",'').replace('"','').replace(',','') #---------------------- # Call to Validate