Skip to content

FIX set both status properties before deleting an order line - #34

Open
Pichinov-Jose wants to merge 1 commit into
SplashSync:2.0from
Pichinov-Jose:fix/deleteitem-order-status-property
Open

Pichinov-Jose wants to merge 1 commit into
SplashSync:2.0from
Pichinov-Jose:fix/deleteitem-order-status-property

Conversation

@Pichinov-Jose

Copy link
Copy Markdown

Bug

deleteItem() forces the order back to draft through $this->object->statut = 0. That property is deprecated: Dolibarr >= 22 reads $this->object->status, which still holds the validated value. deleteline() therefore sees a validated order and refuses, so every order line deletion fails on recent Dolibarr.

Fix

Set both properties. One line, and it keeps working on older versions.

Fixes #19. Running in production on a Dolibarr 23.0.0 shop.

🤖 Generated with Claude Code

deleteItem() forces the order back to draft through the deprecated ->statut
property. Dolibarr >= 22 reads ->status, so the object still looks validated,
deleteline() refuses, and every order line deletion fails. Set both.

Closes SplashSync#19

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Order line deletion always fails on Dolibarr ≥ 22 — deleteItem() sets the deprecated ->statut

1 participant