fix: use in_import flag for checking imported records
(cherry picked from commit f504f2caf3)
This commit is contained in:
@@ -611,10 +611,9 @@ class AccountsController(TransactionBase):
|
||||
posting_date = (
|
||||
self.posting_date if self.doctype == "Sales Invoice" else (self.bill_date or self.posting_date)
|
||||
)
|
||||
via_data_import = (
|
||||
self.flags.updater_reference and self.flags.updater_reference.get("doctype") == "Data Import"
|
||||
)
|
||||
if via_data_import and getdate(self.due_date) < getdate(posting_date):
|
||||
|
||||
# skip due date validation for records via Data Import
|
||||
if frappe.flags.in_import and getdate(self.due_date) < getdate(posting_date):
|
||||
self.due_date = posting_date
|
||||
|
||||
elif self.doctype == "Sales Invoice":
|
||||
|
||||
Reference in New Issue
Block a user