Feature/part iteration task management - #3
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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)
| continue | ||
|
|
||
| # Get the Task document to get its subject and color | ||
| task_doc = frappe.get_doc("Task", task_row.task) |
There was a problem hiding this comment.
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.
Note
Introduces colored NPD template and refactors task sequencing/iteration flows.
colorto each templateTask; ensures ordering/dependencies increate_npd_templateget_task_sequence_from_templatenow returns list of dicts{subject, color}(fallback supported); consumers updated (task_generation,iteration_management,task_utils, reportpart_stage_matrix)cancel_all_tasks_except_rfqcancels all previous-iteration tasks (including completed) except RFQ;create_new_iterationgenerates 17 tasks starting from stage 2 and updates project part iterationstage_typeand inheritcolor; dependency checks, cancellation cascade, and blocked status usestage_typePart Stage Matrixadjusted for new sequence structure; UI tweaks inProjectform and alertingWritten by Cursor Bugbot for commit 297534a. This will update automatically on new commits. Configure here.