← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 758699] Re: delete project don´t delete analytic account

 

proposed solution

Extend class account_analytic_account to add inverse relation:

(in project/project.py)

class account_analytic_account(osv.osv):

    _inherit = 'account.analytic.account'
    _description = 'Analytic Account'

    def create(self, cr, uid, vals, context=None):
        if context is None:
            context = {}
        if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
            vals['child_ids'] = []
        return super(account_analytic_account, self).create(cr, uid, vals, context=context)

+    _columns = {
+           
+            'inherits_project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),         
+   
+    }
    
account_analytic_account()

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/758699

Title:
  delete project don´t delete analytic account

Status in OpenERP Modules (addons):
  New

Bug description:
  si borras un proyecto a conta analitica asociada no se borra.

  reproduce:
  Create a db.
  Install project module.
  Create a project.
  Delete the project.

  Analytical account of the project is not deleted.



References