Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4700 Tampilan

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()
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Apr 25
562
0
Jul 22
2058
6
Mar 18
5699
0
Mar 15
3699
1
Mar 15
6931