Skip to content

feat: Support for multi-unit leases via Lease Item table#51

Open
iamtalib13 wants to merge 1 commit intoAakvatech-Limited:version-15from
iamtalib13:feat/multi-property-lease-support
Open

feat: Support for multi-unit leases via Lease Item table#51
iamtalib13 wants to merge 1 commit intoAakvatech-Limited:version-15from
iamtalib13:feat/multi-property-lease-support

Conversation

@iamtalib13
Copy link
Copy Markdown

PR Description:

Context:
Currently, the Lease DocType is restricted to a single property linked in the header. Large property managers
often need to link additional units (such as parking spaces or storage) to a single lease agreement without the
overhead of creating separate documents for each unit.

Implementation Details:
Following a hybrid approach to ensure minimal disruption to the existing workflow and naming conventions:

  • Metadata Changes: Added an optional property_unit field to the Lease Item child table.
  • Core Logic (lease.py):
    • Refactored validate to perform conflict checks on all unique properties (Header + Table).
    • Updated on_submit to trigger status updates ("On Lease") and generate "Handover" checklists for every
      linked property.
  • UI Enhancements (lease.js): Added company-based filters for the new property_unit field.

Key Highlights:

  • Backward Compatible: Existing single-unit leases and current data remain unaffected.
  • Naming Intact: The Lease ID still follows the {property}-{#####} format based on the primary header unit.
  • Automated Validation: Prevents double-leasing of any unit involved in the agreement.

- Added 'property_unit' field to Lease Item child table
- Updated Lease validation to check for conflicts across all linked properties
- Updated Lease submission to update status and create handover checklists for all properties
- Maintained backward compatibility with existing header property field
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 7 complexity · 0 duplication

Metric Results
Complexity 7
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

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.

1 participant