Skip to content

Conversation

@anjusha12
Copy link
Contributor

Feature description

Refactor Task doctype override from complete NestedSet replacement to extended class inheritance, maintaining only custom validate_status logic while leveraging ERPNext's core Task functionality.

Analysis and design (optional)

Analyse and attach the design documentation

Solution description

  1. Class Inheritance: Changed class CustomTask(NestedSet) to class CustomTask(Task)

    • Now imports and extends ERPNext's Task class
    • Inherits all standard validation, update, and lifecycle methods
  2. Removed Duplicate Methods: Eliminated 20+ methods that duplicated ERPNext functionality:

    • Validation methods (validate, validate_dates, validate_progress, etc.)
    • Lifecycle hooks (on_update, on_trash, after_delete)
    • Helper methods (update_nsm_model, check_recursion, etc.)
  3. Retained Custom Logic: Only kept validate_status() method with custom behavior:

    • Handles dependent task auto-completion based on Compliance Settings
    • Conditional validation skip when ignore_dependent_task_validation is enabled
    • Preserves existing compliance workflow requirements
  4. Removed Auto-generated Types: Type annotations now inherited from parent Task class

Output screenshots (optional)

Post the output screenshots, if a UI is affected or added due to this feature.

Areas affected and ensured

  • Task Creation: All standard task validations work via inheritance
  • Task Completion: Custom validate_status logic for dependent tasks
  • Project Integration: Task-to-project updates via inherited methods
  • Sales Order Creation: Triggered on task/project completion (tested via Compliance Agreement flow)
  • Task Dependencies: Validation and auto-completion logic preserved
  • Nested Task Structure: NSM model updates via inherited functionality
  • Time Tracking: Timesheet integration via inherited methods
  • Task Assignment: Assignment closure on completion via inherited logic

Is there any existing behavior change of other features due to this code change?

Mention Yes or No. If Yes, provide the appropriate explanation.

Was this feature tested on the browsers?

  • Chrome
  • Mozilla Firefox
  • Opera Mini
  • Safari

@anjusha12 anjusha12 changed the title refactor: Convert Task override to extended class inheritance TASK-2025-02771: Convert Task override to extended class inheritance Dec 1, 2025
@anjusha12 anjusha12 requested a review from MhmdSinanKT December 1, 2025 06:19
@SherinKR SherinKR added the Testing Required Approved by Reviewer and ready to test label Dec 3, 2025
@SherinKR SherinKR assigned anjusha12 and unassigned Jumana-K Dec 8, 2025
@SherinKR SherinKR added Has Conflicts Pending conflicts in files and removed Testing Required Approved by Reviewer and ready to test labels Dec 8, 2025
@SherinKR SherinKR added Testing Required Approved by Reviewer and ready to test and removed Has Conflicts Pending conflicts in files labels Dec 10, 2025
@SherinKR SherinKR assigned Jumana-K and unassigned anjusha12 Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing Required Approved by Reviewer and ready to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants