Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Editable Letter Head field in Salary Structure Doctype #2436

Merged
merged 3 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions hrms/payroll/doctype/salary_structure/salary_structure.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ frappe.ui.form.on("Salary Structure", {
},

company: function (frm) {
let company = locals[":Company"][frm.doc.company];
if (!frm.doc.letter_head && company.default_letter_head) {
frm.set_value("letter_head", company.default_letter_head);
}
frm.trigger("set_earning_deduction_component");
},

Expand Down
38 changes: 5 additions & 33 deletions hrms/payroll/doctype/salary_structure/salary_structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"search_index": 1
},
{
"allow_on_submit": 1,
"fetch_from": "company.default_letter_head",
"fetch_if_empty": 1,
"fieldname": "letter_head",
"fieldtype": "Link",
"label": "Letter Head",
Expand Down Expand Up @@ -239,44 +242,13 @@
"idx": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-11-21 18:02:55.785057",
"modified": "2024-11-22 11:17:28.384386",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Structure",
"naming_rule": "Set by user",
"owner": "Administrator",
"permissions": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default perms got removed accidentally IG

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're removed while saving the updated doctype settings, couldn't figure out why, added them back

{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "HR User",
"share": 1,
"submit": 1,
"write": 1
},
{
"amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"import": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "HR Manager",
"share": 1,
"submit": 1,
"write": 1
}
],
"permissions": [],
"show_name_in_global_search": 1,
"sort_field": "creation",
"sort_order": "DESC",
Expand Down
Loading