From 7cbd916b000f612596f02f265191595f22fd1793 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 8 Jun 2015 12:06:33 +0530 Subject: [PATCH 1/2] [fix] Fiscal year issue due to missing field in Material Request --- erpnext/controllers/accounts_controller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 16ff4b4d29c..8d51bcf48f6 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -38,7 +38,8 @@ class AccountsController(TransactionBase): convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) def before_recurring(self): - self.fiscal_year = None + if self.meta.get_field("fiscal_year"): + self.fiscal_year = None if self.meta.get_field("due_date"): self.due_date = None @@ -46,7 +47,7 @@ class AccountsController(TransactionBase): for fieldname in ["posting_date", "transaction_date"]: if not self.get(fieldname) and self.meta.get_field(fieldname): self.set(fieldname, today()) - if not self.fiscal_year: + if self.meta.get_field("fiscal_year") and not self.fiscal_year: self.fiscal_year = get_fiscal_year(self.get(fieldname))[0] break From 000835c45483dcd45a9061b45c5b10a1bd64c7e6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 8 Jun 2015 12:10:43 +0530 Subject: [PATCH 2/2] [fix] Fiscal year issue due to missing field in Material Request --- erpnext/controllers/accounts_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 8d51bcf48f6..98f240958f8 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -38,8 +38,8 @@ class AccountsController(TransactionBase): convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) def before_recurring(self): - if self.meta.get_field("fiscal_year"): - self.fiscal_year = None + if self.meta.get_field("fiscal_year"): + self.fiscal_year = None if self.meta.get_field("due_date"): self.due_date = None