mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 04:15:10 +00:00
fix: add validation for duplication
(cherry picked from commit cda8a97f4a)
This commit is contained in:
@@ -869,6 +869,16 @@ class SalesInvoice(SellingController):
|
|||||||
if status not in ["Submitted", "Payslip", "Partially Billed"]:
|
if status not in ["Submitted", "Payslip", "Partially Billed"]:
|
||||||
frappe.throw(_("Timesheet {0} is already completed or cancelled").format(data.time_sheet))
|
frappe.throw(_("Timesheet {0} is already completed or cancelled").format(data.time_sheet))
|
||||||
|
|
||||||
|
if data.time_sheet and data.timesheet_detail:
|
||||||
|
if sales_invoice := frappe.db.get_value(
|
||||||
|
"Timesheet Detail", data.timesheet_detail, "sales_invoice"
|
||||||
|
):
|
||||||
|
frappe.throw(
|
||||||
|
_("Row {0}: Sales Invoice {1} is already created for {2}").format(
|
||||||
|
data.idx, frappe.bold(sales_invoice), frappe.bold(data.time_sheet)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def set_pos_fields(self, for_validate=False):
|
def set_pos_fields(self, for_validate=False):
|
||||||
"""Set retail related fields from POS Profiles"""
|
"""Set retail related fields from POS Profiles"""
|
||||||
if cint(self.is_pos) != 1:
|
if cint(self.is_pos) != 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user