Entropy CRM Docs

ERPNext

Entropy 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 Entropy CRM, enhancing efficiency and reducing manual data entry.

ERPNext Setup

Both Entropy CRM and ERPNext are installed on the same site

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

What gets synced

Once the integration is enabled, data flows between Entropy CRM and ERPNext as described below. Most syncing runs only when both apps are on the same site; differences for separate-site setups are called out where they apply.

Customers

Two Ways:

  1. 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 PM Screenshot 2024-09-18 at 9.07.32 PM
  2. When a Sales Order is create in ERPNext from a Deal's Quotation. he Create Quotation button on a Deal opens a new Quotation in ERPNext with the Deal's data pre-filled:

The typical Deal to Sales Order flow looks like:

Create Quotation

Quotation line items are pre-filled from the deal's products

New Quotation

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

CRM Product and ERPNext Item

ERPNext Items and CRM Products are kept in sync with ERPNext as the source of truth. This sync runs on the same site only.

Pricing

Product rates shown in the CRM follow ERPNext's pricing rather than a static value:

Customizations

The Create Quotation and View Customer buttons on the Deal page are rendered by a standard CRM Form Script named Create Quotation from CRM Deal. It is created automatically when you enable the integration and is bound to the CRM Deal form view.

How the script works

On load, the script checks whether the integration is enabled and if so, it adds the actions to the Deal header:

Form Script

Editing the script

Because it is a standard script, Create Quotation from CRM Deal is read-only and cannot be edited in place. This protects it from being overwritten.

To customize the behavior:

  1. Go to Desk → CRM Form Script.
  2. Disable the Create Quotation from CRM Deal script.
  3. Duplicate it (or create a new script on the CRM Deal form view) and make your changes there. for example: changing the conditions under which the buttons appear. Add new actions or adjust labels.
  4. Enable your copy.

Your custom script then renders the buttons in place of the standard one.

Example Script:

class CRMDeal {
        onLoad() {
                if (this.doc.__newDocument) return
                call(
                        "frappe.client.get_single_value",
                        {
                                doctype: "ERPNext CRM Settings",
                                field: "enabled"
                        }
                ).then((enabled) => {
                        if (enabled) this.doc.trigger('setActions')
                })
        }
        setActions() {
                // Only offer quotation creation for qualified-or-later deals
                const allowed = ["Qualification", "Proposal/Quotation", "Negotiation"]
                if (allowed.includes(this.doc.status)) {
                        this.actions.push({
                                label: __("Create Quotation"),
                                onClick: () => {
                                        call(
                                                "crm.fcrm.doctype.erpnext_crm_settings.erpnext"
                                                {
                                                        crm_deal: this.doc.name,
                                                        organization: this.doc.organization
                                                }
                                        ).then((quotation_url) => {
                                                if (quotation_url) {
                                                        window.open(quotation_url, '_blank')
                                                } else {
                                                        toast.error("Error while creating quotation")
                                                }
                                        }).catch((e) => {
                                                toast.error(e.messages[0] || "Error while creating")
                                        });
                                }
                        })
                }
     // A custom action unrelated to the integration
            this.actions.push({
                    label: __("Copy Deal Link"),
                    onClick: () => {
                            navigator.clipboard.writeText(window.location.href);
                            toast.success(__("Deal link copied"));
                    }
            })
    }
}
Entropy CRM Documentation← Docs home