تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4706 أدوات العرض

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()
الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أبريل 25
563
0
يوليو 22
2059
6
مارس 18
5707
0
مارس 15
3700
1
مارس 15
6933