Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

4

Please complete this code.. [Closed]

By
priyankahdp
on 3/22/13, 4:37 AM 554 views

The Question has been closed for reason: not a real question

by
Fabien Pinckaers (fp)
on 03/22/2013 06:41:28

bpl.py class

'bpl_company_id': fields.function(_get_company_data, fnct_inv=_set_company_data, type='one2many', relation='hr.department', string="Company"),
bpl_estate_id
bpl_division_id

i need to add below sql query and retrieve companies (no parent id) then need to get estate under that selected company then division under selected estate

company - > Estate -> Division

my incomplete function

    cr.execute("""
    select * from hr_department
    where parent_id is null
    """)

return cr. fetch method..

please advice me to complete this code.try with various samples.but unable to get the result

In the above Sql query where condition add "and company_id= 'id of the Estate Division' " or use left join with table res_company as company on company.name = 'estate'.

Prakash
on 3/22/13, 4:47 AM

this is a first field..it search for non parent id record.thatswhy i state that any issue with it.?

priyankahdp
on 3/22/13, 4:59 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 3/22/13, 4:37 AM
Seen: 554 times
Last updated: 3/16/15, 8:10 AM