Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to retrieve all children projects of project ids in openerp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 216
    Comment on it

    TO retrieve all children projects of project ids in project module and return a dictionary mapping each project to appiar its parent.id in parent project in project module (or None)in openerp. use this code given below in .py file in openerp.

    1. def _get_project_and_children(self, cr, uid, ids, context=None):
    2.  
    3. res = dict.fromkeys(ids, None)
    4. while ids:
    5. cr.execute("""
    6. SELECT project.id, parent.id
    7. FROM project_project project, project_project parent, account_analytic_account account
    8. WHERE project.analytic_account_id = account.id
    9. AND parent.analytic_account_id = account.parent_id
    10. AND parent.id IN %s
    11. """, (tuple(ids),))
    12. dic = dict(cr.fetchall())
    13. res.update(dic)
    14. ids = dic.keys()
    15. return res

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: