[6.0] and [5.x] account_analytic_line must not be deleted if the journal etc is deleted

Bug #690753 reported by Ferdinand
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
5.0
Won't Fix
Undecided
Unassigned
Trunk
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

account_analytic_line.py
        'product_uom_id': fields.many2one('product.uom', 'UoM'),
        'product_id': fields.many2one('product.product', 'Product'),
        'general_account_id': fields.many2one('account.account', 'General Account', required=True, ondelete='cascade'),
        'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
        'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='cascade', select=True),

We just lost (and recoverd) 2 years of timesheet data because someone accidently deleted a record in account.analytic.journal.

IMHO the "ondelete" must be removed to conform to good accounting practice.
at best the resources can be set to inactive, but tehy should never be deleted.

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello Ferdinand,

I have fixed the problem in lp:~openerp-dev/openobject-addons/trunk-dev-addons3-ara branch, It will be merged soon with Trunk addons.

Revision No: 4587
Revision ID: <email address hidden>

Thank you,
ara

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Hello i found this bug affects me but in other side, i am agree with remove in journal_id fields, but ondelete for account.move.line was changed for 'restrict', i am consider this a bug so if accountant cancel a move analytic must be removed too.

So i propose for move_id fields change ondelete='cascade'.

Regards,

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

Hello i want to correct my comment, so the ondelete param is ok now in system.
http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/view/head:/account/account_analytic_line.py#L35

But there is a problem with analytic lines, when user cancel o unlink an account move analytic lines must be deleted too.
I think this need an implementation in unlink and button_cancel method for account_move.

Wait for your opinion.

Regards,

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Cristian,

Your issue is totally different then the reported bug, the main but is reported for "If journal is deleted then it's analytic line must not be deleted". That's why we have put a ondelete='restrict on move line.

As per your last comment you describe that "If accountant is cancel the analytic journal entry then It's related move line must be deleted".

But I am not agree with you as well as It's not a bug rather then It's your suggestion. If you want to get a "Opinion" on this then you can post a new bug report foe this.

Thanks for understanding!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.