mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +00:00
fix: moved _validateHasReturnDocs to validations
This commit is contained in:
parent
f332b7153b
commit
dad0729aae
@ -198,6 +198,7 @@ export abstract class StockTransfer extends Transfer {
|
||||
await validateBatch(this);
|
||||
await validateSerialNumber(this);
|
||||
await validateSerialNumberStatus(this);
|
||||
await this._validateHasReturnDocs();
|
||||
}
|
||||
|
||||
async afterSubmit() {
|
||||
@ -207,11 +208,6 @@ export abstract class StockTransfer extends Transfer {
|
||||
await this._updateItemsReturned();
|
||||
}
|
||||
|
||||
async beforeCancel(): Promise<void> {
|
||||
await super.beforeCancel();
|
||||
await this._validateHasReturnDocs();
|
||||
}
|
||||
|
||||
async afterCancel(): Promise<void> {
|
||||
await super.afterCancel();
|
||||
await updateSerialNumbers(this, true, this.isReturn);
|
||||
@ -293,7 +289,7 @@ export abstract class StockTransfer extends Transfer {
|
||||
}
|
||||
|
||||
async _validateHasReturnDocs() {
|
||||
if (!this.name) {
|
||||
if (!this.name || !this.isCancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user