Skip to content

fix: repair lease status, invoicing and report defects - #76

Merged
aakvatech merged 14 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:fix/lease-invoicing-defects
Sep 4, 2026
Merged

fix: repair lease status, invoicing and report defects#76
aakvatech merged 14 commits into
Aakvatech-Limited:version-16-hotfixfrom
av-dev2:fix/lease-invoicing-defects

Conversation

@av-dev2

@av-dev2 av-dev2 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Functional defects found while building the version-16 test suite. Each one is
covered by a test in the suite PR, and each was reproduced on the v16 test bench
before it was fixed.

Lease status was never set

Lease.validate() called set_lease_status() after the active-lease limit
check, and set_lease_status() treated a blank status as a manual choice and
returned early. A newly inserted Lease therefore kept lease_status = ""
forever, which silently disabled four features at once:

  • the configurable max active leases limit (it only runs when the status is
    already Active, which never happened on insert);
  • lease renewalinitiate_lease_renewal rejects anything that is not
    Active or Expired;
  • the daily status scheduler, whose filter is lease_status in (Upcoming, Active, Expired);
  • the property increment engine, which only walks Active leases.

The status is now resolved first, and a blank status is treated as
system-controlled rather than manual.

Everything else

File Defect
auto_custom.py invoice schedule rows were written with parenttype="lease" (lowercase), so any parent_doctype-scoped query missed them
lease_invoice.py the final flush of leaseInvoiceAutoCreate dereferenced invoice_item when the schedule was empty; a failing invoice was swallowed with no visible trace. The flush is guarded, validation errors now propagate out of makeInvoice, and batch failures are written to the Error Log. A duplicated parent field was removed from the query
lease_invoice_schedule.py frappe.db.sql(query.get_sql()) replaced with query.run()
mis_income_break_up/other_methods.py the loop that computes withholding tax iterated over the row label as well, so the report died with could not convert string to float: 'Total Rentals Received' on every run
subscription_service_report the filter definition was missing a comma before get_query, so the whole file failed to parse and the report had no filters; the SQL also selected item_name from tabSales Invoice, where that column does not exist
daily_checklist, outsourcing_attendance, security_attendance autoname: naming_series: with a Data field that had no options — inserting any of them failed with Naming Series mandatory, which also broke the Handover checklist that Lease.on_submit creates
property_tree.js the new-node dialog sent property_name, but Property is named from name1, so creating a property from the tree view failed with Name is required
issue.js the stock shortage message interpolated into __() instead of passing placeholders

Depends on #75.

av-dev2 and others added 2 commits September 3, 2026 15:33
# Conflicts:
#	.gitignore
#	propms/__init__.py
#	propms/auto_custom.py
#	propms/hooks.py
#	propms/issue_hook.py
#	propms/lease_invoice.py
#	propms/lease_invoice_schedule.py
#	propms/pos.js
#	propms/property_management_solution/doctype/lease/lease.py
#	propms/property_management_solution/doctype/property/property.py
#	propms/property_management_solution/report/mis_income_break_up/other_methods.py
#	propms/property_management_solution/report/subscription_service_report/subscription_service_report.js
#	pyproject.toml
@aakvatech
aakvatech merged commit 620b2e0 into Aakvatech-Limited:version-16-hotfix Sep 4, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants