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: add missing disbursement account in update_old_loans patch #37889

Merged
merged 1 commit into from
Nov 3, 2023
Merged

fix: add missing disbursement account in update_old_loans patch #37889

merged 1 commit into from
Nov 3, 2023

Conversation

anandbaburajan
Copy link
Contributor

@anandbaburajan anandbaburajan commented Nov 3, 2023

The patch was failing with:

  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v13_0/update_old_loans.py", line 131, in execute
    loan_type_doc.submit()
      updated_loan_types = []
      loans_to_close = ['ACC-LOAN-2019-00001', 'ELN0004']
      loans_list = [{'parent': 'ACC-LOAN-2019-00001'}, {'parent': 'ELN0004'}]
      loans = [{'name': 'ACC-LOAN-2019-00001', 'loan_type': 'Advances', 'company': 'Greentek India Limited', 'status': 'Disbursed', 'mode_of_payment': 'Online', 'applicant_type': 'Employee', 'applicant': 'EMP/0142', 'loan_account': 'Emp Advances - GIPL', 'payment_account': 'Kotak Mahindra Bank - 05522000005884 - GIPL', 'interest_income_account': 'Interest Income - GIPL'}, {'name': 'ELN0004', 'loan_type': 'Advances', 'company': 'Greentek India Limited', 'status': 'Fully Disbursed', 'mode_of_payment': 'Cash', 'applicant_type': 'Employee', 'applicant': 'EMP/0141', 'loan_account': 'Imprest Account - GIPL', 'payment_account': 'Cash Office - GIPL', 'interest_income_account': 'Interest Income - GIPL'}]
      loan = {'name': 'ACC-LOAN-2019-00001', 'loan_type': 'Advances', 'company': 'Greentek India Limited', 'status': 'Disbursed', 'mode_of_payment': 'Online', 'applicant_type': 'Employee', 'applicant': 'EMP/0142', 'loan_account': 'Emp Advances - GIPL', 'payment_account': 'Kotak Mahindra Bank - 05522000005884 - GIPL', 'interest_income_account': 'Interest Income - GIPL'}
      loan_type_company = None
      loan_type = 'Advances'
      group_income_account = 'Indirect Income - GIPL'
      penalty_account = 'Penalty Account - GIPL'
      loan_type_doc = <LoanType: Advances docstatus=1>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1010, in submit
    return self._submit()
      self = <LoanType: Advances docstatus=1>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 989, in _submit
    return self.save()
      self = <LoanType: Advances docstatus=1>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 309, in save
    return self._save(*args, **kwargs)
      self = <LoanType: Advances docstatus=1>
      args = ()
      kwargs = {}
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 346, in _save
    self._validate()
      self = <LoanType: Advances docstatus=1>
      ignore_permissions = None
      ignore_version = None
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 533, in _validate
    self._validate_mandatory()
      self = <LoanType: Advances docstatus=1>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 868, in _validate_mandatory
    raise frappe.MandatoryError(
      self = <LoanType: Advances docstatus=1>
      missing = [('disbursement_account', 'Error: Value missing for Loan Type: Disbursement Account')]
      fieldname = 'disbursement_account'
      msg = 'Error: Value missing for Loan Type: Disbursement Account'
frappe.exceptions.MandatoryError: [Loan Type, Advances]: disbursement_account

Related: #32403

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 3, 2023
@anandbaburajan anandbaburajan merged commit 6b5cffc into frappe:version-14-hotfix Nov 3, 2023
anandbaburajan added a commit that referenced this pull request Nov 3, 2023
…-37889

fix: add missing disbursement account in update_old_loans patch (backport #37889)
@anandbaburajan
Copy link
Contributor Author

@mergify backport version-14

Copy link
Contributor

mergify bot commented Nov 3, 2023

backport version-14

✅ Backports have been created

anandbaburajan added a commit that referenced this pull request Nov 3, 2023
fix: add missing disbursement account in update_old_loans patch (backport #37889)
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.47.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-13-hotfix needs-tests This PR needs automated unit-tests. released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants