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

pymysql.err.OperationalError: (1054, "Unknown column 'tabLoan.repay_from_salary' in 'where clause'") #2427

Open
edkiefo opened this issue Nov 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@edkiefo
Copy link

edkiefo commented Nov 15, 2024

Information about bug

An Error every time i try to submit or save salary slip

Module

accounts, HR

Version

frappe": "14.67.1
"erpnext": "14.75.1"

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
	"ecommerce_integrations": "1.20.0",
	"erpnext": "14.75.1",
	"frappe": "14.67.1",
	"frappe_helper": "0.3.3",
	"hospitality": "0.0.1",
	"hrms": "14.35.1",
	"payments": "0.0.1",
	"posawesome": "6.3.0",
	"restaurant_management": "1.3.7",
	"twilio_integration": "0.0.1"
}

Route

Form/Salary Slip/Sal Slip/HR-EMP-00010/00003

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 95, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1608, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 31, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 305, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 340, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1048, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 915, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1267, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1249, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 912, in fn
    return method_object(*args, **kwargs)
  File "apps/hrms/hrms/payroll/doctype/salary_slip/salary_slip.py", line 146, in validate
    self.calculate_net_pay()
  File "apps/hrms/hrms/payroll/doctype/salary_slip/salary_slip.py", line 734, in calculate_net_pay
    self.set_loan_repayment()
  File "apps/hrms/hrms/payroll/doctype/salary_slip/salary_slip.py", line 1812, in set_loan_repayment
    for loan in self.get_loan_details():
  File "apps/hrms/hrms/payroll/doctype/salary_slip/salary_slip.py", line 1849, in get_loan_details
    loan_details = frappe.get_all(
  File "apps/frappe/frappe/__init__.py", line 1927, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1899, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/db_query.py", line 190, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/db_query.py", line 231, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 244, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'tabLoan.repay_from_salary' in 'where clause'")

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"name\":\"Sal Slip/HR-EMP-00010/00003\",\"owner\":\"[email protected]\",\"creation\":\"2024-11-13 16:35:30.986979\",\"modified\":\"2024-11-13 16:35:30.986979\",\"modified_by\":\"[email protected]\",\"docstatus\":0,\"idx\":0,\"employee\":\"HR-EMP-00010\",\"employee_name\":\"Debora Gallinotti\",\"department\":\"Hotel Management - YIH\",\"designation\":\"General Manager\",\"posting_date\":\"2024-11-13\",\"status\":\"Draft\",\"company\":\"Yasa Boutique Hotel\",\"currency\":\"USD\",\"exchange_rate\":7800,\"payroll_frequency\":\"Monthly\",\"start_date\":\"2024-10-16\",\"end_date\":\"2024-11-15\",\"salary_structure\":\"Structure A-F\",\"mode_of_payment\":\"Cash\",\"salary_slip_based_on_timesheet\":0,\"deduct_tax_for_unclaimed_employee_benefits\":0,\"deduct_tax_for_unsubmitted_tax_exemption_proof\":0,\"total_working_days\":27,\"unmarked_days\":0,\"leave_without_pay\":0,\"absent_days\":27,\"payment_days\":0,\"total_working_hours\":0,\"hour_rate\":0,\"base_hour_rate\":0,\"gross_pay\":1185,\"base_gross_pay\":9243000,\"gross_year_to_date\":1292,\"base_gross_year_to_date\":0,\"total_deduction\":0,\"base_total_deduction\":0,\"total_principal_amount\":0,\"total_interest_amount\":0,\"total_loan_repayment\":0,\"net_pay\":1185,\"base_net_pay\":9243000,\"rounded_total\":1185,\"base_rounded_total\":9243000,\"year_to_date\":1292,\"base_year_to_date\":0,\"month_to_date\":1185,\"base_month_to_date\":0,\"total_in_words\":\"USD One Thousand, One Hundred And Eighty Five only.\",\"base_total_in_words\":\"TZS Nine Million, Two Hundred And Forty Three Thousand only.\",\"ctc\":0,\"income_from_other_sources\":0,\"total_earnings\":0,\"non_taxable_earnings\":900,\"standard_tax_exemption_amount\":0,\"tax_exemption_declaration\":0,\"deductions_before_tax_calculation\":0,\"annual_taxable_amount\":-900,\"income_tax_deducted_till_date\":0,\"current_month_income_tax\":0,\"future_income_tax_deductions\":0,\"total_income_tax\":0,\"doctype\":\"Salary Slip\",\"timesheets\":[],\"leave_details\":[],\"loans\":[],\"deductions\":[],\"earnings\":[{\"name\":\"e8aff25fef\",\"owner\":\"[email protected]\",\"creation\":\"2024-11-13 16:35:30.986979\",\"modified\":\"2024-11-13 16:35:30.986979\",\"modified_by\":\"[email protected]\",\"docstatus\":0,\"idx\":1,\"salary_component\":\"Basic\",\"abbr\":\"B\",\"amount\":1050,\"year_to_date\":1157,\"is_recurring_additional_salary\":0,\"statistical_component\":0,\"depends_on_payment_days\":0,\"exempted_from_income_tax\":0,\"is_tax_applicable\":1,\"is_flexible_benefit\":1,\"variable_based_on_taxable_salary\":0,\"do_not_include_in_total\":0,\"deduct_full_tax_on_selected_payroll_date\":0,\"amount_based_on_formula\":0,\"default_amount\":0,\"additional_amount\":0,\"tax_on_flexible_benefit\":0,\"tax_on_additional_salary\":0,\"parent\":\"Sal Slip/HR-EMP-00010/00003\",\"parentfield\":\"earnings\",\"parenttype\":\"Salary Slip\",\"doctype\":\"Salary Detail\"},{\"name\":\"ab1b545056\",\"owner\":\"[email protected]\",\"creation\":\"2024-11-13 16:35:30.986979\",\"modified\":\"2024-11-13 16:35:30.986979\",\"modified_by\":\"[email protected]\",\"docstatus\":0,\"idx\":2,\"salary_component\":\"Housing\",\"abbr\":\"HUS\",\"amount\":300,\"year_to_date\":600,\"is_recurring_additional_salary\":0,\"statistical_component\":0,\"depends_on_payment_days\":0,\"exempted_from_income_tax\":0,\"is_tax_applicable\":0,\"is_flexible_benefit\":1,\"variable_based_on_taxable_salary\":0,\"do_not_include_in_total\":1,\"deduct_full_tax_on_selected_payroll_date\":0,\"amount_based_on_formula\":0,\"default_amount\":0,\"additional_amount\":0,\"tax_on_flexible_benefit\":0,\"tax_on_additional_salary\":0,\"parent\":\"Sal Slip/HR-EMP-00010/00003\",\"parentfield\":\"earnings\",\"parenttype\":\"Salary Slip\",\"doctype\":\"Salary Detail\"},{\"name\":\"e486100e29\",\"owner\":\"[email protected]\",\"creation\":\"2024-11-13 16:35:30.986979\",\"modified\":\"2024-11-13 16:35:30.986979\",\"modified_by\":\"[email protected]\",\"docstatus\":0,\"idx\":3,\"salary_component\":\"Overtime\",\"abbr\":\"OVT\",\"amount\":55,\"year_to_date\":55,\"is_recurring_additional_salary\":0,\"statistical_component\":0,\"depends_on_payment_days\":0,\"exempted_from_income_tax\":0,\"is_tax_applicable\":1,\"is_flexible_benefit\":0,\"variable_based_on_taxable_salary\":0,\"do_not_include_in_total\":0,\"deduct_full_tax_on_selected_payroll_date\":0,\"amount_based_on_formula\":0,\"default_amount\":0,\"additional_amount\":0,\"tax_on_flexible_benefit\":0,\"tax_on_additional_salary\":0,\"parent\":\"Sal Slip/HR-EMP-00010/00003\",\"parentfield\":\"earnings\",\"parenttype\":\"Salary Slip\",\"doctype\":\"Salary Detail\"},{\"name\":\"af67c34f18\",\"owner\":\"[email protected]\",\"creation\":\"2024-11-13 16:35:30.986979\",\"modified\":\"2024-11-13 16:35:30.986979\",\"modified_by\":\"[email protected]\",\"docstatus\":0,\"idx\":4,\"salary_component\":\"Bonus\",\"abbr\":\"BNS\",\"amount\":80,\"year_to_date\":80,\"is_recurring_additional_salary\":0,\"statistical_component\":0,\"depends_on_payment_days\":0,\"exempted_from_income_tax\":0,\"is_tax_applicable\":1,\"is_flexible_benefit\":1,\"variable_based_on_taxable_salary\":0,\"do_not_include_in_total\":0,\"deduct_full_tax_on_selected_payroll_date\":0,\"amount_based_on_formula\":0,\"default_amount\":0,\"additional_amount\":0,\"tax_on_flexible_benefit\":0,\"tax_on_additional_salary\":0,\"parent\":\"Sal Slip/HR-EMP-00010/00003\",\"parentfield\":\"earnings\",\"parenttype\":\"Salary Slip\",\"doctype\":\"Salary Detail\"}],\"__last_sync_on\":\"2024-11-15T12:46:32.322Z\"}",
		"action": "Submit"
	},
	"btn": {
		"jQuery3600166322429693495751": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 491,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs"
}

Response Data

{
	"exception": "pymysql.err.OperationalError: (1054, \"Unknown column 'tabLoan.repay_from_salary' in 'where clause'\")"
}
@edkiefo edkiefo added the bug Something isn't working label Nov 15, 2024
@Nihantra-Patel Nihantra-Patel transferred this issue from frappe/erpnext Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant