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.

0

AttributeError: 'int' object has no attribute 'get'

By
Lady Sharmane Udtuhan
on 2/12/14, 4:41 AM 703 views

Here is my onchange code that gets the error :

         def onchange_asset_id(self,cr,uid,asset_id,qty,bal_units,context=None ):
    tot = 0
    rem = 0


    rental_id = None


    value = {'value':{'asset_id': ''}}
    with_asset = 0.0
    rental_obj = self.pool.get('fleet.rentals')            
    rental_id = context.get('rent_id')
    if rental_id:
        for rid in rental_obj.browse(cr,uid,[rent_id],context=None):

            sqlreq = "select sum(qty), asset_id " \
                     "from fleet_rentals fr ,fleet_rentals_line frl " \
                      "where fr.id = frl.rent_id and asset_id = " + str(asset_id) + " " \
                      "and frl.id != " +str(rental_id) + " " \
                      "group by  asset_id "


            cr.execute(sqlreq)

            resline =  cr.fetchall()

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 2/12/14, 4:41 AM
Seen: 703 times
Last updated: 3/16/15, 8:10 AM