mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 21:49:18 +00:00
fix: Customer dashboard fixes
This commit is contained in:
@@ -6,6 +6,9 @@ def get_data():
|
|||||||
'heatmap': True,
|
'heatmap': True,
|
||||||
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
|
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
|
||||||
'fieldname': 'customer',
|
'fieldname': 'customer',
|
||||||
|
'non_standard_fieldnames': {
|
||||||
|
'Quotation': 'customer_lead'
|
||||||
|
},
|
||||||
'transactions': [
|
'transactions': [
|
||||||
{
|
{
|
||||||
'label': _('Pre Sales'),
|
'label': _('Pre Sales'),
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
|
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
if customer:
|
if customer:
|
||||||
target.customer = customer
|
target.customer = customer.name
|
||||||
target.customer_name = customer
|
target.customer_name = customer.customer_name
|
||||||
target.ignore_pricing_rule = 1
|
target.ignore_pricing_rule = 1
|
||||||
target.flags.ignore_permissions = ignore_permissions
|
target.flags.ignore_permissions = ignore_permissions
|
||||||
target.run_method("set_missing_values")
|
target.run_method("set_missing_values")
|
||||||
@@ -169,8 +169,8 @@ def _make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
|
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
if customer:
|
if customer:
|
||||||
target.customer = customer
|
target.customer = customer.name
|
||||||
target.customer_name = customer
|
target.customer_name = customer.customer_name
|
||||||
target.ignore_pricing_rule = 1
|
target.ignore_pricing_rule = 1
|
||||||
target.flags.ignore_permissions = ignore_permissions
|
target.flags.ignore_permissions = ignore_permissions
|
||||||
target.run_method("set_missing_values")
|
target.run_method("set_missing_values")
|
||||||
@@ -235,4 +235,4 @@ def _make_customer(source_name, ignore_permissions=False):
|
|||||||
else:
|
else:
|
||||||
return customer_name
|
return customer_name
|
||||||
else:
|
else:
|
||||||
return quotation[2]
|
return frappe.get_doc("Customer",quotation[2])
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ class TestShoppingCart(unittest.TestCase):
|
|||||||
self.assertEqual(quotation.quotation_to, "Customer")
|
self.assertEqual(quotation.quotation_to, "Customer")
|
||||||
self.assertEqual(quotation.contact_person,
|
self.assertEqual(quotation.contact_person,
|
||||||
frappe.db.get_value("Contact", dict(email_id="test_cart_user@example.com")))
|
frappe.db.get_value("Contact", dict(email_id="test_cart_user@example.com")))
|
||||||
self.assertEqual(quotation.customer_lead, None)
|
|
||||||
self.assertEqual(quotation.contact_email, frappe.session.user)
|
self.assertEqual(quotation.contact_email, frappe.session.user)
|
||||||
|
|
||||||
return quotation
|
return quotation
|
||||||
|
|||||||
Reference in New Issue
Block a user