Skip to content

Commit

Permalink
feat: Add author, department (#49)
Browse files Browse the repository at this point in the history
* feat: Add cost center and project transfer to expense claim

* feat: Add author, department, fix Jinja in content

* Revert "feat: Add cost center and project transfer to expense claim"

This reverts commit 323e0a4.

* feat: add rights for employee to select

Add employee rights to select, if not trip creation fails
Add someone for accounting to manage

* Revert "feat: add rights for employee to select"

This reverts commit a79cf7c.

* fix: remove reqd, change author to sender

* fix: narrow down from company to department to employee

* refactor: use doc parameter in set_query, move to setup hook

---------

Co-authored-by: barredterra <[email protected]>
  • Loading branch information
0xD0M1M0 and barredterra authored Feb 19, 2025
1 parent 91c7065 commit 6699170
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
// For license information, please see license.txt

frappe.ui.form.on("Business Letter", {
setup(frm) {
frm.set_query("department", function (doc) {
return {
filters: {
company: doc.company,
},
};
});

frm.set_query("employee", function (doc) {
return {
filters: {
company: doc.company,
status: "Active",
...(doc.department && { department: doc.department }),
},
};
});
},
onload(frm) {
set_html_data(frm);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
"field_order": [
"amended_from",
"section_break_ikyq",
"recipient_column",
"address",
"address_display",
"column_break_ybiq",
"contact",
"email_id",
"address_display",
"column_break_ybiq",
"date",
"company",
"department",
"employee",
"employee_name",
"section_break_bsox",
"template",
"subject",
Expand Down Expand Up @@ -108,7 +112,8 @@
},
{
"fieldname": "column_break_ybiq",
"fieldtype": "Column Break"
"fieldtype": "Column Break",
"label": "Sender"
},
{
"fieldname": "preview_tab",
Expand Down Expand Up @@ -191,12 +196,38 @@
"options": "Company",
"print_hide": 1,
"remember_last_selected_value": 1
},
{
"fieldname": "recipient_column",
"fieldtype": "Column Break",
"label": "Recipient"
},
{
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Department"
},
{
"fieldname": "employee",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Employee",
"options": "Employee",
"print_hide": 1
},
{
"fetch_from": "employee.employee_name",
"fieldname": "employee_name",
"fieldtype": "Data",
"label": "Employee Name",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-07-24 16:00:48.347166",
"modified": "2025-02-19 22:06:05.863438",
"modified_by": "Administrator",
"module": "ERPNext Germany",
"name": "Business Letter",
Expand Down Expand Up @@ -251,4 +282,4 @@
"sort_order": "DESC",
"states": [],
"title_field": "subject_preview"
}
}

0 comments on commit 6699170

Please sign in to comment.