Stock Entry validation in Journal Entry
This commit is contained in:
parent
5dbf8a7418
commit
2ca18ff913
@ -435,13 +435,12 @@ class JournalEntry(AccountsController):
|
|||||||
Pending Amount is {2}".format(d.idx, d.against_expense_claim, pending_amount)))
|
Pending Amount is {2}".format(d.idx, d.against_expense_claim, pending_amount)))
|
||||||
|
|
||||||
def validate_credit_debit_note(self):
|
def validate_credit_debit_note(self):
|
||||||
count = frappe.db.exists({
|
if self.stock_entry:
|
||||||
"doctype": "Journal Entry",
|
if frappe.db.get_value("Stock Entry", self.stock_entry, "docstatus") != 1:
|
||||||
"stock_entry":self.stock_entry,
|
frappe.throw(_("Stock Entry {0} is not submitted").format(self.stock_entry))
|
||||||
"docstatus":1
|
|
||||||
})
|
if frappe.db.exists({"doctype": "Journal Entry", "stock_entry": self.stock_entry, "docstatus":1}):
|
||||||
if count:
|
frappe.msgprint(_("Warning: Another {0} # {1} exists against stock entry {2}".format(self.voucher_type, self.name, self.stock_entry)))
|
||||||
frappe.throw(_("{0} already made against stock entry {1}".format(self.voucher_type, self.stock_entry)))
|
|
||||||
|
|
||||||
def validate_empty_accounts_table(self):
|
def validate_empty_accounts_table(self):
|
||||||
if not self.get('accounts'):
|
if not self.get('accounts'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user