diff --git a/patches/october_2012/remove_old_customer_contact_address.py b/patches/october_2012/remove_old_customer_contact_address.py new file mode 100644 index 0000000000..17674ce72a --- /dev/null +++ b/patches/october_2012/remove_old_customer_contact_address.py @@ -0,0 +1,7 @@ +def execute(): + import webnotes + webnotes.conn.sql("""delete from `tabSearch Criteria` \ + where name = 'customer_address_contact'""") + + from webnotes.modules import reload_doc + reload_doc('selling', 'report', 'customer_addresses_and_contacts') \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 04ec2a329a..f750ac06f5 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -619,4 +619,8 @@ patch_list = [ 'patch_module': 'patches.october_2012', 'patch_file': 'fix_wrong_vouchers', }, + { + 'patch_module': 'patches.october_2012', + 'patch_file': 'remove_old_customer_contact_address', + }, ] diff --git a/public/js/modules.js b/public/js/modules.js index fb7775e0e1..616d7f29a9 100644 --- a/public/js/modules.js +++ b/public/js/modules.js @@ -170,8 +170,11 @@ erpnext.module_page.make_list = function(module, wrapper) { parent: $parent2, method: 'utilities.get_report_list', render_row: function(row, data) { - data.report_type = data.is_query_report ? "query-report" : "Report2" - $(row).html(repl('\ %(name)s', data)) }, diff --git a/selling/report/__init__.py b/selling/report/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/selling/report/customer_addresses_and_contacts/__init__.py b/selling/report/customer_addresses_and_contacts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt new file mode 100644 index 0000000000..621571da37 --- /dev/null +++ b/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt @@ -0,0 +1,27 @@ +# Report, Customer Addresses and Contacts +[ + + # These values are common in all dictionaries + { + u'creation': '2012-10-04 17:36:36', + u'docstatus': 0, + u'modified': '2012-10-04 18:24:07', + u'modified_by': u'Administrator', + u'owner': u'Administrator' + }, + + # These values are common for all Report + { + u'doctype': u'Report', + 'is_standard': u'Yes', + u'name': u'__common__', + 'query': u'SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc', + 'ref_doctype': u'Customer' + }, + + # Report, Customer Addresses and Contacts + { + u'doctype': u'Report', + u'name': u'Customer Addresses and Contacts' + } +] \ No newline at end of file diff --git a/selling/search_criteria/customer_address_contact/__init__.py b/selling/search_criteria/customer_address_contact/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/selling/search_criteria/customer_address_contact/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.py b/selling/search_criteria/customer_address_contact/customer_address_contact.py deleted file mode 100644 index 4ec0e1afc7..0000000000 --- a/selling/search_criteria/customer_address_contact/customer_address_contact.py +++ /dev/null @@ -1,23 +0,0 @@ -from __future__ import unicode_literals -col_defs = [ - {'label': 'Id', 'type': 'Link', 'width': '', 'options': 'Customer'}, - {'label': 'Customer Name'}, - {'label': 'Address Line 1', 'width': '200px'}, - {'label': 'Address Line 2', 'width': '200px'}, - {'label': 'City'}, - {'label': 'State'}, - {'label': 'Pincode', 'width': '80px'}, - {'label': 'Country', 'width': '100px'}, - {'label': 'Contact First Name'}, - {'label': 'Contact Last Name'}, - {'label': 'Contact Phone', 'width': '100px'}, - {'label': 'Contact Mobile', 'width': '100px'}, - {'label': 'Contact Email'}, -] -webnotes.msgprint(colnames) -for col in col_defs: - colnames.append(col['label']) - coltypes.append(col.get('type') or 'Data') - colwidths.append(col.get('width') or '150px') - coloptions.append(col.get('options') or '') - col_idx[col['label']] = len(colnames) - 1 \ No newline at end of file diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.sql b/selling/search_criteria/customer_address_contact/customer_address_contact.sql deleted file mode 100644 index b30a6f9f09..0000000000 --- a/selling/search_criteria/customer_address_contact/customer_address_contact.sql +++ /dev/null @@ -1,28 +0,0 @@ -SELECT - `tabCustomer`.name, - `tabCustomer`.customer_name, - `tabAddress`.address_line1, - `tabAddress`.address_line2, - `tabAddress`.city, - `tabAddress`.state, - `tabAddress`.pincode, - `tabAddress`.country, - `tabContact`.first_name, - `tabContact`.last_name, - `tabContact`.phone, - `tabContact`.mobile_no, - `tabContact`.email_id -FROM - `tabCustomer` - left join `tabAddress` on ( - `tabAddress`.customer=`tabCustomer`.name and - ifnull(`tabAddress`.is_primary_address, 0)=1 - ) - left join `tabContact` on ( - `tabContact`.customer=`tabCustomer`.name and - ifnull(`tabContact`.is_primary_contact, 0)=1 - ) -WHERE - `tabCustomer`.docstatus<2 -ORDER BY - `tabCustomer`.customer_name asc \ No newline at end of file diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.txt b/selling/search_criteria/customer_address_contact/customer_address_contact.txt deleted file mode 100644 index 3c94a520b8..0000000000 --- a/selling/search_criteria/customer_address_contact/customer_address_contact.txt +++ /dev/null @@ -1,31 +0,0 @@ -# Search Criteria, customer_address_contact -[ - - # These values are common in all dictionaries - { - 'creation': '2012-04-17 11:29:10', - 'docstatus': 0, - 'modified': '2012-05-23 18:17:40', - 'modified_by': u'Administrator', - 'owner': u'Administrator' - }, - - # These values are common for all Search Criteria - { - 'columns': u'Customer\x01ID,Customer\x01Customer Name', - 'criteria_name': u'Customer Address Contact', - 'doc_type': u'Customer', - 'doctype': 'Search Criteria', - 'filters': u"{'Customer\x01Saved':1,'Customer\x01Submitted':1}", - 'module': u'Selling', - 'name': '__common__', - 'page_len': 50, - 'standard': u'Yes' - }, - - # Search Criteria, customer_address_contact - { - 'doctype': 'Search Criteria', - 'name': u'customer_address_contact' - } -] \ No newline at end of file