Merge pull request #33143 from deepeshgarg007/auto_repeat_dates
fix: Auto repeat date validations
This commit is contained in:
commit
8287fb5104
@ -239,6 +239,14 @@ class AccountsController(TransactionBase):
|
||||
else:
|
||||
item.set(field_map.get(self.doctype), default_deferred_account)
|
||||
|
||||
def validate_auto_repeat_subscription_dates(self):
|
||||
if (
|
||||
self.get("from_date")
|
||||
and self.get("to_date")
|
||||
and getdate(self.from_date) > getdate(self.to_date)
|
||||
):
|
||||
frappe.throw(_("To Date cannot be before From Date"), title=_("Invalid Auto Repeat Date"))
|
||||
|
||||
def validate_deferred_start_and_end_date(self):
|
||||
for d in self.items:
|
||||
if d.get("enable_deferred_revenue") or d.get("enable_deferred_expense"):
|
||||
|
@ -41,6 +41,7 @@ class BuyingController(SubcontractingController):
|
||||
self.validate_from_warehouse()
|
||||
self.set_supplier_address()
|
||||
self.validate_asset_return()
|
||||
self.validate_auto_repeat_subscription_dates()
|
||||
|
||||
if self.doctype == "Purchase Invoice":
|
||||
self.validate_purchase_receipt_if_update_stock()
|
||||
|
@ -40,6 +40,7 @@ class SellingController(StockController):
|
||||
self.set_customer_address()
|
||||
self.validate_for_duplicate_items()
|
||||
self.validate_target_warehouse()
|
||||
self.validate_auto_repeat_subscription_dates()
|
||||
|
||||
def set_missing_values(self, for_validate=False):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user