In Accounting Schema > Account Schema Dimensions
normal by below ticket, we can't delete, change record has type is account, org
but I can with below testcase:
1. change type from account to "Sub Account", save record
2. delete record success.
Hi Carlos, you can write down logic of constrain in before save and before delete. I can recode, and test it.
Reproduced by Anton Mostovenko
Reproduced too. Accounting dimension is one of the most critical setup. I don’t think the record should be deleteable. Should implement both Application Dictionary validation and beforeDelete prevention.
are you interested in working on it?
A very simple patch is to make the account type not updatable.
Hi @globalqss, I think that shouldn't apply to new C_AcctSchema_Element record.
Hi , after analyzing this further and doing some tests, I think this validation (forbidding deleting or inactivating these records).
This was added on this commit:
following this ticket:
The logic followed on that ticket is missing the fact that you can have multiple elements for the "Account" type, with different "Account Element" - this is a common case for example to add other trees, not just accounts.
So, my test case went like the following:
I added a second record for organization (which is wrong), but after that I cannot delete it and also I cannot inactivate it.
samely I added a second record for account - suppose a user does the same and then notice it was a mistake, then the user cannot change the type, cannot inactivate it and cannot delete it - it will be forced to use SQL (which is very bad IMHO)
So, taking into account that if a user mistakenly deletes or inactivate such element - the solution is very simple, is just to add it back - I think is better to drop that validation.
I made a second commit in the pull request reverting that part for the original commit.