Skip to content

Feature/part iteration task management - #3

Merged
Guru107 merged 3 commits into
developfrom
feature/part-iteration-task-management
Jan 23, 2026
Merged

Feature/part iteration task management#3
Guru107 merged 3 commits into
developfrom
feature/part-iteration-task-management

Conversation

@Guru107

@Guru107 Guru107 commented Jan 23, 2026

Copy link
Copy Markdown
Owner

Note

Introduces colored NPD template and refactors task sequencing/iteration flows.

  • New HSL-based color generator and template builder assign unique color to each template Task; ensures ordering/dependencies in create_npd_template
  • get_task_sequence_from_template now returns list of dicts {subject, color} (fallback supported); consumers updated (task_generation, iteration_management, task_utils, report part_stage_matrix)
  • Iteration flow change: new cancel_all_tasks_except_rfq cancels all previous-iteration tasks (including completed) except RFQ; create_new_iteration generates 17 tasks starting from stage 2 and updates project part iteration
  • Tasks now carry stage_type and inherit color; dependency checks, cancellation cascade, and blocked status use stage_type
  • Project save logic simplified: always set Item.project, generate tasks only for new parts, handle removals
  • Report Part Stage Matrix adjusted for new sequence structure; UI tweaks in Project form and alerting
  • Tests updated to reflect new API/behavior (sequence structure, iteration creation, cancellation semantics)

Written by Cursor Bugbot for commit 297534a. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

@claude

claude Bot commented Jan 23, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


@Guru107
Guru107 merged commit 7333a07 into develop Jan 23, 2026
2 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

cancelled_count = 0
for task in all_tasks:
# Skip RFQ Data task - it should never be cancelled (use stage_type for exact match)
if task.stage_type == rfq_stage_type:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFQ Data tasks without stage_type may be cancelled

Medium Severity

The comparison task.stage_type == rfq_stage_type doesn't check if task.stage_type is None or empty before comparing. If a task (particularly the RFQ Data task) has an unset or None stage_type field, it won't match and will be incorrectly cancelled during iteration creation or fail to be protected from manual cancellation. The code should use a null-safe check like task.stage_type and task.stage_type == rfq_stage_type.

Additional Locations (1)

Fix in Cursor Fix in Web

continue

# Get the Task document to get its subject and color
task_doc = frappe.get_doc("Task", task_row.task)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template task loading fails without error handling

Medium Severity

Changed from frappe.db.get_value to frappe.get_doc without error handling. If a template references a deleted or non-existent task, frappe.get_doc raises DoesNotExistError causing crashes, whereas the previous implementation with get_value returned None and gracefully skipped missing tasks. This regression affects template loading and task sequence generation when template tasks are corrupted or deleted.

Additional Locations (1)

Fix in Cursor Fix in Web

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