← Back to team overview

openerp-india team mailing list archive

[Bug 932641] Re: [trunk 6.1] cannot unlink analytic account due to project module

 

Fixed with stable 6.1,
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-572490-rha
r6664 rid: rha@xxxxxxxxxxx-20120312050112-87unmt000b4swi5t

stable 6.0,
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-572490-rha
r5123 rid: rha@xxxxxxxxxxx-20120312051301-wrf5ojp629n7kdkn

Thanks for reporting this bug!

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

-- 
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/932641

Title:
  [trunk 6.1] cannot unlink analytic account due to project module

Status in OpenERP Addons (modules):
  Fix Committed

Bug description:
  Hi,

  When you install the project module, the unlink method of
  account.analytic.account is modified to check that no project exists
  on this account.

  addons/project/project.py(1144)unlink()
  -> def unlink(self, cr, uid, ids, *args, **kwargs):
  1144 ->     def unlink(self, cr, uid, ids, *args, **kwargs):
  1145            project_obj = self.pool.get('project.project')
  1146            analytic_ids = project_obj.search(cr, uid, [('analytic_account_id','in',ids)])
  1147            if analytic_ids:
  1148                raise osv.except_osv(_('Warning !'), _('Please delete the project linked with this account first.'))
  1149            return super(account_analytic_account, self).unlink(cr, uid, ids, *args, **kwargs)

  The issue is that the check at line 1146 is executed with current uid and that forces to give read access to project.project to current uid. This means that when you install the project module, you have to give project rights to your users using analytic accounting even if they don't use project at all.
  So either a user having analytic accounting access rights should always get project access rights when you install the project module, or the check at line 1146 should be performed with uid=1

  J-E

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


References