# Bug SPAR-214 - WP can't be transformed to a Milestone if it is automatically scheduled

Project: Stream Planning and Reporting
Status: closed
URL: https://community.openproject.org/work_packages/SPAR-214

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 15.5.0 |
| Observed in versions | 15.4.0 |
| Bug found in version (deprecated) | 15.4.x |
| 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

### Steps to reproduce

1.  Create a WP of a type which is not a Milestone

2.  Make sure, that the WP has duration larger than 1 day

3.  Make sure, that the WP is automatically scheduled
    
    1.  and add a child (with dates set with a duratino larger than 1 day)

4.  Try to change the type of the WP to a Milestone type

### What is the buggy behavior?

  - There is an error, because a work package with children cannot be a milestone, and it also tries to set the dates to the children's dates which generates additional errors: the finish date can't be changed (as it is automatically scheduled) but a Milestone needs to have the finish date the same as the start date. 

<img class="image_resized op-uc-image op-uc-image_inline" style="width:582px;" src="/api/v3/attachments/389769/content"> <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/389773/content">

### What is the expected behavior?

  - Only the error "Type cannot be a milestone because this work package has children" should be displayed

### Environment information

**OpenProject version**

*15.4*

**Browser**

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

**Operating System**

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

**Language**

German
