İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
7362 Görünümler

Hi Community,

See my code

def write(self, vals):

        for i in self:

            if (i.amount_receivable < i.credit_limit): 

                raise UserError("Your Receivable Amount is Less")

            else:

                print("\n \n \n Amount is Greater Than")

        return super(ResPartner1, self).write(vals)  

 

Avatar
Vazgeç
En İyi Yanıt

Hi,

Just removing the iteration of the self over the for loop and see whether it make any difference.

Sample:

def write(self, vals):
res = super(EventEvent, self).write(vals)
if vals.get('organizer_id'):
self.message_subscribe([vals['organizer_id']])
return res


Thanks

Avatar
Vazgeç
Üretici

Thanks for ypur reply @Niyas

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Tem 19
4601
1
Eyl 18
2909
1
Mar 15
5379
2
Ara 21
6977
1
Kas 20
2660