[rename] Customer Issue -> Warranty Claim

This commit is contained in:
Rushabh Mehta 2015-02-17 10:45:50 +05:30
parent 60cfccbf77
commit 46e03eadca
20 changed files with 42 additions and 38 deletions

View File

@ -13,8 +13,8 @@ def get_data():
},
{
"type": "doctype",
"name": "Customer Issue",
"description": _("Customer Issue against Serial No."),
"name": "Warranty Claim",
"description": _("Warranty Claim against Serial No."),
},
{
"type": "doctype",

View File

@ -20,7 +20,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
docname = last_route.slice(2).join("/");
if(["Customer", "Quotation", "Sales Order", "Sales Invoice", "Delivery Note",
"Installation Note", "Opportunity", "Customer Issue", "Maintenance Visit",
"Installation Note", "Opportunity", "Warranty Claim", "Maintenance Visit",
"Maintenance Schedule"]
.indexOf(doctype)!==-1) {
var refdoc = frappe.get_doc(doctype, docname);

View File

@ -110,3 +110,4 @@ erpnext.patches.v5_0.remove_birthday_events
erpnext.patches.v5_0.update_item_name_in_bom
execute:frappe.reload_doc('crm', 'doctype', 'lead')
execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
erpnext.patches.v5_0.rename_customer_issue

View File

@ -13,7 +13,7 @@ doctype_series_map = {
'Attendance': 'ATT-',
'C-Form': 'C-FORM-',
'Customer': 'CUST-',
'Customer Issue': 'CI-',
'Warranty Claim': 'CI-',
'Delivery Note': 'DN-',
'Installation Note': 'IN-',
'Item': 'ITEM-',

View File

@ -10,7 +10,7 @@ doctype_series_map = {
'Attendance': 'ATT-',
'C-Form': 'C-FORM-',
'Customer': 'CUST-',
'Customer Issue': 'CI-',
'Warranty Claim': 'CI-',
'Delivery Note': 'DN-',
'Installation Note': 'IN-',
'Item': 'ITEM-',

View File

@ -0,0 +1,5 @@
import frappe
def execute():
if frappe.db.table_exists("tabCustomer Issue"):
frappe.rename_doc("DocType", "Customer Issue", "Warrany Claim")

View File

@ -64,7 +64,7 @@ erpnext.feature_setup.feature_dict = {
'Stock Ledger Entry': {'fields':['batch_no']}
},
'fs_item_serial_nos': {
'Customer Issue': {'fields':['serial_no']},
'Warranty Claim': {'fields':['serial_no']},
'Delivery Note': {'items':['serial_no'],'packed_items':['serial_no']},
'Installation Note': {'items':['serial_no']},
'Item': {'fields':['has_serial_no']},
@ -155,7 +155,7 @@ erpnext.feature_setup.feature_dict = {
'Sales Order': {'fields':['sales_team']}
},
'fs_more_info': {
"Customer Issue": {"fields": ["more_info"]},
"Warranty Claim": {"fields": ["more_info"]},
'Material Request': {'fields':['more_info']},
'Lead': {'fields':['more_info']},
'Opportunity': {'fields':['more_info']},

View File

@ -8,7 +8,7 @@ def get_notification_config():
return { "for_doctype":
{
"Issue": {"status":"Open"},
"Customer Issue": {"status":"Open"},
"Warranty Claim": {"status":"Open"},
"Task": {"status":"Open"},
"Lead": {"status":"Open"},
"Contact": {"status":"Open"},

View File

@ -1 +0,0 @@
Issue raised by Customer, can be tagged against Invoice, Serial Number to verify warranty, service contract.

View File

@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@ -1,6 +0,0 @@
[
{
"doctype": "Customer Issue",
"name": "_Test Customer Issue 1"
}
]

View File

@ -27,11 +27,11 @@ erpnext.support.MaintenanceVisit = frappe.ui.form.Controller.extend({
}
})
}, "icon-download", "btn-default");
cur_frm.add_custom_button(__('From Customer Issue'),
cur_frm.add_custom_button(__('From Warranty Claim'),
function() {
frappe.model.map_current_doc({
method: "erpnext.support.doctype.customer_issue.customer_issue.make_maintenance_visit",
source_doctype: "Customer Issue",
source_doctype: "Warranty Claim",
get_query_filters: {
status: ["in", "Open, Work in Progress"],
customer: cur_frm.doc.customer || undefined,

View File

@ -24,7 +24,7 @@ class MaintenanceVisit(TransactionBase):
def update_customer_issue(self, flag):
for d in self.get('purposes'):
if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' :
if d.prevdoc_docname and d.prevdoc_doctype == 'Warranty Claim' :
if flag==1:
mntc_date = self.mntc_date
service_person = d.service_person
@ -48,11 +48,11 @@ class MaintenanceVisit(TransactionBase):
service_person = ''
work_done = ''
frappe.db.sql("update `tabCustomer Issue` set resolution_date=%s, resolved_by=%s, resolution_details=%s, status=%s where name =%s",(mntc_date,service_person,work_done,status,d.prevdoc_docname))
frappe.db.sql("update `tabWarranty Claim` set resolution_date=%s, resolved_by=%s, resolution_details=%s, status=%s where name =%s",(mntc_date,service_person,work_done,status,d.prevdoc_docname))
def check_if_last_visit(self):
"""check if last maintenance visit against same sales order/ customer issue"""
"""check if last maintenance visit against same sales order/ Warranty Claim"""
check_for_docname = None
for d in self.get('purposes'):
if d.prevdoc_docname:

View File

@ -0,0 +1,6 @@
[
{
"doctype": "Warranty Claim",
"name": "_Test Warranty Claim 1"
}
]

View File

@ -4,7 +4,7 @@
import frappe
import unittest
test_records = frappe.get_test_records('Customer Issue')
test_records = frappe.get_test_records('Warranty Claim')
class TestCustomerIssue(unittest.TestCase):
class TestWarrantyClaim(unittest.TestCase):
pass

View File

@ -4,14 +4,14 @@
frappe.provide("erpnext.support");
frappe.require("assets/erpnext/js/utils.js");
frappe.ui.form.on_change("Customer Issue", "customer", function(frm) {
frappe.ui.form.on_change("Warranty Claim", "customer", function(frm) {
erpnext.utils.get_party_details(frm) });
frappe.ui.form.on_change("Customer Issue", "customer_address",
frappe.ui.form.on_change("Warranty Claim", "customer_address",
erpnext.utils.get_address_display);
frappe.ui.form.on_change("Customer Issue", "contact_person",
frappe.ui.form.on_change("Warranty Claim", "contact_person",
erpnext.utils.get_contact_details);
erpnext.support.CustomerIssue = frappe.ui.form.Controller.extend({
erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
refresh: function() {
if((cur_frm.doc.status=='Open' || cur_frm.doc.status == 'Work In Progress')) {
cur_frm.add_custom_button(__('Make Maintenance Visit'),
@ -27,7 +27,7 @@ erpnext.support.CustomerIssue = frappe.ui.form.Controller.extend({
}
});
$.extend(cur_frm.cscript, new erpnext.support.CustomerIssue({frm: cur_frm}));
$.extend(cur_frm.cscript, new erpnext.support.WarrantyClaim({frm: cur_frm}));
cur_frm.cscript.onload = function(doc,cdt,cdn){
if(!doc.status)

View File

@ -387,7 +387,7 @@
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Data",
"options": "Customer Issue",
"options": "Warranty Claim",
"permlevel": 0,
"print_hide": 1,
"width": "150px"
@ -396,10 +396,10 @@
"icon": "icon-bug",
"idx": 1,
"is_submittable": 0,
"modified": "2015-02-05 05:11:36.857779",
"modified": "2015-02-17 00:12:52.430072",
"modified_by": "Administrator",
"module": "Support",
"name": "Customer Issue",
"name": "Warranty Claim",
"owner": "harshada@webnotestech.com",
"permissions": [
{

View File

@ -11,7 +11,7 @@ from frappe.utils import today
from erpnext.utilities.transaction_base import TransactionBase
class CustomerIssue(TransactionBase):
class WarrantyClaim(TransactionBase):
def get_feed(self):
return _("{0}: From {1}").format(self.status, self.customer_name)
@ -20,7 +20,7 @@ class CustomerIssue(TransactionBase):
frappe.throw(_("Customer is required"))
if self.status=="Closed" and \
frappe.db.get_value("Customer Issue", self.name, "status")!="Closed":
frappe.db.get_value("Warranty Claim", self.name, "status")!="Closed":
self.resolution_date = today()
def on_cancel(self):
@ -30,7 +30,7 @@ class CustomerIssue(TransactionBase):
(self.name))
if lst:
lst1 = ','.join([x[0] for x in lst])
frappe.throw(_("Cancel Material Visit {0} before cancelling this Customer Issue").format(lst1))
frappe.throw(_("Cancel Material Visit {0} before cancelling this Warranty Claim").format(lst1))
else:
frappe.db.set(self, 'status', 'Cancelled')
@ -51,14 +51,14 @@ def make_maintenance_visit(source_name, target_doc=None):
and t1.docstatus=1 and t1.completion_status='Fully Completed'""", source_name)
if not visit:
target_doc = get_mapped_doc("Customer Issue", source_name, {
"Customer Issue": {
target_doc = get_mapped_doc("Warranty Claim", source_name, {
"Warranty Claim": {
"doctype": "Maintenance Visit",
"field_map": {}
}
}, target_doc)
source_doc = frappe.get_doc("Customer Issue", source_name)
source_doc = frappe.get_doc("Warranty Claim", source_name)
if source_doc.get("item_code"):
table_map = {
"doctype": "Maintenance Visit Purpose",

View File

@ -1,4 +1,4 @@
frappe.listview_settings['Customer Issue'] = {
frappe.listview_settings['Warranty Claim'] = {
add_fields: ["status", "customer", "item_code"],
filters:[["status","=", "Open"]]
};