Merge pull request #16556 from nabinhait/payroll-cost-center

fix: Don't force fetch cost center from company in payroll entry
This commit is contained in:
Nabin Hait 2019-02-05 13:32:16 +05:30 committed by GitHub
commit efff826e15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -95,6 +95,8 @@ frappe.ui.form.on('Payroll Entry', {
},
setup: function (frm) {
frm.add_fetch('company', 'cost_center', 'cost_center');
frm.set_query("payment_account", function () {
var account_types = ["Bank", "Cash"];
return {

View File

@ -1,5 +1,6 @@
{
"allow_copy": 1,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
@ -861,7 +862,8 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_from": "company.cost_center",
"default": ":Company",
"fetch_from": "",
"fieldname": "cost_center",
"fieldtype": "Link",
"hidden": 0,
@ -1189,7 +1191,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-21 16:15:45.276711",
"modified": "2019-02-05 10:41:08.865842",
"modified_by": "Administrator",
"module": "HR",
"name": "Payroll Entry",

View File

@ -21,6 +21,8 @@ class TestPayrollEntry(unittest.TestCase):
make_earning_salary_component(setup=True)
make_deduction_salary_component(setup=True)
frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 0)
def test_payroll_entry(self): # pylint: disable=no-self-use
company = erpnext.get_default_company()
for data in frappe.get_all('Salary Component', fields = ["name"]):