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:
commit
7ea08a71e0
@ -179,7 +179,7 @@ export abstract class Invoice extends Transactional {
|
||||
async afterSubmit() {
|
||||
await super.afterSubmit();
|
||||
|
||||
if (this.schemaName === ModelNameEnum.SalesQuote) {
|
||||
if (this.isQuote) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user