2
0
mirror of https://github.com/frappe/books.git synced 2025-01-22 22:58:28 +00:00

Merge pull request #935 from AbleKSaju/fix-lead

fix: enforce Lead creation before create Customer and SQUOT
This commit is contained in:
Akshay 2024-08-30 15:38:35 +05:30 committed by GitHub
commit 7ea08a71e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,7 @@ export abstract class Invoice extends Transactional {
async afterSubmit() {
await super.afterSubmit();
if (this.schemaName === ModelNameEnum.SalesQuote) {
if (this.isQuote) {
return;
}

View File

@ -126,6 +126,7 @@ export function getCreateCustomerAction(fyo: Fyo): Action {
return {
group: fyo.t`Create`,
label: fyo.t`Customer`,
condition: (doc: Doc) => !doc.notInserted,
action: async (doc: Doc, router) => {
const customerData = (doc as Lead).createCustomer();
@ -141,6 +142,7 @@ export function getSalesQuoteAction(fyo: Fyo): Action {
return {
group: fyo.t`Create`,
label: fyo.t`Sales Quote`,
condition: (doc: Doc) => !doc.notInserted,
action: async (doc, router) => {
const salesQuoteData = (doc as Lead).createSalesQuote();
if (!salesQuoteData.name) {