Merge pull request #24170 from shariquerik/precision-in-webform

fix: added precision field in webform field
This commit is contained in:
Shariq Ansari 2024-01-08 14:57:30 +05:30 committed by GitHub
commit 6d40d1c6da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View file

@ -234,6 +234,7 @@ class DocType(Document):
"DocPerm",
"Custom Field",
"Customize Form Field",
"Web Form Field",
"DocField",
]

View file

@ -107,6 +107,7 @@ frappe.ui.form.on("Web Form", {
reqd: df.reqd,
default: df.default,
read_only: df.read_only,
precision: df.precision,
depends_on: df.depends_on,
mandatory_depends_on: df.mandatory_depends_on,
read_only_depends_on: df.read_only_depends_on,

View file

@ -17,6 +17,7 @@
"options",
"max_length",
"max_value",
"precision",
"property_depends_on_section",
"depends_on",
"mandatory_depends_on",
@ -143,11 +144,19 @@
"fieldtype": "Code",
"label": "Read Only Depends On",
"options": "JS"
},
{
"depends_on": "eval:in_list([\"Float\", \"Currency\", \"Percent\"], doc.fieldtype)",
"description": "Set non-standard precision for a Float or Currency field",
"fieldname": "precision",
"fieldtype": "Select",
"label": "Precision",
"options": "\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9"
}
],
"istable": 1,
"links": [],
"modified": "2022-11-21 17:41:52.139191",
"modified": "2024-01-08 13:21:06.272248",
"modified_by": "Administrator",
"module": "Website",
"name": "Web Form Field",

View file

@ -56,6 +56,7 @@ class WebFormField(Document):
parent: DF.Data
parentfield: DF.Data
parenttype: DF.Data
precision: DF.Literal["", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
read_only: DF.Check
read_only_depends_on: DF.Code | None
reqd: DF.Check