ffl_core.customer_profile¶
Source: apps/ffl_core/ffl_core/customer_profile.py · 3 endpoint(s)
Generated by
make api-docs— do not edit by hand.
get_family¶
POST /api/method/ffl_core.customer_profile.get_family
Auth (derived from code): Requires read permission on Customer (Frappe DocType permission check).
The family a customer belongs to, for the Customer form's Family section.
| arg | type | required | default | description |
|---|---|---|---|---|
customer |
string | yes | — | Customer name (document id). |
Returns: {"primary": {"name", "customer_name"} or None, "relationship": the customer's relationship to that primary or None, "members": [{"name", "customer_name", "relationship"}] — empty for a member, "can_merge": whether the caller may merge customers (drives the form's Merge button)}.
apps/ffl_core/ffl_core/customer_profile.py:317
get_stored_id_counts¶
POST /api/method/ffl_core.customer_profile.get_stored_id_counts
Auth (derived from code): Requires write permission on FFL Settings (Frappe DocType permission check).
What turning off Store Customer ID Numbers would erase, for the FFL Settings confirm.
Returns: {"dates_of_birth": int, "id_numbers": int, "total": int} across all customers.
apps/ffl_core/ffl_core/customer_profile.py:135
merge_customer¶
POST /api/method/ffl_core.customer_profile.merge_customer
Auth (derived from code): Roles: Sales Manager / System Manager
Merge a duplicate customer into the one to keep; the duplicate is deleted.
The source's alerts and ID documents are copied onto the target (identical rows skipped), a date of birth the target lacks is filled, a Banned source makes the target Banned, and the source's own family link is carried when the target has none. The source's email, the emails on its Contacts, its GunBroker user id and its own aliases are recorded on the target as aliases (values the target already has are skipped), so a later Woo / GunBroker order carrying one of them lands on the target instead of starting a duplicate. Then ERPNext's merge-rename moves every link — invoices, orders, 4473s, payments, contacts, addresses, family members — to the target and deletes the source; open sales documents get the target's display name. Refused for the Woo web-store aggregate and the walk-in customer, when both are FFL dealers with different licence numbers, when only the source is a dealer, when either is a register's default customer, or when the merge would nest one family inside another.
| arg | type | required | default | description |
|---|---|---|---|---|
source |
string | yes | — | Customer to merge away (deleted). |
target |
string | yes | — | Customer to keep. |
Returns: {"name": target, "customer_name": target's display name, "alerts_copied": int, "ids_copied": int}.
apps/ffl_core/ffl_core/customer_profile.py:343