Sales Invoice & Quotation overrides
Purpose
Section titled “Purpose”Document extensions to ERPNext Sales Invoice and Quotation DocTypes.
Scope in codebase
Section titled “Scope in codebase”leekimerp/leekimerp/override/sales_invoice.pyleekimerp/leekimerp/override/quotation.py
OverrideSalesInvoice
Section titled “OverrideSalesInvoice”| Method | Behavior |
|---|---|
validate | Calls super().validate() only — no extra business rules in subclass |
Whitelisted mapper (sales_invoice.py)
Section titled “Whitelisted mapper (sales_invoice.py)”| Function | Role |
|---|---|
make_quotation_from_invoice(source_name, target_doc=None) | Maps Sales Invoice → Quotation (quotation_to = Customer, party_name from customer) |
OverrideQuotation
Section titled “OverrideQuotation”| Method | Behavior |
|---|---|
| (class body) | pass — inherits standard Quotation behavior |
Whitelisted mapper (quotation.py)
Section titled “Whitelisted mapper (quotation.py)”| Function | Role |
|---|---|
make_invoice_from_quotation(source_name, target_doc=None) | Maps Quotation → Sales Invoice; throws if quotation_to is not Customer; sets customer from party_name; runs set_missing_values on target |
Entry points
Section titled “Entry points”- Desk: Buttons or scripts that call
make_quotation_from_invoice/make_invoice_from_quotationvia client or server actions (confirm inpublic/js/and Desk customization).
Dependencies
Section titled “Dependencies”frappe.model.mapper.get_mapped_doc, ERPNextSalesInvoice/Quotationcontrollers
Related
Section titled “Related”- Sales Invoice hook for description templating on update