# Bug OP-18077 - Parent WP goes to "automatic" when only one child remains after removing all others

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18077

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Relations and scheduling |
| Target versions | 16.6.0 |
| Observed in versions | 16.5.0 |
| Sprint | 16.6.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.5.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Christophe Bliard |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

Bug extracted from <mention class="mention" data-id="68421" data-type="work_package" data-text="##68421">##68421</mention>.

### Steps to reproduce

*As a project manager doing top-down planning :* 

1.  Create a new orphan WP (neither parent nor child) "A" with **"manual"** scheduling mode and set some start and end dates

2.  Create a new WP "B" that is a child of A with "manual" scheduling mode and set some other start and end dates (OP will initialise the dates to be the same as A, change them)
    
    1.  → **A is now in "automatic" scheduling mode**

3.  reset A in "manual" mode with some start and end dates

4.  create a few other WP that are children of A

5.  delete all children of A except one

6.  → **A goes to "automatic" scheduling mode when all-but-one of its children are deleted**
    
    1.  **curiously, its dates are not updated. It keeps the dates it was having when in manual mode.**

### What is the buggy behavior?

The work package switched to automatic scheduling mode when deleting the second child (one child remained after deletion).

### What is the expected behavior?

If the parent has been set to manual scheduling mode by the user, it should remain like this and dates should not , even when children are deleted and only one remains.

This unexpected behavior is really annoying when planning a project top-down.

I expect the exact behavior described in [OpenProject's documentation](https://www.openproject.org/docs/user-guide/gantt-chart/scheduling/) :

> Manually-scheduled work packages can still have predecessor, successor, parent or child relations, but these relations will not affect the manually input dates.
> 
> \[...\]
> 
> Moving a child work package in the manual scheduling mode will not move the dates of the parent work package.

So after creating my parent WP and set its dates, I do not want them to be overridden and its mode overridden to "automatic" upon creating its first child.

### 

### Environment information

**OpenProject installation type**

  - Packaged installation
    
      - Debian 12

**OpenProject version**

16.5.1

**Browser**

- [ ] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [ ] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [x] Linux (ubuntu 22.04)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

French
