mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 23:18:40 +00:00
fix(setup): use the stored lower-case fieldname in the Sales Person lookup (Postgres)
deactivate_sales_person looks up `frappe.db.get_value("Sales Person",
{"Employee": employee})`. The Sales Person field is `employee` (lower case);
the lookup runs with ignore_permissions, so the capital-cased key reaches the
query as the column `"Employee"`. PostgreSQL matches quoted identifiers
case-sensitively and errors:
column "Employee" does not exist
MariaDB resolves `Employee` to the `employee` column regardless of case, so
using the stored `{"employee": employee}` selects the same row on MariaDB and
is valid on PostgreSQL.
This commit is contained in:
@@ -427,7 +427,7 @@ def is_holiday(employee, date=None, raise_exception=True, only_non_weekly=False,
|
||||
def deactivate_sales_person(status: str, employee: str):
|
||||
frappe.has_permission("Employee", doc=employee, ptype="write", throw=True)
|
||||
if status == "Left":
|
||||
sales_person = frappe.db.get_value("Sales Person", {"Employee": employee})
|
||||
sales_person = frappe.db.get_value("Sales Person", {"employee": employee})
|
||||
if sales_person:
|
||||
frappe.db.set_value("Sales Person", sales_person, "enabled", 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user