mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
[rename] Customer Issue -> Warranty Claim
This commit is contained in:
@@ -1 +0,0 @@
|
||||
Issue raised by Customer, can be tagged against Invoice, Serial Number to verify warranty, service contract.
|
||||
@@ -1 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,6 +0,0 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Customer Issue",
|
||||
"name": "_Test Customer Issue 1"
|
||||
}
|
||||
]
|
||||
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
0
erpnext/support/doctype/warranty_claim/__init__.py
Normal file
0
erpnext/support/doctype/warranty_claim/__init__.py
Normal file
6
erpnext/support/doctype/warranty_claim/test_records.json
Normal file
6
erpnext/support/doctype/warranty_claim/test_records.json
Normal file
@@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"doctype": "Warranty Claim",
|
||||
"name": "_Test Warranty Claim 1"
|
||||
}
|
||||
]
|
||||
@@ -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
|
||||
@@ -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)
|
||||
@@ -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": [
|
||||
{
|
||||
@@ -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",
|
||||
@@ -1,4 +1,4 @@
|
||||
frappe.listview_settings['Customer Issue'] = {
|
||||
frappe.listview_settings['Warranty Claim'] = {
|
||||
add_fields: ["status", "customer", "item_code"],
|
||||
filters:[["status","=", "Open"]]
|
||||
};
|
||||
Reference in New Issue
Block a user