← Back to team overview

openerp-india team mailing list archive

[Bug 1102612] Re: [Trunk/7.0]Journals can not be deleted, even when they have no entries

 

I see your change, and that error message is a little better. But,
that's not what the bug is about. You are right, if I have a cash
register assigned to the journal, I can go there and delete the cash
control entries, and then I can delete the journal. But just changing
the error message doesn't really address the issue, on several levels.

The error message in the proposed branch is: "You cannot remove an
account that contains Cash Control items." What's a "cash control item?"
I doubt I'd know, if I hadn't already figured it out by prodding around
in the database. In fact, I'd find the old error message more useful,
because at least it told me which table contained the thing that needed
to be deleted. With the new error message, all I can do is wander around
the interface looking for that "cash control" tab which is hidden three
layers deep. A useful error message would tell me where to look.

But, what if there isn't a cash register associated with the journal?
This is the case for the examples I gave, and is the case for most
journals. Should I have to go create a cash register before I can delete
a journal? Probably not.

The solution, I think, is to either not create cash control items for
journals that are not associated with cash registers, or change this
foreign key constraint to ON DELETE CASCADE. After all, what value is
there in the cash control items if the journal does not exist? Or even
better, implement both solutions.

** Changed in: openobject-addons
       Status: Fix Committed => Confirmed

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1102612

Title:
  [Trunk/7.0]Journals can not be deleted, even when they have no entries

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  7.0 creates, as part of the default accounting setup, a "Bank" and a
  "Cash" journal. Attempting to delete either of these journals presents
  the cryptic error:

  Integrity Error

  The operation cannot be completed, probably due to the following:
  - deletion: you may be trying to delete a record while other records still reference it
  - creation/update: a mandatory field is not correctly set

  [object with reference: account.journal.cashbox.line -
  account.journal.cashbox.line]

  This is also just as relevant to any journal created by the user.

  There is indeed a table account.journal.cashbox.line that references
  the journal, but it's extra confusing to a user since no action was
  ever taken to associate this journal with a cashbox, and there does
  not appear to be any way to delete the offending
  account.journal.cashbox.line records through the UI that I have found.
  Deleting them directly from the database is of course possible, but
  probably not an acceptable workaround for typical users.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1102612/+subscriptions


References