[Trunk/7.0]Journals can not be deleted, even when they have no entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Low
|
OpenERP R&D Addons Team 3 |
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.
This is also just as relevant to any journal created by the user.
There is indeed a table account.
Related branches
- qdp (OpenERP): Needs Fixing
- Phil Frost (community): Disapprove
-
Diff: 17 lines (+8/-0)1 file modifiedaccount/account_cash_statement.py (+8/-0)
summary: |
- Journals can not be deleted, even when they have no entries + [Trunk/7.0]Journals can not be deleted, even when they have no entries |
Changed in openobject-addons: | |
status: | New → Confirmed |
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3) |
importance: | Undecided → Low |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
milestone: | none → 7.0 |
The origin of these records seems to be in account/ account_ cash_statement. py around line 321:
class account_ journal( osv.osv) :
_inherit = 'account.journal'
def _default_ cashbox_ line_ids( self, cr, uid, context=None):
dict( pieces= value) for value in [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500]
# Return a list of coins in Euros.
result = [
]
return result
_columns = {
'cashbox_ line_ids' : fields. one2many( 'account. journal. cashbox. line', 'journal_id', 'CashBox'),
}
_defaults = {
'cashbox_ line_ids' : _default_ cashbox_ line_ids,
}
Worth noting that these values are wrong for many currencies. USD, for example, does not have $0.02, $0.20, or $200 pieces, and does have a $0.25 piece, but since I can't figure out what these records do, if anything, I can't say if this is actually a problem.