# Impede move line deletion directly from account plan and GL

**URL:** https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994
**Category:** Developer
**Tags:** accounting
**Created:** [November 25, 2019, 8:24am UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994 "2019-11-25T08:24:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [November 25, 2019, 8:24am UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994/1 "2019-11-25T08:24:19Z")

</div>

As perhaps intuited from [https://discuss.tryton.org/t/iterate-with-pyson](https://discuss.tryton.org/t/iterate-with-pyson), it is a royal pain that users can delete move lines from draft moves in certain forms, notably account plan and GL… finding after the fact which move is affected is not a delightful task.  
How best then to impede deletion from these forms, and only allow deletion of lines from the main account move form (or from something that creates whole moves like invoicing, statements etc…)..

---

<div class="post-metadata">

### Author: ![semarie](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/semarie/32/112_2.png) [@semarie](https://discuss.tryton.org/u/semarie)
#### Post date: [November 25, 2019, 8:47am UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994/2 "2019-11-25T08:47:52Z")

</div>

I am unsure if it is doable, but adding a validation step to ensure the move is balanced before saving could be a solution ?

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [November 25, 2019, 9:00am UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994/3 "2019-11-25T09:00:27Z")

</div>

Seb, the move is initially balanced… it’s the deletion of a single line that fouls things up.

---

<div class="post-metadata">

### Author: ![semarie](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/semarie/32/112_2.png) [@semarie](https://discuss.tryton.org/u/semarie)
#### Post date: [November 25, 2019, 10:52am UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994/4 "2019-11-25T10:52:37Z")

</div>

What I mean is when you delete a line from account plan (for example), tryton will first validate the move before saving it. And as deleting a line will make the move unbalanced, it should prevent to save an unbalanced move.

---

<div class="post-metadata">

### Author: ![risto3](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@risto3](https://discuss.tryton.org/u/risto3)
#### Post date: [November 25, 2019, 12:01pm UTC](https://discuss.tryton.org/t/impede-move-line-deletion-directly-from-account-plan-and-gl/1994/5 "2019-11-25T12:01:19Z")

</div>

I guess I see what you’re striving at… in Oerp, the moves had draft, valid & posted to this effect.  
I wonder if that’s not such a bad idea, where valid can’t be changed without going back to draft  
(like invoices & statements).
