ERPNext

Frappe CRM, while a standalone application, offers seamless integration with ERPNext to streamline your business processes. This integration allows you to create quotations and customers directly from deals within Frappe CRM, enhancing efficiency and reducing manual data entry.

Creating Quotation from Deals

The integration introduces a Create Quotation button on the Deal header. Clicking this button initiates the quotation creation process in your ERPNext instance, pre-filling relevant data from the Deal. You can then provide any additional information required and complete the quotation process within ERPNext.

Screenshot 2024-09-18 at 8.38.51 PMScreenshot 2024-09-18 at 8.41.41 PM

Creating Customer automatically

Upon marking a Deal as "Won" (or a specified status, configurable in ERPNext settings), a new customer will be created in your ERPNext instance. The Deal's contacts and organization address will be automatically linked to this newly created customer.

Screenshot 2024-09-18 at 8.45.09 PMScreenshot 2024-09-18 at 9.07.32 PM

Once the customer is created, you'll find a "View Customer" button on the deal header, allowing you to easily access the customer from deal page.

Screenshot 2024-09-18 at 8.43.34 PM

Currently ERPNext Integration is only supported for Deal Page

ERPNext Setup

There are two primary scenarios for integrating Frappe CRM with ERPNext:

Same Site

Both Frappe CRM and ERPNext are installed on the same site
Screenshot 2024-09-18 at 9.13.22 PM

  1. Navigate to Settings -> ERPNext -> Enable -> Set Company.
  2. Create Customer when status change -> Set Deal Status (Optional)

Separate Site

Frappe CRM and ERPNext are installed on different sitesScreenshot 2024-09-18 at 9.14.00 PM

  1. Navigate to Settings -> ERPNext -> Enable -> Set Company.
  2. Create Customer when status change -> Set Deal Status (Optional)
  3. Check the "Is ERPNext installed on a different site?" checkbox.
  4. Provide Credentials:

    1. ERPNext Site URL: The URL of your ERPNext instance.
    2. API Key: The API Key generated from your ERPNext instance.
    3. API Secret: The API Secret generated from your ERPNext instance.

Obtaining API Key and API Secret

  1. Log in to your ERPNext Instance
  2. Create a User with System Manager role
  3. Navigate to Settings -> API Access
  4. Click the Generate Keys button and Copy API Secret and save it for future use Screenshot 2024-09-18 at 9.11.27 PM
  5. Now you have API Key & API Secret
    Screenshot 2024-09-18 at 9.11.55 PM

    You can generate new API Secret if needed but you cannot create new API Key

Customizations

Create Quotation and View Customer button both are getting rendered by Standard Form Script which gets created once you enable ERPNext Integration.

async function setupForm({ doc, call, $dialog, updateField, createToast }) {
  let actions = [];
  let is_erpnext_integration_enabled = await call(
    "frappe.client.get_single_value",
    { doctype: "ERPNext CRM Settings", field: "enabled" }
  );
  if (
    !["Lost", "Won"].includes(doc?.status) &&
    is_erpnext_integration_enabled
  ) {
    actions.push({
      label: __("Create Quotation"),
      onClick: async () => {
        let quotation_url = await call(
          "crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.get_quotation_url",
          { crm_deal: doc.name, organization: doc.organization }
        );

        if (quotation_url) {
          window.open(quotation_url, "_blank");
        }
      },
    });
  }
  if (is_erpnext_integration_enabled) {
    let customer_url = await call(
      "crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.get_customer_link",
      { crm_deal: doc.name }
    );
    if (customer_url) {
      actions.push({
        label: __("View Customer"),
        onClick: () => window.open(customer_url, "_blank"),
      });
    }
  }
  return {
    actions: actions,
  };
}

What if you need to render these buttons based on your business requirements?

You cannot edit Standard Form Script as you can see in the screenshot it is not editable. But you can Disable it and create a Duplicate of it and you can change the conditions or add more actions based on your requirement.

Discard
Save

On this page