fix: don't set Company:company:default_currency as default for currency link fields (#25111)

This commit is contained in:
Afshan 2021-03-31 21:57:04 +05:30 committed by GitHub
parent c482c9592f
commit 2fef245607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 59 additions and 27 deletions

View File

@ -181,7 +181,6 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -201,7 +200,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-11-25 12:01:55.980721",
"modified": "2021-03-31 21:31:53.746659",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Advance",

View File

@ -130,7 +130,6 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -155,7 +154,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-11-25 11:56:06.777241",
"modified": "2021-03-31 21:32:55.492327",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Encashment",

View File

@ -163,7 +163,6 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -176,7 +175,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-20 17:51:13.419716",
"modified": "2021-03-31 21:33:59.098532",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Additional Salary",

View File

@ -124,7 +124,6 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -148,7 +147,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-12-14 15:52:08.566418",
"modified": "2021-03-31 21:35:08.940087",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee Benefit Application",

View File

@ -21,7 +21,6 @@ frappe.ui.form.on('Employee Benefit Claim', {
callback: function(r) {
if (r.message) {
frm.set_value('currency', r.message);
frm.set_df_property('currency', 'hidden', 0);
}
}
});

View File

@ -125,10 +125,9 @@
"label": "Attachments"
},
{
"default": "Company:company:default_currency",
"depends_on": "eval: doc.employee",
"fieldname": "currency",
"fieldtype": "Link",
"hidden": 1,
"label": "Currency",
"options": "Currency",
"read_only": 1,
@ -145,7 +144,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-11-25 11:49:56.097352",
"modified": "2021-03-31 21:37:21.024625",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee Benefit Claim",

View File

@ -75,7 +75,6 @@
"reqd": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -95,7 +94,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-20 17:22:16.468042",
"modified": "2021-03-31 21:38:20.332316",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee Incentive",

View File

@ -47,5 +47,26 @@ frappe.ui.form.on('Employee Tax Exemption Declaration', {
});
}).addClass("btn-primary");
}
},
employee: function(frm) {
if (frm.doc.employee) {
frm.trigger('get_employee_currency');
}
},
get_employee_currency: function(frm) {
frappe.call({
method: "erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment.get_employee_currency",
args: {
employee: frm.doc.employee,
},
callback: function(r) {
if (r.message) {
frm.set_value('currency', r.message);
frm.refresh_fields();
}
}
});
}
});

View File

@ -108,7 +108,7 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval: doc.employee",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
@ -119,7 +119,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-20 16:42:24.493761",
"modified": "2021-03-31 21:39:59.237361",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee Tax Exemption Declaration",

View File

@ -58,5 +58,26 @@ frappe.ui.form.on('Employee Tax Exemption Proof Submission', {
currency: function(frm) {
frm.refresh_fields();
}
},
employee: function(frm) {
if (frm.doc.employee) {
frm.trigger('get_employee_currency');
}
},
get_employee_currency: function(frm) {
frappe.call({
method: "erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment.get_employee_currency",
args: {
employee: frm.doc.employee,
},
callback: function(r) {
if (r.message) {
frm.set_value('currency', r.message);
frm.refresh_fields();
}
}
});
},
});

View File

@ -131,7 +131,7 @@
"read_only": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval: doc.employee",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
@ -142,7 +142,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-20 16:47:03.410020",
"modified": "2021-03-31 21:41:13.723339",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Employee Tax Exemption Proof Submission",

View File

@ -93,7 +93,7 @@
"options": "Income Tax Slab Other Charges"
},
{
"default": "Company:company:default_currency",
"fetch_from": "company.default_currency",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
@ -104,7 +104,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-19 13:54:24.728075",
"modified": "2021-03-31 21:42:08.139520",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Income Tax Slab",

View File

@ -93,7 +93,6 @@
"reqd": 1
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.employee)",
"fieldname": "currency",
"fieldtype": "Link",
@ -106,7 +105,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-10-20 17:27:47.003134",
"modified": "2021-03-31 21:43:28.363644",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Retention Bonus",

View File

@ -500,7 +500,6 @@
"fieldtype": "Column Break"
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.salary_structure)",
"fetch_from": "salary_structure.currency",
"fieldname": "currency",
@ -632,7 +631,7 @@
"idx": 9,
"is_submittable": 1,
"links": [],
"modified": "2021-02-19 11:48:05.383945",
"modified": "2021-03-31 21:44:09.772331",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Slip",

View File

@ -125,7 +125,6 @@
"options": "Income Tax Slab"
},
{
"default": "Company:company:default_currency",
"depends_on": "eval:(doc.docstatus==1 || doc.salary_structure)",
"fetch_from": "salary_structure.currency",
"fieldname": "currency",
@ -146,7 +145,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-11-30 18:07:48.251311",
"modified": "2021-03-31 21:44:46.267974",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Structure Assignment",