chore: fix patch

This commit is contained in:
Deepesh Garg 2022-11-04 08:11:38 +05:30
parent 153675e52a
commit f6a61b999f

View File

@ -1,12 +1,13 @@
import frappe
from frappe.utils import nowdate
from erpnext.accounts.utils import get_fiscal_year
from erpnext.accounts.utils import FiscalYearError, get_fiscal_year
def execute():
# Only do for current fiscal year, no need to repost for all years
for company in frappe.get_all("Company"):
try:
fiscal_year_details = get_fiscal_year(date=nowdate(), company=company.name, as_dict=True)
purchase_invoice = frappe.qb.DocType("Purchase Invoice")
@ -24,3 +25,5 @@ def execute():
).where(
purchase_invoice.docstatus == 1
).run()
except FiscalYearError:
pass