mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-22 02:40:02 +00:00
fix(selling): make commission_rate a Percent field on Sales Person and Sales Team
commission_rate was a free-text Data field on the Sales Person master and the Sales Team child, storing percentages as strings. Convert both to Percent. A pre_model_sync patch sanitizes the existing values first (empty / NULL / non-numeric -> 0, others normalised via flt) so the Data -> Percent column change casts cleanly under strict SQL mode, where Percent is a NOT NULL decimal column. The patch is idempotent and avoids db-specific SQL so it works on both MariaDB and Postgres.
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
},
|
||||
{
|
||||
"fieldname": "commission_rate",
|
||||
"fieldtype": "Data",
|
||||
"fieldtype": "Percent",
|
||||
"label": "Commission Rate",
|
||||
"print_hide": 1
|
||||
},
|
||||
@@ -145,7 +145,7 @@
|
||||
"idx": 1,
|
||||
"is_tree": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-27 13:10:37.891377",
|
||||
"modified": "2026-06-21 12:52:33.742603",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Sales Person",
|
||||
@@ -184,4 +184,4 @@
|
||||
"sort_field": "creation",
|
||||
"sort_order": "ASC",
|
||||
"states": []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user