Skip to content

Commit f68c840

Browse files
fix: do not allow to make future stock transactions
1 parent 2ada270 commit f68c840

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

erpnext/controllers/stock_controller.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import frappe
88
from frappe import _, bold
9-
from frappe.utils import cint, cstr, flt, get_link_to_form, getdate
9+
from frappe.utils import cint, cstr, flt, get_link_to_form, getdate, today
1010

1111
import erpnext
1212
from erpnext.accounts.general_ledger import (
@@ -64,6 +64,11 @@ def validate(self):
6464
self.validate_internal_transfer()
6565
self.validate_putaway_capacity()
6666
self.reset_conversion_factor()
67+
self.validate_future_date()
68+
69+
def validate_future_date(self):
70+
if self.docstatus == 0 and self.get("posting_date") and self.posting_date > today():
71+
frappe.throw(_("Posting Date should not be more than today's date."))
6772

6873
def reset_conversion_factor(self):
6974
for row in self.get("items"):

0 commit comments

Comments
 (0)