This question has been flagged
2651 Views

Hello i got a function and respond for ajax request and i want to get a row data from database but i did get success. please help.

class customone2many(oeweb.Controller):
_cp_path = "/product_extensions/customone2many"

@oeweb.jsonrequest
def test_ajax(self, bom_lines_id=0):
    return  self._get_product_id( cr, uid, bom_lines_id)
    #return {'product_id': '70'}
def _get_product_id(self, cr, uid, bom_lines_id):
    cr.execute('SELECT product_id FROM mrp_bom WHERE id = ' + bom_lines_id)
    res = cr.fetchone()
    return res and res[0] or False

could you tell me how can i get the cr and uid variable?

Avatar
Discard