mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
Merge pull request #16942 from hrwX/invoice-creation-tool
fix(Invoice Creation Tool): Disable P/L validation for opening invoice creation
This commit is contained in:
@@ -74,7 +74,8 @@ class GLEntry(Document):
|
||||
|
||||
def check_pl_account(self):
|
||||
if self.is_opening=='Yes' and \
|
||||
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
|
||||
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
|
||||
self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']:
|
||||
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
|
||||
.format(self.voucher_type, self.voucher_no, self.account))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user