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
    • 179
    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.

    def _get_project_and_children(self, cr, uid, ids, context=None):
    
            res = dict.fromkeys(ids, None)
            while ids:
                cr.execute("""
                    SELECT project.id, parent.id
                    FROM project_project project, project_project parent, account_analytic_account account
                    WHERE project.analytic_account_id = account.id
                    AND parent.analytic_account_id = account.parent_id
                    AND parent.id IN %s
                    """, (tuple(ids),))
                dic = dict(cr.fetchall())
                res.update(dic)
                ids = dic.keys()
            return res
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: