Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Read records in Odoo9

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 252
    Comment on it

    When we face any issue in database records value at that situation we use read records value and record data is accessible with the read() method, which takes a list of ids (as returned bysearch()) and optionally a list of fields to fetch. And by default, it will fetch all the fields that the current user can read, which tends to be a huge amount and insert the database value. For example you can see the below code.

    ids = models.execute_kw(db, uid, password,
        'res.partner', 'search',
        [[['is_company', '=', True], ['Test', '=', True]]],
        {'limit': 1})
    [record] = models.execute_kw(db, uid, password,
        'res.partner', 'read', [ids])
    # count the number of fields fetched by default
    len(record)
    

    Note- With the help of this code we can insert the database value easily in Odoo9.

 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: