Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to delete an account #7812

Closed
howardlowndes opened this issue Dec 13, 2023 · 4 comments · Fixed by #7820
Closed

Unable to delete an account #7812

howardlowndes opened this issue Dec 13, 2023 · 4 comments · Fixed by #7820
Labels
type:bug Bug that will be worked on as resources permit

Comments

@howardlowndes
Copy link

Version

1.11.4

What browsers are you seeing the problem on?

This problem isn't browser related

What happened?

Trying to delete an account item that was previously an Inventory summary account (but is no longer) throws the following error.

`23503: ERROR: update or delete on table "account" violates foreign key constraint "parts_inventory_accno_id_fkey" on table "parts"
DETAIL: Key (id)=(22) is still referenced from table "parts".
CONTEXT: SQL statement "DELETE FROM account WHERE id = in_id"
PL/pgSQL function account__delete(integer) line 17 at SQL statement

dbversion: 1.11.4, company: PlayAMS`

What should have happened?

This is probably as a result of the error reported in #7811 not allowing a part to be deleted

@ehuelsmann
Copy link
Member

Hmm. What you're also saying here is that the "can I delete this account" check forgets to check some of the foreign keys. If the account is used in a part, it shouldn't be offering to delete the account.

Thanks for reporting!

@howardlowndes
Copy link
Author

howardlowndes commented Dec 15, 2023 via email

@ehuelsmann
Copy link
Member

That's correct: you couldn't delete the part and the part was using the account. So: the [delete] link on the account should not have been offered. #7811 is about being able to delete the account (which fails). I'm looking into that.

When #7811 is fixed (and your setup updated) and you delete the part, then you should be able successfully to remove the account.

@ehuelsmann
Copy link
Member

@howardlowndes 1.11.6 was released earlier today, with this fix included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Bug that will be worked on as resources permit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants