fix: Customer dashboard fixes

This commit is contained in:
deepeshgarg007
2019-04-10 16:04:22 +05:30
parent 7f7a1b48ed
commit 4f0a4a1a2d
3 changed files with 8 additions and 6 deletions

View File

@@ -6,6 +6,9 @@ def get_data():
'heatmap': True,
'heatmap_message': _('This is based on transactions against this Customer. See timeline below for details'),
'fieldname': 'customer',
'non_standard_fieldnames': {
'Quotation': 'customer_lead'
},
'transactions': [
{
'label': _('Pre Sales'),

View File

@@ -122,8 +122,8 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False):
def set_missing_values(source, target):
if customer:
target.customer = customer
target.customer_name = customer
target.customer = customer.name
target.customer_name = customer.customer_name
target.ignore_pricing_rule = 1
target.flags.ignore_permissions = ignore_permissions
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):
if customer:
target.customer = customer
target.customer_name = customer
target.customer = customer.name
target.customer_name = customer.customer_name
target.ignore_pricing_rule = 1
target.flags.ignore_permissions = ignore_permissions
target.run_method("set_missing_values")
@@ -235,4 +235,4 @@ def _make_customer(source_name, ignore_permissions=False):
else:
return customer_name
else:
return quotation[2]
return frappe.get_doc("Customer",quotation[2])

View File

@@ -33,7 +33,6 @@ class TestShoppingCart(unittest.TestCase):
self.assertEqual(quotation.quotation_to, "Customer")
self.assertEqual(quotation.contact_person,
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)
return quotation